浏览代码

feat: New UI interface Mirror search support is more comprehensive, support for mirror search and TAG search

dqzboy 6 月之前
父节点
当前提交
94a62f217d

+ 22 - 21
README.md

@@ -77,7 +77,7 @@
 - [x] 支持一键配置本机Docker代理和容器服务代理(HTTP_PROXY),仅支持http
 - [x] 支持国内服务器一键部署,解决国内环境无法安装Docker\Compose服务难题
 - [x] 支持主流Linux发行版操作系统,例如Centos、Ubuntu、Rocky、Debian、Rhel等,支持主流ARCH架构下部署,包括linux/amd64、linux/arm64
-- [x] HubCMD-UI服务,实现镜像搜索、文档教程、容器管理、容器监控告警、网络测试等功能,[Demo](https://dqzboy.github.io/proxyui/)
+- [x] HubCMD-UI服务,面板展示、镜像搜索、文档教程、容器管理、容器监控、网络测试、用户中心等功能
 
 ## 📦 部署
 ### 通过项目脚本部署
@@ -97,6 +97,11 @@ bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/dqzboy/Docker-Proxy/install/Do
 bash -c "$(curl -fsSL https://ghp.ci/https://raw.githubusercontent.com/dqzboy/Docker-Proxy/main/install/DockerProxy_Install.sh)"
 ```
 
+- hubcmd-ui面板脚本安装
+```
+执行上面脚本,选项为:2 ---> 8 ---> 1
+```
+
 ### 部署到第三方平台
 <details>
 <summary><strong>部署到 Render</strong></summary>
@@ -198,18 +203,6 @@ docker pull gcr.your_domain_name/google-containers/pause:3.1
 > [自建Docker镜像加速服务:加速与优化镜像管理](https://www.dqzboy.com/8709.html)<br>
 > [自建Docker镜像加速,并把域名托管到CF加速镜像拉取](https://www.dqzboy.com/17665.html)
 
-## 📚 展示
-<br/>
-<table>
-    <tr>
-      <td width="50%" align="center"><b>系统环境检查</b></td>
-      <td width="50%" align="center"><b>服务部署安装</b></td>
-    </tr>
-    <tr>
-        <td width="50%" align="center"><img src="https://github.com/dqzboy/Docker-Proxy/assets/42825450/55df7f6f-c788-4200-9bcd-631998dc53ef?raw=true"></td>
-        <td width="50%" align="center"><img src="https://github.com/dqzboy/Docker-Proxy/assets/42825450/c544fb1e-ecd5-447c-9661-0c5913586118?raw=true"></td>
-    </tr>
-</table>
 
 ## 💻 UI界面
 
@@ -218,20 +211,28 @@ docker pull gcr.your_domain_name/google-containers/pause:3.1
 <br/>
 <table>
     <tr>
-      <td width="50%" align="center"><b>Docker Registry UI</b></td>
-      <td width="50%" align="center"><b>Docker HubCMD UI</b></td>
+      <td width="50%" align="center"><b>镜像加速</b></td>
+      <td width="50%" align="center"><b>镜像搜索</b></td>
+    </tr>
+    <tr>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/b3a6a80a-284c-4117-b1bf-9d4c4556717f"?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/b3a6a80a-284c-4117-b1bf-9d4c4556717f"?raw=true"></td>
+    </tr>
+    <tr>
+      <td width="50%" align="center"><b>文档管理</b></td>
+      <td width="50%" align="center"><b>TAG搜索</b></td>
     </tr>
     <tr>
-        <td width="50%" align="center"><img src="https://github.com/dqzboy/Docker-Proxy/assets/42825450/0ddb041b-64f6-4d93-b5bf-85ad3b53d0e0?raw=true"></td>
-        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/f394041e-954c-4b04-9cbb-d61c43290db6?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/66be3dae-8d46-4144-932e-c5493c93fe2f"?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/f1208858-ec69-47b3-88d2-9a0bc112ea94"?raw=true"></td>
     </tr>
     <tr>
-      <td width="50%" align="center"><b>文档教程管理</b></td>
-      <td width="50%" align="center"><b>HubCMD-UI后台</b></td>
+      <td width="50%" align="center"><b>控制面板</b></td>
+      <td width="50%" align="center"><b>容器管理</b></td>
     </tr>
     <tr>
-        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/6f34d717-95c8-47b4-89b8-812151904448?raw=true"></td>
-        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/816c95af-dbd1-46ce-b550-87e0853f23e2?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/bc066047-15d3-45fc-b363-ded37bfe1121"?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/78ad0e29-abfd-47d6-a132-c5b49b48bc95"?raw=true"></td>
     </tr>
 </table>
 

+ 3 - 3
hubcmdui/README.md

@@ -40,7 +40,7 @@ npm install
 
 #### 3. 启动服务
 ```bash
-node server.js 
+node server.js
 ```
 
 ## 📦 Docker运行
@@ -91,13 +91,13 @@ docker logs -f [容器ID或名称]
 
 <table>
     <tr>
-        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/f394041e-954c-4b04-9cbb-d61c43290db6"?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/bfe09d99-6727-43bc-9c2d-73e34d881953"?raw=true"></td>
     </tr>
 </table>
 
 <table>
     <tr>
-        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/75c40b0b-d75b-4065-9678-d6fc8d2d282a"?raw=true"></td>
+        <td width="50%" align="center"><img src="https://github.com/user-attachments/assets/42c4337e-44cb-4c35-bc6f-a5d21f3d1184"?raw=true"></td>
     </tr>
 </table>
 

+ 6 - 1
hubcmdui/config.json

@@ -10,6 +10,11 @@
       "text": "GitHub",
       "link": "https://github.com/dqzboy/Docker-Proxy",
       "newTab": true
+    },
+    {
+      "text": "VPS推荐",
+      "link": "https://dqzboy.github.io/proxyui/racknerd",
+      "newTab": true
     }
   ],
   "adImages": [
@@ -33,6 +38,6 @@
     "telegramToken": "",
     "telegramChatId": "",
     "monitorInterval": 60,
-    "isEnabled": true
+    "isEnabled": false
   }
 }

+ 1 - 1
hubcmdui/documentation/1724594777670.json

@@ -1 +1 @@
-{"title":"Docker 配置镜像加速","content":"### Docker 配置镜像加速\n- 修改文件 `/etc/docker/daemon.json`(如果不存在则创建)\n\n```shell\nsudo mkdir -p /etc/docker\nsudo vi /etc/docker/daemon.json\n{\n  \"registry-mirrors\": [\"https://<代理加速地址>\"]\n}\n\nsudo systemctl daemon-reload\nsudo systemctl restart docker\n```","published":false}
+{"title":"Docker 配置镜像加速","content":"### Docker 配置镜像加速\n- 修改文件 `/etc/docker/daemon.json`(如果不存在则创建)\n\n```shell\nsudo mkdir -p /etc/docker\nsudo vi /etc/docker/daemon.json\n{\n  \"registry-mirrors\": [\"https://<代理加速地址>\"]\n}\n\nsudo systemctl daemon-reload\nsudo systemctl restart docker\n```","published":true}

+ 1 - 1
hubcmdui/documentation/1737713570870.json

@@ -1 +1 @@
-{"title":"Containerd 配置镜像加速","content":"### Containerd 配置镜像加速\n-  `/etc/containerd/config.toml`,添加如下的配置:\n\n```yaml\n    [plugins.\"io.containerd.grpc.v1.cri\".registry]\n      [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"docker.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"k8s.gcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"gcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"ghcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"quay.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n```","published":false}
+{"title":"Containerd 配置镜像加速","content":"### Containerd 配置镜像加速\n-  `/etc/containerd/config.toml`,添加如下的配置:\n\n```yaml\n    [plugins.\"io.containerd.grpc.v1.cri\".registry]\n      [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"docker.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"k8s.gcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"gcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"ghcr.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"quay.io\"]\n          endpoint = [\"https://<代理加速地址>\"]\n```","published":true}

+ 1 - 1
hubcmdui/documentation/1737713707391.json

@@ -1 +1 @@
-{"title":"Podman 配置镜像加速","content":"### Podman 配置镜像加速\n- 修改配置文件 `/etc/containers/registries.conf`,添加配置:\n\n```yaml\nunqualified-search-registries = ['docker.io', 'k8s.gcr.io', 'gcr.io', 'ghcr.io', 'quay.io']\n\n[[registry]]\nprefix = \"docker.io\"\ninsecure = true\nlocation = \"registry-1.docker.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"k8s.gcr.io\"\ninsecure = true\nlocation = \"k8s.gcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"gcr.io\"\ninsecure = true\nlocation = \"gcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"ghcr.io\"\ninsecure = true\nlocation = \"ghcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"quay.io\"\ninsecure = true\nlocation = \"quay.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n```","published":false}
+{"title":"Podman 配置镜像加速","content":"### Podman 配置镜像加速\n- 修改配置文件 `/etc/containers/registries.conf`,添加配置:\n\n```yaml\nunqualified-search-registries = ['docker.io', 'k8s.gcr.io', 'gcr.io', 'ghcr.io', 'quay.io']\n\n[[registry]]\nprefix = \"docker.io\"\ninsecure = true\nlocation = \"registry-1.docker.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"k8s.gcr.io\"\ninsecure = true\nlocation = \"k8s.gcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"gcr.io\"\ninsecure = true\nlocation = \"gcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"ghcr.io\"\ninsecure = true\nlocation = \"ghcr.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n\n[[registry]]\nprefix = \"quay.io\"\ninsecure = true\nlocation = \"quay.io\"\n\n[[registry.mirror]]\nlocation = \"https://<代理加速地址>\"\n```","published":true}

+ 209 - 20
hubcmdui/logger.js

@@ -1,27 +1,216 @@
-let chalk;
-import('chalk').then(module => {
-    chalk = module.default;
-}).catch(err => {
-    console.error('Failed to load chalk:', err);
-});
+const fs = require('fs').promises;
+const path = require('path');
+const util = require('util');
+
+// 日志级别配置
+const LOG_LEVELS = {
+    debug: 0,
+    info: 1,
+    success: 2,
+    warn: 3,
+    error: 4,
+    fatal: 5
+};
+
+// 默认配置
+const config = {
+    level: process.env.LOG_LEVEL || 'info',
+    logToFile: process.env.LOG_TO_FILE === 'true',
+    logDirectory: path.join(__dirname, 'logs'),
+    logFileName: 'app.log',
+    maxLogSize: 10 * 1024 * 1024, // 10MB
+    colorize: process.env.NODE_ENV !== 'production'
+};
+
+// 确保日志目录存在
+async function ensureLogDirectory() {
+    if (config.logToFile) {
+        try {
+            await fs.access(config.logDirectory);
+        } catch (error) {
+            if (error.code === 'ENOENT') {
+                await fs.mkdir(config.logDirectory, { recursive: true });
+                console.log(`Created log directory: ${config.logDirectory}`);
+            } else {
+                throw error;
+            }
+        }
+    }
+}
 
+// 格式化时间 - 改进为更易读的格式
+function getTimestamp() {
+    const now = new Date();
+    const year = now.getFullYear();
+    const month = String(now.getMonth() + 1).padStart(2, '0');
+    const day = String(now.getDate()).padStart(2, '0');
+    const hours = String(now.getHours()).padStart(2, '0');
+    const minutes = String(now.getMinutes()).padStart(2, '0');
+    const seconds = String(now.getSeconds()).padStart(2, '0');
+    const milliseconds = String(now.getMilliseconds()).padStart(3, '0');
+    
+    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
+}
+
+// 颜色代码
+const COLORS = {
+    reset: '\x1b[0m',
+    bright: '\x1b[1m',
+    dim: '\x1b[2m',
+    underscore: '\x1b[4m',
+    blink: '\x1b[5m',
+    reverse: '\x1b[7m',
+    hidden: '\x1b[8m',
+    
+    // 前景色
+    black: '\x1b[30m',
+    red: '\x1b[31m',
+    green: '\x1b[32m',
+    yellow: '\x1b[33m',
+    blue: '\x1b[34m',
+    magenta: '\x1b[35m',
+    cyan: '\x1b[36m',
+    white: '\x1b[37m',
+    
+    // 背景色
+    bgBlack: '\x1b[40m',
+    bgRed: '\x1b[41m',
+    bgGreen: '\x1b[42m',
+    bgYellow: '\x1b[43m',
+    bgBlue: '\x1b[44m',
+    bgMagenta: '\x1b[45m',
+    bgCyan: '\x1b[46m',
+    bgWhite: '\x1b[47m'
+};
+
+// 日志级别对应的颜色和标签
+const LEVEL_STYLES = {
+    debug: { color: COLORS.cyan, label: 'DEBUG' },
+    info: { color: COLORS.blue, label: 'INFO ' },
+    success: { color: COLORS.green, label: 'DONE ' },
+    warn: { color: COLORS.yellow, label: 'WARN ' },
+    error: { color: COLORS.red, label: 'ERROR' },
+    fatal: { color: COLORS.bright + COLORS.red, label: 'FATAL' }
+};
+
+// 创建日志条目 - 改进格式
+function createLogEntry(level, message, meta = {}) {
+    const timestamp = getTimestamp();
+    const levelInfo = LEVEL_STYLES[level] || { label: level.toUpperCase() };
+    
+    // 元数据格式化 - 更简洁的呈现方式
+    let metaOutput = '';
+    if (meta instanceof Error) {
+        metaOutput = `\n  ${COLORS.red}Error: ${meta.message}${COLORS.reset}`;
+        if (meta.stack) {
+            metaOutput += `\n  ${COLORS.dim}Stack: ${meta.stack.split('\n').join('\n  ')}${COLORS.reset}`;
+        }
+    } else if (Object.keys(meta).length > 0) {
+        // 检查是否为HTTP请求信息,如果是则使用更简洁的格式
+        if (meta.ip && meta.userAgent) {
+            metaOutput = ` ${COLORS.dim}from ${meta.ip}${COLORS.reset}`;
+        } else {
+            // 对于其他元数据,仍然使用检查器但格式更友好
+            metaOutput = `\n  ${util.inspect(meta, { colors: true, depth: 3 })}`;
+        }
+    }
+    
+    // 为控制台格式化日志
+    const consoleOutput = config.colorize ? 
+        `${COLORS.dim}${timestamp}${COLORS.reset} [${levelInfo.color}${levelInfo.label}${COLORS.reset}] ${message}${metaOutput}` :
+        `${timestamp} [${levelInfo.label}] ${message}${metaOutput ? ' ' + metaOutput.trim() : ''}`;
+    
+    // 为文件准备JSON格式日志
+    const logObject = {
+        timestamp,
+        level: level,
+        message
+    };
+    
+    if (Object.keys(meta).length > 0) {
+        logObject.meta = meta instanceof Error ? 
+            { name: meta.name, message: meta.message, stack: meta.stack } : 
+            meta;
+    }
+    
+    return {
+        formatted: consoleOutput,
+        json: JSON.stringify(logObject)
+    };
+}
+
+// 日志函数
+async function log(level, message, meta = {}) {
+    if (LOG_LEVELS[level] < LOG_LEVELS[config.level]) {
+        return;
+    }
+
+    const { formatted, json } = createLogEntry(level, message, meta);
+
+    // 控制台输出
+    console.log(formatted);
+
+    // 文件日志
+    if (config.logToFile) {
+        try {
+            await ensureLogDirectory();
+            const logFilePath = path.join(config.logDirectory, config.logFileName);
+            await fs.appendFile(logFilePath, json + '\n', 'utf8');
+        } catch (err) {
+            console.error(`${COLORS.red}Error writing to log file: ${err.message}${COLORS.reset}`);
+        }
+    }
+}
+
+// 日志API
 const logger = {
-    info: (message) => {
-        if (chalk) console.log(chalk.blue(`[INFO] ${message}`));
-        else console.log(`[INFO] ${message}`);
-    },
-    warn: (message) => {
-        if (chalk) console.log(chalk.yellow(`[WARN] ${message}`));
-        else console.log(`[WARN] ${message}`);
+    debug: (message, meta = {}) => log('debug', message, meta),
+    info: (message, meta = {}) => log('info', message, meta),
+    success: (message, meta = {}) => log('success', message, meta),
+    warn: (message, meta = {}) => log('warn', message, meta),
+    error: (message, meta = {}) => log('error', message, meta),
+    fatal: (message, meta = {}) => log('fatal', message, meta),
+    
+    // 配置方法
+    configure: (options) => {
+        Object.assign(config, options);
     },
-    error: (message) => {
-        if (chalk) console.log(chalk.red(`[ERROR] ${message}`));
-        else console.log(`[ERROR] ${message}`);
-    },
-    success: (message) => {
-        if (chalk) console.log(chalk.green(`[SUCCESS] ${message}`));
-        else console.log(`[SUCCESS] ${message}`);
+    
+    // HTTP请求日志方法 - 简化输出格式
+    request: (req, res, duration) => {
+        const status = res.statusCode;
+        const method = req.method;
+        const url = req.originalUrl || req.url;
+        const userAgent = req.headers['user-agent'] || '-';
+        const ip = req.ip || req.connection.remoteAddress || '-';
+        
+        let level = 'info';
+        if (status >= 500) level = 'error';
+        else if (status >= 400) level = 'warn';
+        
+        // 为HTTP请求创建更简洁的日志消息
+        let statusIndicator = '';
+        if (config.colorize) {
+            if (status >= 500) statusIndicator = COLORS.red;
+            else if (status >= 400) statusIndicator = COLORS.yellow;
+            else if (status >= 300) statusIndicator = COLORS.cyan;
+            else if (status >= 200) statusIndicator = COLORS.green;
+            statusIndicator += status + COLORS.reset;
+        } else {
+            statusIndicator = status;
+        }
+        
+        // 简化的请求日志格式
+        const message = `${method} ${url} ${statusIndicator} ${duration}ms`;
+        
+        // 传递ip和userAgent作为元数据,但以简洁方式显示
+        log(level, message, { ip, userAgent });
     }
 };
 
+// 初始化
+ensureLogDirectory().catch(err => {
+    console.error(`${COLORS.red}Failed to initialize logger: ${err.message}${COLORS.reset}`);
+});
+
 module.exports = logger;

+ 3 - 0
hubcmdui/package.json

@@ -1,6 +1,7 @@
 {
   "dependencies": {
     "axios": "^1.7.5",
+    "axios-retry": "^3.5.0",
     "bcrypt": "^5.1.1",
     "chalk": "^5.3.0",
     "cors": "^2.8.5",
@@ -8,6 +9,8 @@
     "express": "^4.19.2",
     "express-session": "^1.18.0",
     "morgan": "^1.10.0",
+    "node-cache": "^5.1.2",
+    "p-limit": "^3.1.0",
     "validator": "^13.12.0",
     "ws": "^8.18.0"
   }

文件差异内容过多而无法显示
+ 834 - 155
hubcmdui/server.js


文件差异内容过多而无法显示
+ 638 - 283
hubcmdui/web/admin.html


+ 3474 - 0
hubcmdui/web/admin.html_bak

@@ -0,0 +1,3474 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Docker 镜像代理加速 - 管理面板</title>
+    <link rel="icon" href="https://cdn.jsdelivr.net/gh/dqzboy/Blog-Image/BlogCourse/docker-proxy.png" type="image/png">
+    <!-- 引入前端样式表 -->
+    <link rel="stylesheet" href="style.css">
+    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/editormd.min.css">
+    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
+    <script src="https://cdn.jsdelivr.net/npm/[email protected]/editormd.min.js"></script>
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+    <style>
+        /* 管理面板特定样式 */
+        .admin-container {
+            display: flex;
+            min-height: 100vh;
+            background-color: var(--background-color);
+        }
+
+        .sidebar {
+            width: 280px;
+            background-color: var(--container-bg);
+            box-shadow: var(--shadow-md);
+            padding: 1.5rem 0;
+            z-index: 10;
+            transition: all 0.3s ease;
+        }
+
+        /* 用户信息部分样式 */
+        .user-profile {
+            padding: 1rem 1.5rem;
+            margin-bottom: 1.5rem;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            position: relative;
+        }
+
+        .user-avatar {
+            width: 70px;
+            height: 70px;
+            border-radius: 50%;
+            background-color: var(--primary-light);
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            font-size: 1.8rem;
+            color: var(--primary-color);
+            margin-bottom: 0.8rem;
+            box-shadow: var(--shadow-sm);
+        }
+
+        .user-info {
+            text-align: center;
+            margin-bottom: 0.5rem;
+        }
+
+        .user-name {
+            font-weight: 600;
+            font-size: 1.1rem;
+            color: var(--text-primary);
+            margin-bottom: 0.25rem;
+        }
+
+        .user-role {
+            color: var(--text-secondary);
+            font-size: 0.85rem;
+            margin-bottom: 0.5rem;
+        }
+
+        .user-actions {
+            display: flex;
+            gap: 0.5rem;
+            margin-top: 0.5rem;
+        }
+
+        .user-action-btn {
+            padding: 0.4rem 0.8rem;
+            font-size: 0.85rem;
+            border-radius: var(--radius-sm);
+            background-color: rgba(61, 124, 244, 0.1);
+            color: var(--primary-color);
+            cursor: pointer;
+            transition: all var(--transition-fast);
+        }
+
+        .user-action-btn:hover {
+            background-color: var(--primary-color);
+            color: white;
+        }
+
+        .user-action-btn.logout {
+            background-color: rgba(255, 82, 82, 0.1);
+            color: var(--danger-color);
+        }
+
+        .user-action-btn.logout:hover {
+            background-color: var(--danger-color);
+            color: white;
+        }
+
+        /* 仪表盘卡片样式 */
+        .dashboard-grid {
+            display: grid;
+            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+            gap: 1.5rem;
+            margin-bottom: 2rem;
+        }
+
+        .dashboard-card {
+            background-color: var(--container-bg);
+            border-radius: var(--radius-md);
+            box-shadow: var(--shadow-sm);
+            padding: 1.5rem;
+            transition: all var(--transition-fast);
+            border: 1px solid var(--border-light);
+            position: relative;
+            overflow: hidden;
+        }
+
+        .dashboard-card:hover {
+            transform: translateY(-5px);
+            box-shadow: var(--shadow-md);
+            border-color: var(--primary-light);
+        }
+
+        .dashboard-card::before {
+            content: '';
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 4px;
+            height: 100%;
+            background-color: var(--primary-color);
+        }
+
+        .card-icon {
+            width: 50px;
+            height: 50px;
+            border-radius: 12px;
+            background-color: rgba(61, 124, 244, 0.1);
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            margin-bottom: 1rem;
+            color: var(--primary-color);
+            font-size: 1.4rem;
+        }
+
+        .card-title {
+            font-size: 1.1rem;
+            font-weight: 600;
+            margin-bottom: 0.5rem;
+            color: var(--text-primary);
+        }
+
+        .card-value {
+            font-size: 1.8rem;
+            font-weight: 700;
+            color: var(--text-primary);
+            margin-bottom: 0.5rem;
+        }
+
+        .card-description {
+            color: var(--text-secondary);
+            font-size: 0.9rem;
+            margin-bottom: 1rem;
+        }
+
+        .card-footer {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            border-top: 1px solid var(--border-light);
+            padding-top: 1rem;
+            margin-top: 0.5rem;
+        }
+
+        .trend {
+            display: flex;
+            align-items: center;
+            gap: 0.3rem;
+            font-size: 0.9rem;
+        }
+
+        .trend.up {
+            color: var(--success-color);
+        }
+
+        .trend.down {
+            color: var(--danger-color);
+        }
+
+        .card-action {
+            color: var(--primary-color);
+            font-size: 0.9rem;
+            font-weight: 500;
+            cursor: pointer;
+        }
+
+        .welcome-banner {
+            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
+            border-radius: var(--radius-lg);
+            padding: 2rem;
+            margin-bottom: 2rem;
+            color: white;
+            position: relative;
+            overflow: hidden;
+            box-shadow: var(--shadow-md);
+        }
+
+        .welcome-content {
+            position: relative;
+            z-index: 1;
+        }
+
+        .welcome-title {
+            font-size: 1.8rem;
+            margin-bottom: 0.5rem;
+            font-weight: 600;
+        }
+
+        .welcome-subtitle {
+            font-size: 1rem;
+            margin-bottom: 1.5rem;
+            opacity: 0.9;
+        }
+
+        .welcome-action {
+            background-color: rgba(255, 255, 255, 0.2);
+            color: white;
+            border: none;
+            padding: 0.75rem 1.5rem;
+            border-radius: var(--radius-md);
+            font-weight: 500;
+            cursor: pointer;
+            transition: all var(--transition-fast);
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+        }
+
+        .welcome-action:hover {
+            background-color: rgba(255, 255, 255, 0.3);
+            transform: translateY(-2px);
+        }
+
+        .welcome-banner::after {
+            content: '';
+            position: absolute;
+            top: -50%;
+            right: -10%;
+            width: 300px;
+            height: 300px;
+            background: rgba(255, 255, 255, 0.1);
+            border-radius: 50%;
+        }
+
+        .welcome-banner::before {
+            content: '';
+            position: absolute;
+            bottom: -30%;
+            left: -5%;
+            width: 200px;
+            height: 200px;
+            background: rgba(255, 255, 255, 0.1);
+            border-radius: 50%;
+        }
+
+        /* 用户中心样式 */
+        .user-center-header {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            margin-bottom: 2rem;
+        }
+
+        .user-center-title {
+            font-size: 1.8rem;
+            font-weight: 600;
+            color: var(--text-primary);
+        }
+
+        .user-center-subtitle {
+            color: var(--text-secondary);
+            margin-top: 0.5rem;
+        }
+
+        .user-center-card {
+            background-color: var(--container-bg);
+            border-radius: var(--radius-lg);
+            box-shadow: var(--shadow-md);
+            padding: 2rem;
+            margin-bottom: 2rem;
+        }
+
+        .user-center-section {
+            margin-bottom: 2rem;
+        }
+
+        .user-center-section-title {
+            font-size: 1.3rem;
+            font-weight: 600;
+            margin-bottom: 1.5rem;
+            color: var(--text-primary);
+            position: relative;
+            padding-bottom: 0.75rem;
+        }
+
+        .user-center-section-title::after {
+            content: '';
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            width: 60px;
+            height: 2px;
+            background: var(--primary-color);
+            border-radius: 2px;
+        }
+
+        .user-stats {
+            display: grid;
+            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
+            gap: 1.5rem;
+            margin-bottom: 2rem;
+        }
+
+        .stat-card {
+            background-color: var(--container-bg);
+            border-radius: var(--radius-md);
+            box-shadow: var(--shadow-sm);
+            padding: 1.5rem;
+            border: 1px solid var(--border-light);
+            text-align: center;
+        }
+
+        .stat-value {
+            font-size: 2rem;
+            font-weight: 700;
+            color: var(--primary-color);
+            margin-bottom: 0.5rem;
+        }
+
+        .stat-label {
+            color: var(--text-secondary);
+            font-size: 0.9rem;
+        }
+
+        .sidebar h2 {
+            color: var(--text-primary);
+            padding: 0 1.5rem;
+            margin-bottom: 2rem;
+            font-size: 1.3rem;
+            font-weight: 600;
+            display: flex;
+            align-items: center;
+            gap: 0.75rem;
+            position: relative;
+        }
+
+        .sidebar h2::after {
+            content: '';
+            position: absolute;
+            bottom: -10px;
+            left: 1.5rem;
+            right: 1.5rem;
+            height: 1px;
+            background: linear-gradient(to right, var(--primary-light), transparent);
+        }
+
+        .sidebar h2 i {
+            color: var(--primary-color);
+            font-size: 1.5rem;
+        }
+
+        .sidebar ul {
+            list-style: none;
+            padding: 0;
+            margin: 0;
+        }
+
+        .sidebar li {
+            padding: 1rem 1.5rem;
+            cursor: pointer;
+            transition: all var(--transition-fast);
+            color: var(--text-secondary);
+            display: flex;
+            align-items: center;
+            gap: 1rem;
+            font-weight: 500;
+            margin: 0.25rem 0;
+            border-left: 3px solid transparent;
+        }
+
+        .sidebar li:hover {
+            background-color: rgba(61, 124, 244, 0.08);
+            color: var(--primary-color);
+        }
+
+        .sidebar li.active {
+            background-color: rgba(61, 124, 244, 0.1);
+            color: var(--primary-color);
+            border-left: 3px solid var(--primary-color);
+            font-weight: 600;
+        }
+
+        .sidebar li i {
+            font-size: 1.2rem;
+            width: 1.5rem;
+            text-align: center;
+        }
+
+        .content-area {
+            flex: 1;
+            padding: 2rem;
+            overflow-y: auto;
+            background: linear-gradient(135deg, var(--background-color) 0%, rgba(247, 250, 255, 0.8) 100%);
+        }
+
+        .content-section {
+            background-color: var(--container-bg);
+            border-radius: var(--radius-lg);
+            box-shadow: var(--shadow-md);
+            padding: 2rem;
+            margin-bottom: 1.5rem;
+            display: none;
+            transform: translateY(10px);
+            opacity: 0;
+            transition: transform 0.3s ease, opacity 0.3s ease;
+        }
+
+        .content-section.active {
+            display: block;
+            transform: translateY(0);
+            opacity: 1;
+        }
+
+        .admin-title {
+            color: var(--text-primary);
+            font-size: 1.6rem;
+            font-weight: 600;
+            margin-bottom: 2rem;
+            padding-bottom: 1rem;
+            border-bottom: 1px solid var(--border-light);
+            position: relative;
+        }
+
+        .admin-title::after {
+            content: '';
+            position: absolute;
+            bottom: -1px;
+            left: 0;
+            width: 80px;
+            height: 3px;
+            background: var(--primary-color);
+            border-radius: 2px;
+        }
+
+        .menu-label {
+            color: var(--text-primary);
+            font-size: 1.4rem;
+            font-weight: 600;
+            margin-bottom: 1.5rem;
+            position: relative;
+            padding-bottom: 0.5rem;
+        }
+
+        .menu-label::after {
+            content: '';
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            width: 60px;
+            height: 2px;
+            background: var(--primary-color);
+            border-radius: 2px;
+        }
+
+        /* 表单元素样式 */
+        .content-section input[type="text"],
+        .content-section input[type="url"],
+        .content-section input[type="password"],
+        .content-section input[type="number"],
+        .content-section select {
+            width: 100%;
+            max-width: 500px;
+            padding: 0.9rem 1rem;
+            border: 1px solid var(--border-color);
+            border-radius: var(--radius-md);
+            background-color: var(--container-bg);
+            color: var(--text-primary);
+            font-size: 0.95rem;
+            margin-bottom: 1.2rem;
+            transition: all var(--transition-fast);
+            box-shadow: var(--shadow-sm);
+        }
+
+        .content-section input:focus,
+        .content-section select:focus {
+            border-color: var(--primary-color);
+            box-shadow: 0 0 0 3px rgba(61, 124, 244, 0.2);
+            outline: none;
+        }
+
+        .content-section button {
+            background-color: var(--primary-color);
+            color: white;
+            border: none;
+            padding: 0.9rem 1.4rem;
+            border-radius: var(--radius-md);
+            cursor: pointer;
+            font-size: 0.95rem;
+            font-weight: 500;
+            transition: all var(--transition-fast);
+            margin-top: 0.5rem;
+            margin-right: 0.5rem;
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+        }
+
+        .content-section button:hover {
+            background-color: var(--primary-dark);
+            transform: translateY(-2px);
+            box-shadow: var(--shadow-md);
+        }
+
+        .content-section button:active {
+            transform: translateY(0);
+        }
+
+        .content-section label {
+            display: block;
+            margin-bottom: 0.5rem;
+            color: var(--text-primary);
+            font-weight: 500;
+            font-size: 1rem;
+        }
+
+        /* 表格样式 */
+        .content-section table {
+            width: 100%;
+            border-collapse: separate;
+            border-spacing: 0;
+            margin-top: 1.5rem;
+            margin-bottom: 2rem;
+            border-radius: var (--radius-md);
+            overflow: hidden;
+            box-shadow: var(--shadow-sm);
+        }
+
+        .content-section th {
+            background-color: var(--primary-color);
+            color: white;
+            font-weight: 500;
+            text-align: left;
+            padding: 1.2rem 1.5rem;
+        }
+
+        .content-section td {
+            padding: 1rem 1.5rem;
+            border-bottom: 1px solid var(--border-light);
+            vertical-align: middle;
+        }
+
+        .content-section tr:last-child td {
+            border-bottom: none;
+        }
+
+        .content-section tr:hover td {
+            background-color: rgba(61, 124, 244, 0.05);
+        }
+
+        /* 操作按钮样式 */
+        .action-btn {
+            background-color: var(--primary-color);
+            color: white;
+            border: none;
+            padding: 0.6rem 0.9rem;
+            border-radius: var(--radius-sm);
+            cursor: pointer;
+            font-size: 0.9rem;
+            margin-right: 0.5rem;
+            transition: all var(--transition-fast);
+            display: inline-flex;
+            align-items: center;
+            gap: 0.25rem;
+        }
+
+        .action-btn:hover {
+            background-color: var(--primary-dark);
+            transform: translateY(-2px);
+            box-shadow: var(--shadow-sm);
+        }
+
+        .action-btn:active {
+            transform: translateY(0);
+        }
+
+        .edit-btn {
+            background-color: var(--primary-color);
+        }
+
+        .edit-btn:before {
+            content: "\f044";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        .delete-btn {
+            background-color: var(--danger-color);
+        }
+
+        .delete-btn:before {
+            content: "\f2ed";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        /* 登录模态框 */
+        .login-modal {
+            display: flex;
+            position: fixed;
+            z-index: 1000;
+            left: 0;
+            top: 0;
+            width: 100%;
+            height: 100%;
+            overflow: auto;
+            background: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?q=80&w=1470&auto=format&fit=crop') center/cover no-repeat;
+            justify-content: center;
+            align-items: center;
+            animation: fadeIn 0.5s ease-in-out;
+        }
+
+        .login-modal::before {
+            content: '';
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            background: linear-gradient(135deg, rgba(26, 35, 126, 0.85) 0%, rgba(61, 124, 244, 0.85) 100%);
+            backdrop-filter: blur(5px);
+        }
+
+        .login-content {
+            background-color: var(--container-bg);
+            padding: 2.5rem;
+            border-radius: var(--radius-lg);
+            width: 380px;
+            box-shadow: var(--shadow-lg);
+            position: relative;
+            animation: slideUp 0.5s ease-out;
+            border: 1px solid rgba(255, 255, 255, 0.2);
+        }
+
+        @keyframes fadeIn {
+            from { opacity: 0; }
+            to { opacity: 1; }
+        }
+
+        @keyframes slideUp {
+            from { transform: translateY(30px); opacity: 0; }
+            to { transform: translateY(0); opacity: 1; }
+        }
+
+        .login-header h2 {
+            color: var(--text-primary);
+            font-size: 1.8rem;
+            margin-bottom: 2rem;
+            text-align: center;
+            font-weight: 600;
+            position: relative;
+            padding-bottom: 1rem;
+        }
+
+        .login-header h2::after {
+            content: '';
+            position: absolute;
+            bottom: 0;
+            left: 50%;
+            transform: translateX(-50%);
+            width: 50px;
+            height: 2px;
+            background: var(--primary-color);
+        }
+
+        .login-form input[type="text"],
+        .login-form input[type="password"] {
+            width: 100%;
+            padding: 1rem 1.2rem;
+            margin: 0.75rem 0;
+            border: 1px solid var(--border-color);
+            border-radius: var(--radius-md);
+            box-sizing: border-box;
+            font-size: 1rem;
+            background-color: var (--container-bg);
+            color: var(--text-primary);
+            transition: all var(--transition-fast);
+            box-shadow: var(--shadow-sm);
+        }
+
+        .login-form input:focus {
+            border-color: var(--primary-color);
+            box-shadow: 0 0 0 3px rgba(61, 124, 244, 0.2);
+            outline: none;
+        }
+
+        .login-form button {
+            width: 100%;
+            padding: 1rem;
+            background-color: var(--primary-color);
+            color: white;
+            border: none;
+            border-radius: var (--radius-md);
+            cursor: pointer;
+            font-size: 1.1rem;
+            font-weight: 500;
+            margin-top: 1.8rem;
+            transition: all var(--transition-fast);
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            gap: 0.5rem;
+        }
+
+        .login-form button:hover {
+            background-color: var(--primary-dark);
+            transform: translateY(-2px);
+            box-shadow: var(--shadow-md);
+        }
+
+        .login-form button:active {
+            transform: translateY(0);
+        }
+
+        .login-form button:before {
+            content: "\f2f6";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        .captcha-container {
+            display: flex;
+            align-items: center;
+            margin: 0.75rem 0;
+            gap: 0.75rem;
+        }
+
+        .captcha-container input {
+            flex: 1;
+        }
+
+        .captcha-container span {
+            padding: 0.85rem;
+            background-color: var(--background-color);
+            border: 1px solid var(--border-color);
+            border-radius: var(--radius-md);
+            cursor: pointer;
+            font-size: 0.95rem;
+            color: var(--text-secondary);
+            transition: all var(--transition-fast);
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+
+        .captcha-container span:hover {
+            background-color: var(--border-light);
+            color: var(--primary-color);
+        }
+
+        /* 加载指示器 */
+        .loading-spinner {
+            position: fixed;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            width: 50px;
+            height: 50px;
+            border: 5px solid rgba(61, 124, 244, 0.1);
+            border-top: 5px solid var(--primary-color);
+            border-radius: 50%;
+            animation: spin 1s linear infinite;
+            z-index: 9999;
+        }
+
+        @keyframes spin {
+            0% { transform: translate(-50%, -50%) rotate(0deg); }
+            100% { transform: translate(-50%, -50%) rotate(360deg); }
+        }
+
+        #loadingIndicator {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            height: 100vh;
+            background-color: var(--background-color);
+            color: var(--text-secondary);
+            font-size: 1.1rem;
+        }
+
+        /* 状态指示样式 */
+        .disabled {
+            opacity: 0.5;
+            pointer-events: none;
+        }
+
+        .status-cell {
+            position: relative;
+            min-height: 24px;
+        }
+
+        .status-content {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            width: 100%;
+            text-align: center;
+        }
+
+        .loading-container {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            position: absolute;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+        }
+
+        .loading {
+            display: inline-block;
+            width: 20px;
+            height: 20px;
+            border: 3px solid rgba(61, 124, 244, 0.1);
+            border-radius: 50%;
+            border-top: 3px solid var(--primary-color);
+            animation: spin 1s linear infinite;
+        }
+
+        /* 监控配置部分 */
+        .monitoring-status {
+            margin-bottom: 1.5rem;
+            font-size: 1rem;
+            color: var(--text-secondary);
+            background-color: rgba(61, 124, 244, 0.05);
+            padding: 1rem 1.5rem;
+            border-radius: var(--radius-md);
+            display: flex;
+            align-items: center;
+            gap: 0.75rem;
+        }
+
+        .monitoring-status:before {
+            content: "\f021";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+            color: var(--primary-color);
+        }
+
+        .status-indicator {
+            font-weight: 600;
+        }
+
+        .config-form {
+            background-color: var(--container-bg);
+            padding: 1.8rem;
+            border-radius: var(--radius-md);
+            margin-bottom: 1.5rem;
+            border: 1px solid var(--border-light);
+            box-shadow: var(--shadow-sm);
+        }
+
+        .form-group {
+            margin-bottom: 1.2rem;
+        }
+
+        .form-control {
+            width: 100%;
+            padding: 0.9rem 1rem;
+            border: 1px solid var(--border-color);
+            border-radius: var(--radius-md);
+            color: var(--text-primary);
+            background-color: var(--container-bg);
+        }
+
+        .button-group {
+            display: flex;
+            gap: 0.75rem;
+            flex-wrap: wrap;
+            margin-top: 1.5rem;
+        }
+
+        .btn {
+            padding: 0.8rem 1.2rem;
+            border: none;
+            border-radius: var(--radius-md);
+            cursor: pointer;
+            transition: all var(--transition-fast);
+            font-size: 0.95rem;
+            font-weight: 500;
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+        }
+
+        .btn-primary {
+            background-color: var(--primary-color);
+            color: white;
+        }
+
+        .btn-primary:before {
+            content: "\f0c7";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        .btn-secondary {
+            background-color: var(--text-secondary);
+            color: white;
+        }
+
+        .btn:hover {
+            transform: translateY(-2px);
+            box-shadow: var(--shadow-sm);
+        }
+
+        .btn:active {
+            transform: translateY(0);
+        }
+
+        .section-title {
+            color: var(--text-primary);
+            font-size: 1.3rem;
+            font-weight: 600;
+            margin: 2rem 0 1.2rem;
+            position: relative;
+            padding-left: 1rem;
+            border-left: 3px solid var(--primary-color);
+        }
+
+        .container-table {
+            width: 100%;
+            border-collapse: separate;
+            border-spacing: 0;
+            margin-bottom: 1.5rem;
+            border-radius: var(--radius-md);
+            overflow: hidden;
+            box-shadow: var(--shadow-sm);
+        }
+
+        .container-table th {
+            background-color: var(--primary-color);
+            color: white;
+            padding: 0.9rem 1rem;
+            text-align: left;
+            font-weight: 500;
+        }
+
+        .container-table td {
+            padding: 0.9rem 1rem;
+            border-bottom: 1px solid var(--border-light);
+        }
+
+        .container-table tr:last-child td {
+            border-bottom: none;
+        }
+
+        .error-message {
+            color: var(--danger-color);
+            margin-top: 0.75rem;
+            padding: 0.75rem;
+            border-radius: var (--radius-md);
+            background-color: rgba(255, 82, 82, 0.1);
+            font-size: 0.9rem;
+            display: flex;
+            align-items: center;
+            gap: 0.5rem;
+        }
+
+        .error-message:before {
+            content: "\f071";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        .success-message {
+            color: var(--success-color);
+            margin-top: 0.75rem;
+            padding: 0.75rem;
+            border-radius: var(--radius-md);
+            background-color: rgba(50, 213, 131, 0.1);
+            font-size: 0.9rem;
+            display: flex;
+            align-items: center;
+            gap: 0.5rem;
+        }
+
+        .success-message:before {
+            content: "\f00c";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        /* 网络测试部分 */
+        #network-test .input-group {
+            margin-bottom: 1.2rem;
+            max-width: 600px;
+            background-color: rgba(61, 124, 244, 0.03);
+            padding: 1.5rem;
+            border-radius: var(--radius-md);
+            box-shadow: var(--shadow-sm);
+        }
+
+        #network-test label {
+            display: block;
+            margin-bottom: 0.5rem;
+            color: var (--text-secondary);
+            font-weight: 500;
+        }
+
+        #testResults {
+            margin-top: 1.5rem;
+            padding: 1rem;
+            background-color: #1e2532;
+            color: #e9ecef;
+            border-radius: var(--radius-md);
+            white-space: pre-wrap;
+            font-family: 'JetBrains Mono', monospace;
+            min-height: 300px;
+            max-height: 500px;
+            overflow-y: auto;
+            border: none;
+            box-shadow: var(--shadow-md);
+            position: relative;
+        }
+
+        /* 文档编辑器部分 */
+        #editorContainer {
+            margin-top: 2rem;
+            border-radius: var(--radius-md);
+            background-color: var(--container-bg);
+            overflow: hidden;
+            box-shadow: var(--shadow-md);
+            border: 1px solid var(--border-light);
+        }
+
+        #documentTitle {
+            width: 100%;
+            padding: 1rem;
+            margin-bottom: 1rem;
+            border: 1px solid var(--border-color);
+            border-radius: var (--radius-md);
+            font-size: 1.1rem;
+            font-weight: 500;
+            box-shadow: var(--shadow-sm);
+        }
+
+        .password-hint {
+            color: var(--text-secondary);
+            font-size: 0.9rem;
+            margin: 0.5rem 0 1rem;
+            display: block;
+            background-color: rgba(61, 124, 244, 0.05);
+            padding: 0.75rem;
+            border-radius: var(--radius-md);
+        }
+
+        #passwordStrength {
+            font-size: 0.9rem;
+            margin: 0.5rem 0;
+            display: block;
+        }
+
+        /* 警告和确认对话框样式 */
+        .swal2-popup {
+            font-size: 1rem !important;
+            border-radius: var(--radius-lg) !important;
+        }
+
+        .swal2-title {
+            font-weight: 600 !important;
+            color: var(--text-primary) !important;
+        }
+
+        .swal2-styled.swal2-confirm {
+            background-color: var(--primary-color) !important;
+            border-radius: var(--radius-md) !important;
+        }
+
+        /* 添加条目按钮 */
+        .add-btn {
+            background-color: var(--success-color);
+            color: white;
+            padding: 0.8rem 1.2rem;
+            border-radius: var(--radius-md);
+            display: inline-flex;
+            align-items: center;
+            gap: 0.5rem;
+            font-weight: 500;
+            margin-top: 1rem;
+            box-shadow: var(--shadow-sm);
+        }
+
+        .add-btn:before {
+            content: "\f067";
+            font-family: "Font Awesome 6 Free";
+            font-weight: 900;
+        }
+
+        .add-btn:hover {
+            background-color: #29b873;
+            transform: translateY(-2px);
+            box-shadow: var (--shadow-md);
+        }
+
+        /* Docker状态表格 */
+        .action-select {
+            padding: 0.5rem;
+            border-radius: var(--radius-sm);
+            border: 1px solid var(--border-color);
+            background-color: var(--container-bg);
+            color: var(--text-primary);
+            cursor: pointer;
+            width: 100%;
+        }
+
+        .action-select:focus {
+            border-color: var (--primary-color);
+            outline: none;
+        }
+
+        /* 响应式设计 */
+        @media (max-width: 992px) {
+            .admin-container {
+                flex-direction: column;
+            }
+
+            .sidebar {
+                width: 100%;
+                padding: 1rem 0;
+            }
+
+            .sidebar ul {
+                display: flex;
+                flex-wrap: wrap;
+                justify-content: flex-start;
+            }
+
+            .sidebar li {
+                padding: 0.5rem 1rem;
+                border-left: none;
+                border-bottom: 3px solid transparent;
+            }
+
+            .sidebar li.active {
+                border-left: none;
+                border-bottom: 3px solid var(--primary-color);
+            }
+
+            .content-area {
+                padding: 1rem;
+            }
+
+            .content-section {
+                padding: 1.5rem;
+            }
+        }
+
+        @media (max-width: 768px) {
+            .content-section th, 
+            .content-section td {
+                padding: 0.75rem 0.5rem;
+                font-size: 0.9rem;
+            }
+
+            .button-group {
+                flex-direction: column;
+            }
+
+            .btn, .action-btn {
+                width: 100%;
+                margin-bottom: 0.5rem;
+            }
+        }
+
+        @media (max-width: 480px) {
+            .login-content {
+                width: 90%;
+                padding: 1.5rem;
+            }
+        }
+    </style>
+</head>
+<body>
+    <div id="loadingSpinner" class="loading-spinner" style="display: none;"></div>
+    <div id="loadingIndicator" style="display: flex; justify-content: center; align-items: center; height: 100vh;">
+        <p>加载中...</p>
+    </div>
+    <div class="admin-container" id="adminContainer" style="display: none;">
+        <div class="sidebar">
+            <div class="user-profile">
+                <div class="user-avatar">
+                    <i class="fas fa-user"></i>
+                </div>
+                <div class="user-info">
+                    <div class="user-name" id="currentUsername">管理员</div>
+                    <div class="user-role">系统管理员</div>
+                </div>
+                <div class="user-actions">
+                    <div class="user-action-btn" id="userCenterBtn">个人中心</div>
+                    <div class="user-action-btn logout" id="logoutBtn">退出登录</div>
+                </div>
+            </div>
+            <h2><i class="fas fa-cogs"></i>管理面板</h2>
+            <ul>
+                <li data-section="dashboard" class="active">
+                    <i class="fas fa-tachometer-alt"></i>控制面板
+                </li>
+                <li data-section="basic-config">
+                    <i class="fas fa-wrench"></i>基本配置
+                </li>
+                <li data-section="menu-management">
+                    <i class="fas fa-bars"></i>菜单管理
+                </li>
+                <li data-section="documentation-management">
+                    <i class="fas fa-file-alt"></i>文档管理
+                </li>
+                <li data-section="network-test">
+                    <i class="fas fa-network-wired"></i>网络测试
+                </li>
+                <li data-section="docker-status">
+                    <i class="fab fa-docker"></i>容器管理
+                </li>
+                <li data-section="docker-monitoring">
+                    <i class="fas fa-chart-line"></i>容器监控
+                </li>
+                <li data-section="user-center">
+                    <i class="fas fa-user-cog"></i>用户中心
+                </li>
+            </ul>
+        </div>
+        <div class="content-area">
+            <div class="container">
+                <!-- 控制面板 -->
+                <div id="dashboard" class="content-section active">
+                    <div class="welcome-banner">
+                        <div class="welcome-content">
+                            <h1 class="welcome-title">欢迎回来,<span id="welcomeUsername">管理员</span>!</h1>
+                            <p class="welcome-subtitle">这里是 Docker 镜像代理加速系统控制面板</p>
+                            <button class="welcome-action" onclick="refreshDockerStatus()">
+                                <i class="fas fa-sync-alt"></i> 刷新系统状态
+                            </button>
+                        </div>
+                    </div>
+
+                    <div class="dashboard-grid">
+                        <div class="dashboard-card">
+                            <div class="card-icon">
+                                <i class="fab fa-docker"></i>
+                            </div>
+                            <div class="card-title">容器总数</div>
+                            <div class="card-value" id="totalContainers">--</div>
+                            <div class="card-description">当前系统中的容器总数</div>
+                            <div class="card-footer">
+                                <div class="trend up">
+                                    <i class="fas fa-arrow-up"></i>
+                                    <span>正常运行</span>
+                                </div>
+                                <div class="card-action" onclick="showSection('docker-status')">查看详情</div>
+                            </div>
+                        </div>
+
+                        <div class="dashboard-card">
+                            <div class="card-icon" style="background-color: rgba(255, 152, 0, 0.1); color: #FF9800;">
+                                <i class="fas fa-memory"></i>
+                            </div>
+                            <div class="card-title">系统内存</div>
+                            <div class="card-value" id="systemMemory">--</div>
+                            <div class="card-description">当前系统内存使用情况</div>
+                            <div class="card-footer">
+                                <div class="trend up">
+                                    <i class="fas fa-arrow-up"></i>
+                                    <span>运行正常</span>
+                                </div>
+                                <div class="card-action" onclick="showSection('docker-monitoring')">监控详情</div>
+                            </div>
+                        </div>
+
+                        <div class="dashboard-card">
+                            <div class="card-icon" style="background-color: rgba(76, 175, 80, 0.1); color: #4CAF50;">
+                                <i class="fas fa-microchip"></i>
+                            </div>
+                            <div class="card-title">CPU 负载</div>
+                            <div class="card-value" id="cpuLoad">--</div>
+                            <div class="card-description">当前系统 CPU 负载情况</div>
+                            <div class="card-footer">
+                                <div class="trend down">
+                                    <i class="fas fa-arrow-down"></i>
+                                    <span>降低 5%</span>
+                                </div>
+                                <div class="card-action" onclick="showSection('docker-monitoring')">监控详情</div>
+                            </div>
+                        </div>
+
+                        <div class="dashboard-card">
+                            <div class="card-icon" style="background-color: rgba(33, 150, 243, 0.1); color: #2196F3;">
+                                <i class="fas fa-hdd"></i>
+                            </div>
+                            <div class="card-title">磁盘空间</div>
+                            <div class="card-value" id="diskSpace">--</div>
+                            <div class="card-description">当前系统磁盘使用情况</div>
+                            <div class="card-footer">
+                                <div class="trend up">
+                                    <i class="fas fa-arrow-up"></i>
+                                    <span>充足</span>
+                                </div>
+                                <div class="card-action" onclick="checkDiskSpace()">查看详情</div>
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="dashboard-card">
+                        <h3 class="card-title">最近容器操作</h3>
+                        <table id="recentActivitiesTable">
+                            <thead>
+                                <tr>
+                                    <th>时间</th>
+                                    <th>操作</th>
+                                    <th>容器</th>
+                                    <th>状态</th>
+                                </tr>
+                            </thead>
+                            <tbody id="recentActivitiesBody">
+                                <tr>
+                                    <td colspan="4" style="text-align: center;">加载中...</td>
+                                </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+
+                <!-- 将原有的内容分成四个部分,每个部分对应一个侧边栏项目 -->
+                <div id="basic-config" class="content-section">
+                    <label for="logoUrl">Logo URL: (可选)</label>
+                    <input type="url" id="logoUrl" name="logoUrl">
+                    <button type="button" onclick="saveLogo()">保存 Logo</button>
+
+                    <label for="proxyDomain">Docker镜像代理地址: (必填)</label>
+                    <input type="text" id="proxyDomain" name="proxyDomain" required>
+                    <button type="button" onclick="saveProxyDomain()">保存代理地址</button>
+                </div>
+                
+                <div id="menu-management" class="content-section">
+                    <h2 class="menu-label">菜单项管理</h2>
+                    <table id="menuTable">
+                        <thead>
+                            <tr>
+                                <th>文本</th>
+                                <th>链接 (可选)</th>
+                                <th>新标签页打开</th>
+                                <th>操作</th>
+                            </tr>
+                        </thead>
+                        <tbody id="menuTableBody">
+                            <!-- 菜单项将在这里动态添加 -->
+                        </tbody>
+                    </table>
+                    <button type="button" class="add-btn" onclick="showNewMenuItemRow()">添加菜单项</button>
+                </div>
+  
+                <!-- 文档管理部分 -->
+                <div id="documentation-management" class="content-section">
+                    <h2 class="menu-label">文档管理</h2>
+                    <button type="button" onclick="newDocument()">新建文档</button>
+                    <table id="documentTable">
+                        <thead>
+                            <tr>
+                                <th>文章</th>
+                                <th>操作</th>
+                            </tr>
+                        </thead>
+                        <tbody id="documentTableBody">
+                            <!-- 文档列表将在这里动态添加 -->
+                        </tbody>
+                    </table>
+                    <div id="editorContainer" style="display: none;">
+                        <input type="text" id="documentTitle" placeholder="文档标题">
+                        <div id="editormd">
+                            <textarea style="display:none;"></textarea>
+                        </div>
+                        <button type="button" onclick="saveDocument()">保存文档</button>
+                        <button type="button" onclick="cancelEdit()">取消</button>
+                    </div>
+                </div>  
+
+                <!-- 修改密码部分 -->
+                <div id="password-change" class="content-section">
+                    <h2 class="menu-label">修改密码</h2>
+                    <label for="currentPassword">当前密码</label>
+                    <input type="password" id="currentPassword" name="currentPassword">
+                    <label for="newPassword">新密码</label>
+                    <span class="password-hint" id="passwordHint">密码必须包含至少一个字母、一个数字和一个特殊字符,长度在8到16个字符之间</span>
+                    <input type="password" id="newPassword" name="newPassword" oninput="checkPasswordStrength()">
+                    <span id="passwordStrength" style="color: red;"></span>
+                    <button type="button" onclick="changePassword()">修改密码</button>
+                </div>
+
+                <!-- 网络测试 -->
+                <div id="network-test" class="content-section">
+                    <h1 class="admin-title">网络测试</h1>
+                    <div class="input-group">
+                        <label for="testDomain">目标域名或IP地址:</label>
+                        <input type="text" id="testDomain" placeholder="例如: www.example.com 或 8.8.8.8" autocomplete="off">
+                        <select id="domainSelect">
+                            <option value="">选择预定义域名</option>
+                            <option value="gcr.io">gcr.io</option>
+                            <option value="ghcr.io">ghcr.io</option>
+                            <option value="quay.io">quay.io</option>
+                            <option value="k8s.gcr.io">k8s.gcr.io</option>
+                            <option value="registry.k8s.io">registry.k8s.io</option>
+                            <option value="mcr.microsoft.com">mcr.microsoft.com</option>
+                            <option value="docker.elastic.co">docker.elastic.co</option>
+                            <option value="registry-1.docker.io">registry-1.docker.io</option>
+                        </select>
+                    </div>
+                    <div class="input-group">
+                        <label for="testType">测试类型:</label>
+                        <select id="testType">
+                            <option value="ping">Ping</option>
+                            <option value="traceroute">Traceroute</option>
+                        </select>
+                    </div>
+                    <button>开始测试</button>
+                    <div id="testResults" style="margin-top: 20px; white-space: pre-wrap; font-family: monospace;"></div>
+                </div>
+
+                <!-- Docker服务状态 -->
+                <div id="docker-status" class="content-section">
+                    <h1 class="admin-title">Docker 服务状态</h1>
+                    <table id="dockerStatusTable">
+                      <thead>
+                        <tr>
+                          <th>容器 ID</th>
+                          <th>名称</th>
+                          <th>镜像</th>
+                          <th>状态</th>
+                          <th>CPU</th>
+                          <th>内存</th>
+                          <th>创建时间</th>
+                        </tr>
+                      </thead>
+                      <tbody id="dockerStatusTableBody">
+                        <!-- Docker 容器状态将在这里动态添加 -->
+                      </tbody>
+                    </table>
+                    <button type="button" onclick="refreshDockerStatus()">刷新状态</button>
+                </div>
+
+                <div id="docker-monitoring" class="content-section">
+                    <h1 class="admin-title">Docker 容器监控</h1>
+                    <div class="monitoring-status">
+                        <span>监控状态:</span>
+                        <span id="monitoringStatus" class="status-indicator">加载中...</span>
+                    </div>
+                    <div class="config-form">
+                        <div class="form-group">
+                            <label for="notificationType">通知方式:</label>
+                            <select id="notificationType" class="form-control" onchange="toggleNotificationFields()">
+                                <option value="wechat">企业微信群机器人</option>
+                                <option value="telegram">Telegram Bot</option>
+                            </select>
+                        </div>
+                        <div id="wechatFields">
+                            <div class="form-group">
+                                <label for="webhookUrl">企业微信机器人 Webhook URL:</label>
+                                <input type="text" id="webhookUrl" name="webhookUrl" class="form-control">
+                            </div>
+                        </div>
+                        <div id="telegramFields" style="display: none;">
+                            <div class="form-group">
+                                <label for="telegramToken">Telegram Bot Token:</label>
+                                <input type="text" id="telegramToken" name="telegramToken" class="form-control">
+                            </div>
+                            <div class="form-group">
+                                <label for="telegramChatId">Telegram Chat ID:</label>
+                                <input type="text" id="telegramChatId" name="telegramChatId" class="form-control">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label for="monitorInterval">监控间隔 (秒):</label>
+                            <input type="number" id="monitorInterval" name="monitorInterval" min="1" value="60" class="form-control">
+                        </div>
+                        <div class="button-group">
+                            <button onclick="testNotification()" class="btn btn-secondary">测试通知</button>
+                            <button onclick="saveMonitoringConfig()" class="btn btn-primary">保存配置</button>
+                            <button onclick="toggleMonitoring()" class="btn btn-secondary" id="toggleMonitoringBtn">开启/关闭监控</button>
+                        </div>
+                    </div>
+                    <div id="messageContainer"></div>
+                    <h2 class="section-title">已停止的容器</h2>
+                    <div class="container-list">
+                        <table id="stoppedContainersTable" class="container-table">
+                            <thead>
+                                <tr>
+                                    <th>容器 ID</th>
+                                    <th>名称</th>
+                                    <th>状态</th>
+                                </tr>
+                            </thead>
+                            <tbody id="stoppedContainersBody"></tbody>
+                        </table>
+                    </div>
+                </div>
+
+                <!-- 用户中心部分 - 修改按钮样式,移除图标 -->
+                <div id="user-center" class="content-section">
+                    <div class="user-center-header">
+                        <div>
+                            <h1 class="user-center-title">用户中心</h1>
+                            <p class="user-center-subtitle">管理您的个人信息和账户安全</p>
+                        </div>
+                        <button class="btn btn-primary" id="ucLogoutBtn">退出登录</button>
+                    </div>
+                    
+                    <div class="user-center-card">
+                        <div class="user-center-section">
+                            <h2 class="user-center-section-title">账户信息</h2>
+                            <div class="user-stats">
+                                <div class="stat-card">
+                                    <div class="stat-value" id="loginCount">--</div>
+                                    <div class="stat-label">登录次数</div>
+                                </div>
+                                <div class="stat-card">
+                                    <div class="stat-value" id="lastLogin">--</div>
+                                    <div class="stat-label">上次登录</div>
+                                </div>
+                                <div class="stat-card">
+                                    <div class="stat-value" id="accountAge">--</div>
+                                    <div class="stat-label">账户天数</div>
+                                </div>
+                            </div>
+                        </div>
+                        
+                        <div class="user-center-section">
+                            <h2 class="user-center-section-title">修改密码</h2>
+                            <label for="currentPassword">当前密码</label>
+                            <input type="password" id="currentPassword" name="currentPassword">
+                            <label for="newPassword">新密码</label>
+                            <span class="password-hint" id="passwordHint">密码必须包含至少一个字母、一个数字和一个特殊字符,长度在8到16个字符之间</span>
+                            <input type="password" id="newPassword" name="newPassword" oninput="checkPasswordStrength()">
+                            <span id="passwordStrength" style="color: red;"></span>
+                            <button type="button" onclick="changePassword()">修改密码</button>
+                        </div>
+                        
+                        <div class="user-center-section">
+                            <h2 class="user-center-section-title">安全设置</h2>
+                            <div class="form-group">
+                                <label for="loginNotification">登录通知</label>
+                                <select id="loginNotification" class="form-control">
+                                    <option value="none">不通知</option>
+                                    <option value="email">邮件通知</option>
+                                </select>
+                            </div>
+                            <button type="button" class="btn btn-primary" id="saveSecurityBtn">保存设置</button>
+                        </div>
+                    </div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+
+    <div class="login-modal" id="loginModal" style="display: none;">
+        <div class="login-content">
+            <div class="login-header">
+                <h2>管理员登录</h2>
+            </div>
+            <form class="login-form">
+                <input type="text" id="username" name="username" placeholder="用户名" required>
+                <input type="password" id="password" name="password" placeholder="密码" required>
+                <div class="captcha-container">
+                    <input type="text" id="captcha" name="captcha" placeholder="验证码" required>
+                    <span id="captchaText" onclick="refreshCaptcha()">点击刷新验证码</span>
+                </div>
+                <button type="button" onclick="login()">登录</button>
+            </form>
+        </div>
+    </div>
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/dragula/3.7.2/dragula.min.js"></script>
+    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
+    <script>
+        let menuItems = [];
+        let isLoggedIn = false;
+        let editingIndex = -1; // 用于记录当前编辑的菜单项索引
+        let editor;
+        let currentEditingDoc = null;
+        let documents = [];
+        
+        // 初始化编辑器
+        function initEditor() {
+            if (editor) {
+                console.log('Editor already initialized');
+                return;
+            }
+            try {
+                editor = editormd("editormd", {
+                    width: "100%",
+                    height: 640,
+                    path : "https://cdn.jsdelivr.net/npm/[email protected]/lib/",
+                    theme : "default",
+                    previewTheme : "default",
+                    editorTheme : "default",
+                    markdown : "",
+                    codeFold : true,
+                    saveHTMLToTextarea : true,
+                    searchReplace : true,
+                    watch : true, // 开启实时预览
+                    htmlDecode : "style,script,iframe|on*",
+                    toolbar : true,
+                    toolbarIcons : "full",
+                    placeholder: "请输入Markdown格式的文档...",
+                    emoji : true,
+                    taskList : true,
+                    tocm : true,
+                    tex : true,
+                    flowChart : true,
+                    sequenceDiagram : true,
+                    onload : function() {
+                        console.log('Editor.md loaded successfully');
+                        // 在加载完成后,立即切换到编辑模式
+                        this.unwatch();
+                        this.watch();
+                    }
+                });
+                console.log('Editor initialized successfully');
+            } catch (error) {
+                console.error('Error initializing editor:', error);
+            }
+        }
+
+
+        function newDocument() {
+            currentEditingDoc = null;
+            document.getElementById('documentTitle').value = '';
+            editor.setMarkdown('');
+            showEditor();
+        }
+
+        function showEditor() {
+            document.getElementById('documentTable').style.display = 'none';
+            document.getElementById('editorContainer').style.display = 'block';
+            if (editor) {
+                // 确保每次显示编辑器时都切换到编辑模式
+                editor.unwatch();
+                editor.watch();
+            }
+        }
+
+        function hideEditor() {
+            document.getElementById('documentTable').style.display = 'table';
+            document.getElementById('editorContainer').style.display = 'none';
+        }
+
+        function cancelEdit() {
+            hideEditor();
+        }
+
+        async function saveDocument() {
+            const title = document.getElementById('documentTitle').value.trim();
+            const content = editor.getMarkdown();
+            if (!title) {
+                alert('请输入文档标题');
+                return;
+            }
+            try {
+                const response = await fetch('/api/documentation', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify({ 
+                        id: currentEditingDoc ? currentEditingDoc.id : null, 
+                        title, 
+                        content 
+                    })
+                });
+                if (response.ok) {
+                    alert('文档保存成功');
+                    hideEditor();
+                    loadDocumentList();
+                } else {
+                    throw new Error('保存失败');
+                }
+            } catch (error) {
+                console.error('保存文档失败:', error);
+                alert('保存文档失败: ' + error.message);
+            }
+        }
+
+        async function loadDocumentList() {
+            try {
+                const response = await fetch('/api/documentation-list');
+                if (!response.ok) {
+                    const errorData = await response.json();
+                    throw new Error(`HTTP error! status: ${response.status}, message: ${errorData.error}, details: ${errorData.details}`);
+                }
+                documents = await response.json();
+                console.log('Received documents:', documents);
+                renderDocumentList();
+            } catch (error) {
+                console.error('加载文档列表失败:', error);
+                alert('加载文档列表失败: ' + error.message);
+            }
+        }
+
+        function renderDocumentList() {
+            const tbody = document.getElementById('documentTableBody');
+            tbody.innerHTML = '';
+            if (documents.length === 0) {
+                tbody.innerHTML = '<tr><td colspan="2">没有找到文档</td></tr>';
+                return;
+            }
+            documents.forEach(doc => {
+                const row = `
+                    <tr>
+                        <td>${doc.title || 'Untitled Document'}</td>
+                        <td>
+                            <button onclick="editDocument('${doc.id}')">编辑</button>
+                            <button onclick="deleteDocument('${doc.id}')">删除</button>
+                            <button onclick="togglePublish('${doc.id}')">${doc.published ? '取消发布' : '发布'}</button>
+                        </td>
+                    </tr>
+                `;
+                tbody.innerHTML += row;
+            });
+        }
+
+        function editDocument(id) {
+            currentEditingDoc = documents.find(doc => doc.id === id);
+            document.getElementById('documentTitle').value = currentEditingDoc.title;
+            editor.setMarkdown(currentEditingDoc.content);
+            showEditor();
+        }
+
+        async function deleteDocument(id) {
+            if (confirm('确定要删除这个文档吗?')) {
+                try {
+                    const response = await fetch(`/api/documentation/${id}`, { method: 'DELETE' });
+                    if (response.ok) {
+                        alert('文档删除成功');
+                        loadDocumentList();
+                    } else {
+                        throw new Error('删除失败');
+                    }
+                } catch (error) {
+                    console.error('删除文档失败:', error);
+                    alert('删除文档失败: ' + error.message);
+                }
+            }
+        }
+
+        async function togglePublish(id) {
+            try {
+                const response = await fetch(`/api/documentation/${id}/toggle-publish`, { method: 'POST' });
+                if (response.ok) {
+                    loadDocumentList();
+                } else {
+                    throw new Error('操作失败');
+                }
+            } catch (error) {
+                console.error('更改发布状态失败:', error);
+                alert('更改发布状态失败: ' + error.message);
+            }
+        }
+
+
+        function getMenuItems() {
+            return menuItems;
+        }
+
+        function setupMenuDeleteButtons() {
+            const deleteButtons = document.querySelectorAll('.menu-delete-btn');
+            deleteButtons.forEach((button) => {
+                button.addEventListener('click', () => {
+                    const row = button.closest('tr');
+                    const index = parseInt(row.getAttribute('data-index'));
+                    const menuText = row.querySelector('.menu-text').value;
+                    if (confirm(`确定要删除菜单项 "${menuText}" 吗?`)) {
+                        deleteMenuItem(index);
+                    }
+                });
+            });
+        }
+
+        function renderMenuItems() {
+            const tbody = document.getElementById('menuTableBody');
+            tbody.innerHTML = '';
+            menuItems.forEach((item, index) => {
+                const row = `
+                    <tr data-index="${index}">
+                        <td><input type="text" class="menu-text" value="${item.text}" disabled></td>
+                        <td><input type="url" class="menu-link" value="${item.link || ''}" disabled></td>
+                        <td>
+                            <select class="menu-newtab" disabled>
+                                <option value="false" ${item.newTab ? '' : 'selected'}>否</option>
+                                <option value="true" ${item.newTab ? 'selected' : ''}>是</option>
+                            </select>
+                        </td>
+                        <td>
+                            <button type="button" class="action-btn edit-btn">编辑</button>
+                            <button type="button" class="action-btn delete-btn menu-delete-btn">删除</button>
+                        </td>
+                    </tr>
+                `;
+                tbody.innerHTML += row;
+            });
+            setupEditButtons();
+            setupMenuDeleteButtons();
+        }
+
+        function setMenuItems(items) {
+            menuItems = items;
+            renderMenuItems();
+        }
+
+        function setupEditButtons() {
+            const editButtons = document.querySelectorAll('.edit-btn');
+            editButtons.forEach((button, index) => {
+                button.addEventListener('click', () => {
+                    const row = button.closest('tr');
+                    const textInput = row.querySelector('.menu-text');
+                    const linkInput = row.querySelector('.menu-link');
+                    const newTabSelect = row.querySelector('.menu-newtab');
+
+                    if (textInput.disabled) {
+                        textInput.disabled = false;
+                        linkInput.disabled = false;
+                        newTabSelect.disabled = false;
+                        button.textContent = '保存';
+                    } else {
+                        const text = textInput.value;
+                        const link = linkInput.value;
+                        const newTab = newTabSelect.value === 'true';
+
+                        if (text) {
+                            const rowIndex = row.getAttribute('data-index');
+                            menuItems[rowIndex] = { text, link, newTab };
+                            saveMenuItem(rowIndex, { text, link, newTab });
+                            renderMenuItems(); // 重新渲染菜单项
+                        } else {
+                            alert('请填写菜单项文本');
+                        }
+                    }
+                });
+            });
+        }
+        
+
+        function showNewMenuItemRow() {
+            const tbody = document.getElementById('menuTableBody');
+            const newRow = `
+                <tr id="newMenuItemRow">
+                    <td><input type="text" class="menu-text" placeholder="菜单项文本"></td>
+                    <td><input type="url" class="menu-link" placeholder="菜单项链接 (可选)"></td>
+                    <td>
+                        <select class="menu-newtab">
+                            <option value="false">否</option>
+                            <option value="true">是</option>
+                        </select>
+                    </td>
+                    <td>
+                        <button type="button" class="action-btn" onclick="saveNewMenuItem()">保存</button>
+                        <button type="button" class="action-btn" onclick="cancelNewMenuItem()">取消</button>
+                    </td>
+                </tr>
+            `;
+            tbody.insertAdjacentHTML('beforeend', newRow);
+        }
+
+
+        function saveNewMenuItem() {
+            const newRow = document.getElementById('newMenuItemRow');
+            const textInput = newRow.querySelector('.menu-text');
+            const linkInput = newRow.querySelector('.menu-link');
+            const newTabSelect = newRow.querySelector('.menu-newtab');
+
+            const text = textInput.value;
+            const link = linkInput.value;
+            const newTab = newTabSelect.value === 'true';
+
+            if (text) {
+                const newItem = { text, link, newTab };
+                menuItems.push(newItem);
+                renderMenuItems(); // 先更新页面
+                saveMenuItem(menuItems.length - 1, newItem);
+                cancelNewMenuItem();
+            } else {
+                alert('请填写菜单项文本');
+            }
+        }
+
+        function cancelNewMenuItem() {
+            const newRow = document.getElementById('newMenuItemRow');
+            if (newRow) {
+                newRow.remove();
+            }
+        }
+
+        async function saveLogo() {
+            const logoUrl = document.getElementById('logoUrl').value;
+            if (!logoUrl) {
+                alert('Logo URL 不可为空');
+                return;
+            }
+            try {
+                await saveConfig({ logo: logoUrl });
+                alert('Logo 保存成功');
+            } catch (error) {
+                alert('Logo 保存失败: ' + error.message);
+            }
+        }
+
+        async function saveProxyDomain() {
+            const proxyDomain = document.getElementById('proxyDomain').value;
+            if (!proxyDomain) {
+                alert('Docker镜像代理地址不可为空');
+                return;
+            }
+            try {
+                await saveConfig({ proxyDomain });
+                alert('代理地址保存成功');
+            } catch (error) {
+                alert('代理地址保存失败: ' + error.message);
+            }
+        }
+
+        async function saveMenuItem(index, item) {
+            const config = { menuItems: menuItems };
+            config.menuItems[index] = item;
+            await saveConfig(config);
+        }
+
+        async function deleteMenuItem(index) {
+            try {
+                menuItems.splice(index, 1);
+                const response = await fetch('/api/config', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify({ menuItems: menuItems })
+                });
+                if (response.ok) {
+                    console.log('Menu item deleted successfully');
+                    renderMenuItems(); // 重新渲染菜单项
+                } else {
+                    throw new Error('Failed to delete menu item');
+                }
+            } catch (error) {
+                console.error('删除菜单项失败:', error);
+                alert('删除菜单项失败: ' + error.message);
+            }
+        }
+
+        async function saveConfig(partialConfig) {
+            try {
+                const response = await fetch('/api/config', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify(partialConfig)
+                });
+                if (!response.ok) {
+                    throw new Error('保存失败');
+                }
+            } catch (error) {
+                console.error('保存失败: ' + error.message);
+                throw error;
+            }
+        }
+
+        // 加载文档的函数
+        async function loadDocumentation() {
+            try {
+                const response = await fetch('/api/documentation');
+                if (!response.ok) {
+                throw new Error(`HTTP error! status: ${response.status}`);
+                }
+                const documents = await response.json();
+                console.log('Received documents from server:', documents);
+                if (documents.length > 0) {
+                const firstDocument = documents[0];
+                if (!editor) {
+                    console.warn('Editor not initialized, initializing now');
+                    initEditor();
+                }
+                // 等待一小段时间确保编辑器完全初始化
+                setTimeout(() => {
+                    if (editor && typeof editor.setMarkdown === 'function') {
+                    editor.setMarkdown(firstDocument.content);
+                    console.log('Documentation loaded successfully');
+                    } else {
+                    throw new Error('Editor not properly initialized or setMarkdown method not found');
+                    }
+                }, 500);
+                } else {
+                console.log('No documents found');
+                }
+            } catch (error) {
+                console.error('加载文档失败:', error);
+                alert('加载文档失败: ' + error.message);
+            }
+        }
+
+        // 保存文档的函数
+        async function saveDocumentation() {
+            if (!editor) {
+                console.error('Editor not initialized');
+                return;
+            }
+            const content = editor.getMarkdown();
+            try {
+                const response = await fetch('/api/documentation', {
+                    method: 'POST',
+                    headers: {
+                        'Content-Type': 'application/json'
+                    },
+                    body: JSON.stringify({ content })
+                });
+                if (!response.ok) {
+                    throw new Error(`HTTP error! status: ${response.status}`);
+                }
+                const result = await response.json();
+                if (result.success) {
+                    alert('文档保存成功');
+                } else {
+                    throw new Error('保存失败');
+                }
+            } catch (error) {
+                console.error('保存文档失败:', error);
+                alert('保存文档失败: ' + error.message);
+            }
+        }
+
+        async function loadConfig() {
+            try {
+                const response = await fetch('/api/config');
+                const config = await response.json();
+                document.getElementById('logoUrl').value = config.logo || '';
+                document.getElementById('proxyDomain').value = config.proxyDomain || '';
+                setMenuItems(config.menuItems || []);
+                loadDocumentation(); // 新增:加载文档
+            } catch (error) {
+                console.error('加载配置失败:', error);
+            }
+        }
+
+        async function login() {
+            console.log("执行登录操作");
+            const username = document.getElementById('username').value;
+            const password = document.getElementById('password').value;
+            const captcha = document.getElementById('captcha').value;
+            
+            if (!username || !password || !captcha) {
+                alert('请填写完整的登录信息');
+                return;
+            }
+            
+            try {
+                const response = await fetch('/api/login', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify({ username, password, captcha })
+                });
+                
+                if (response.ok) {
+                    console.log("登录成功");
+                    isLoggedIn = true;
+                    // 不再使用localStorage
+                    document.getElementById('loginModal').style.display = 'none';
+                    document.getElementById('adminContainer').style.display = 'flex';
+                    
+                    // 加载数据
+                    loadConfig();
+                    refreshSystemStatus();
+                    loadUserStats();
+                    loadDockerStatus();
+                } else {
+                    const errorData = await response.json();
+                    alert(errorData.error || '登录失败');
+                }
+            } catch (error) {
+                alert('登录失败: ' + error.message);
+            }
+        }
+
+        async function changePassword() {
+            const currentPassword = document.getElementById('currentPassword').value;
+            const newPassword = document.getElementById('newPassword').value;
+            const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[.,\-_+=()[\]{}|\\;:'"<>?/@$!%*#?&])[A-Za-z\d.,\-_+=()[\]{}|\\;:'"<>?/@$!%*#?&]{8,16}$/;
+
+            if (!currentPassword || !newPassword) {
+                alert('请填写当前密码和新密码');
+                return;
+            }
+            if (!passwordRegex.test(newPassword)) {
+                alert('密码必须包含至少一个字母、一个数字和一个特殊字符,长度在8到16个字符之间');
+                return;
+            }
+            try {
+                const response = await fetch('/api/change-password', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify({ currentPassword, newPassword })
+                });
+                if (response.ok) {
+                    alert('密码已修改');
+                    // 清除当前会话并显示登录模态框
+                    localStorage.removeItem('isLoggedIn');
+                    isLoggedIn = false;
+                    document.getElementById('loginModal').style.display = 'block';
+                    document.getElementById('adminContainer').classList.add('hidden');
+                    refreshCaptcha();
+
+                    // 清除登录表单中的输入数据
+                    document.getElementById('username').value = '';
+                    document.getElementById('password').value = '';
+                    document.getElementById('captcha').value = '';
+                } else {
+                    alert('修改密码失败');
+                }
+            } catch (error) {
+                alert('修改密码失败: ' + error.message);
+            }
+        }
+
+        function checkPasswordStrength() {
+            const newPassword = document.getElementById('newPassword').value;
+            const passwordHint = document.getElementById('passwordHint');
+
+            const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[.,\-_+=()[\]{}|\\;:'"<>?/@$!%*#?&])[A-Za-z\d.,\-_+=()[\]{}|\\;:'"<>?/@$!%*#?&]{8,16}$/;
+
+            if (!passwordRegex.test(newPassword)) {
+                passwordHint.style.display = 'block';
+            } else {
+                passwordHint.style.display = 'none';
+            }
+        }
+
+
+        // 页面加载时检查登录状态
+        window.onload = async function() {
+            try {
+                console.log("检查会话状态...");
+                const response = await fetch('/api/check-session');
+                if (response.ok) {
+                    // 不再使用localStorage检查登录状态,而是依赖服务器返回的会话状态
+                    console.log("会话有效,用户已登录");
+                    isLoggedIn = true;
+                    document.getElementById('adminContainer').style.display = 'flex';
+                    document.getElementById('loadingIndicator').style.display = 'none';
+                    
+                    // 加载所有必需数据
+                    loadDocumentList();
+                    await loadConfig();
+                    initEditor();
+                    
+                    // 立即加载真实系统数据
+                    await refreshSystemStatus();
+                    await loadUserStats();
+                    await loadDockerStatus();
+                    
+                    const lastSection = localStorage.getItem('currentSection') || 'dashboard';
+                    showSection(lastSection);
+                } else {
+                    throw new Error('会话检查失败');
+                }
+            } catch (error) {
+                console.error('初始化过程中出错:', error);
+                document.getElementById('loginModal').style.display = 'flex';
+                document.getElementById('loadingIndicator').style.display = 'none';
+                refreshCaptcha();
+            }
+        };
+
+        document.addEventListener('DOMContentLoaded', async function() {
+            try {
+                // 直接添加事件监听
+                document.getElementById('userCenterBtn').addEventListener('click', function() {
+                    showSection('user-center');
+                });
+                
+                document.getElementById('logoutBtn').addEventListener('click', logout);
+                
+                document.getElementById('ucLogoutBtn').addEventListener('click', logout);
+                
+                document.getElementById('saveSecurityBtn').addEventListener('click', saveSecuritySettings);
+                
+                // 确保testDomain输入框可编辑
+                const testDomainInput = document.getElementById('testDomain');
+                testDomainInput.readOnly = false;
+                testDomainInput.addEventListener('input', function() {
+                    document.getElementById('domainSelect').value = '';
+                });
+                
+                // 控制面板卡片详情按钮
+                document.querySelectorAll('.dashboard-card .card-action').forEach(btn => {
+                    btn.addEventListener('click', function() {
+                        const cardTitle = this.closest('.dashboard-card').querySelector('.card-title').textContent.trim();
+                        if (cardTitle === '磁盘空间') {
+                            checkDiskSpace();
+                        } else if (cardTitle === 'CPU 负载' || cardTitle === '系统内存') {
+                            showSection('docker-monitoring');
+                        } else if (cardTitle === '容器总数') {
+                            showSection('docker-status');
+                        }
+                    });
+                });
+                
+                // 控制面板刷新按钮
+                document.querySelector('.welcome-action').addEventListener('click', refreshSystemStatus);
+                
+                // 加载初始数据
+                const response = await fetch('/api/check-session');
+                if (response.ok) {
+                    isLoggedIn = localStorage.getItem('isLoggedIn') === 'true';
+                    if (isLoggedIn) {
+                        loadDocumentList();
+                        document.getElementById('adminContainer').style.display = 'flex';
+                        await loadConfig();
+                        initEditor();
+                        
+                        // 立即加载真实系统数据
+                        refreshSystemStatus();
+                        loadUserStats();
+                        loadDockerStatus();
+                        
+                        const lastSection = localStorage.getItem('currentSection') || 'basic-config';
+                        showSection(lastSection);
+                    } else {
+                        document.getElementById('loginModal').style.display = 'flex';
+                        refreshCaptcha();
+                    }
+                } else {
+                    throw new Error('Session check failed');
+                }
+            } catch (error) {
+                console.error('Error during initialization:', error);
+                localStorage.removeItem('isLoggedIn');
+                document.getElementById('loginModal').style.display = 'flex';
+                refreshCaptcha();
+            } finally {
+                document.getElementById('loadingIndicator').style.display = 'none';
+            }
+        });
+
+        function updateAdImage(adImages) {
+            const adContainer = document.getElementById('adContainer');
+            adContainer.innerHTML = '';
+            if (adImages && adImages.length > 0) {
+                adImages.forEach(ad => {
+                    const adLink = document.createElement('a');
+                    adLink.href = ad.link;
+                    adLink.target = '_blank';
+                    const adImage = document.createElement('img');
+                    adImage.src = ad.url;
+                    adImage.alt = ad.alt || '广告图片';
+                    adLink.appendChild(adImage);
+                    adContainer.appendChild(adLink);
+                });
+
+                // 轮播功能
+                let currentAdIndex = 0;
+                setInterval(() => {
+                    currentAdIndex = (currentAdIndex + 1) % adImages.length;
+                    adImages.forEach((ad, index) => {
+                        const adImage = adContainer.children[index];
+                        if (index === currentAdIndex) {
+                            adImage.style.display = 'block';
+                        } else {
+                            adImage.style.display = 'none';
+                        }
+                    });
+                }, 5000); // 每5秒切换一次广告
+            }
+        }
+
+        async function refreshCaptcha() {
+            try {
+                const response = await fetch('/api/captcha');
+                const data = await response.json();
+                document.getElementById('captchaText').textContent = data.captcha;
+            } catch (error) {
+                console.error('刷新验证码失败:', error);
+            }
+        }
+
+        async function refreshDockerStatus() {
+            const spinner = document.getElementById('loadingSpinner');
+            const refreshButton = document.getElementById('refreshDockerStatusButton');
+            const table = document.getElementById('dockerStatusTable');
+            
+            try {
+                spinner.style.display = 'block';
+                refreshButton.classList.add('disabled');
+                table.classList.add('disabled');
+                
+                await loadDockerStatus();
+            } catch (error) {
+                console.error('刷新 Docker 状态失败:', error);
+                alert('刷新 Docker 状态失败: ' + error.message);
+            } finally {
+                spinner.style.display = 'none';
+                refreshButton.classList.remove('disabled');
+                table.classList.remove('disabled');
+            }
+        }
+
+        function saveDockerStatusToCache(containerStatus) {
+            localStorage.setItem('dockerStatus', JSON.stringify(containerStatus));
+            localStorage.setItem('dockerStatusTimestamp', Date.now());
+        }
+
+        function getDockerStatusFromCache() {
+            const cachedStatus = localStorage.getItem('dockerStatus');
+            const timestamp = localStorage.getItem('dockerStatusTimestamp');
+            if (cachedStatus && timestamp) {
+                // 检查缓存是否在过去5分钟内更新过
+                if (Date.now() - parseInt(timestamp) < 5 * 60 * 1000) {
+                    return JSON.parse(cachedStatus);
+                }
+            }
+            return null;
+        }
+
+        async function loadDockerStatus() {
+            const tbody = document.getElementById('dockerStatusTableBody');
+            
+            // 尝试从缓存加载数据
+            const cachedStatus = getDockerStatusFromCache();
+            if (cachedStatus) {
+                renderDockerStatus(cachedStatus);
+                isDockerStatusLoaded = true;
+            } else if (!isDockerStatusLoaded) {
+                tbody.innerHTML = '<tr><td colspan="8" style="text-align: center;">加载中...</td></tr>';
+            }
+
+            try {
+                const response = await fetch('/api/docker-status');
+                if (!response.ok) {
+                    if (response.status === 503) {
+                        throw new Error('无法连接到 Docker 守护进程');
+                    }
+                    throw new Error('Failed to fetch Docker status');
+                }
+                const containerStatus = await response.json();
+                renderDockerStatus(containerStatus);
+                isDockerStatusLoaded = true;
+                saveDockerStatusToCache(containerStatus);
+            } catch (error) {
+                console.error('Error loading Docker status:', error);
+                if (!cachedStatus) {
+                    tbody.innerHTML = `<tr><td colspan="8" style="text-align: center; color: red;">${error.message}</td></tr>`;
+                }
+                isDockerStatusLoaded = false;
+            }
+        }
+
+        function renderDockerStatus(containerStatus) {
+            const table = document.getElementById('dockerStatusTable');
+            const thead = table.getElementsByTagName('thead')[0];
+            const tbody = document.getElementById('dockerStatusTableBody');
+
+            thead.innerHTML = `
+                <tr>
+                    <th>容器 ID</th>
+                    <th>名称</th>
+                    <th>镜像</th>
+                    <th>状态</th>
+                    <th>CPU</th>
+                    <th>内存</th>
+                    <th>创建时间</th>
+                    <th>操作</th>
+                </tr>
+            `;
+
+            tbody.innerHTML = '';
+
+            containerStatus.forEach(container => {
+                const row = `
+                <tr>
+                    <td>${container.id}</td>
+                    <td>${container.name}</td>
+                    <td>${container.image}</td>
+                    <td class="status-cell" id="status-${container.id}">
+                        <div class="status-content">${container.state}</div>
+                    </td>
+                    <td>${container.cpu}</td>
+                    <td>${container.memory}</td>
+                    <td>${container.created}</td>
+                    <td>
+                        <select onchange="handleContainerAction('${container.id}', '${container.image}', this.value)" class="action-select">
+                            <option value="">选择操作</option>
+                            <option value="restart">重启</option>
+                            <option value="stop">停止</option>
+                            <option value="update">更新</option>
+                            <option value="delete">删除</option>
+                            <option value="logs">查看日志</option>                            
+                        </select>
+                    </td>
+                </tr>
+                `;
+                tbody.innerHTML += row;
+            });
+        }
+
+        function handleContainerAction(id, image, action) {
+            switch(action) {
+                case 'restart':
+                    restartContainer(id);
+                    break;
+                case 'stop':
+                    stopContainer(id);
+                    break;
+                case 'update':
+                    updateContainer(id, image);
+                    break;
+                case 'logs':
+                    viewLogs(id);
+                    break;
+                case 'delete':
+                    deleteContainer(id);
+                    break;
+            }
+            // 重置选择框
+            document.querySelector(`select[onchange*="${id}"]`).value = "";
+        }
+
+        async function viewLogs(id) {
+            try {
+                // 创建模态框
+                const modal = document.createElement('div');
+                modal.style.position = 'fixed';
+                modal.style.left = '0';
+                modal.style.top = '0';
+                modal.style.width = '100%';
+                modal.style.height = '100%';
+                modal.style.backgroundColor = 'rgba(0,0,0,0.5)';
+                modal.style.display = 'flex';
+                modal.style.justifyContent = 'center';
+                modal.style.alignItems = 'center';
+                modal.style.zIndex = '1000';
+
+                const content = document.createElement('div');
+                content.style.backgroundColor = 'black';
+                content.style.color = 'white';
+                content.style.padding = '20px';
+                content.style.borderRadius = '5px';
+                content.style.width = '80%';
+                content.style.height = '80%';
+                content.style.display = 'flex';
+                content.style.flexDirection = 'column';
+                content.style.position = 'relative';
+
+                const logContent = document.createElement('pre');
+                logContent.style.flex = '1';
+                logContent.style.overflowY = 'auto';
+                logContent.style.padding = '10px';
+                logContent.style.backgroundColor = '#1e1e1e';
+                logContent.style.color = '#d4d4d4';
+                logContent.style.fontFamily = 'monospace';
+                logContent.style.fontSize = '14px';
+                logContent.style.lineHeight = '1.5';
+                logContent.style.whiteSpace = 'pre-wrap';
+                logContent.style.wordBreak = 'break-all';
+
+                const closeButton = document.createElement('button');
+                closeButton.textContent = '关闭';
+                closeButton.style.position = 'absolute';
+                closeButton.style.top = '10px';
+                closeButton.style.right = '10px';
+                closeButton.style.padding = '5px 10px';
+                closeButton.style.backgroundColor = '#4CAF50';
+                closeButton.style.color = 'white';
+                closeButton.style.border = 'none';
+                closeButton.style.borderRadius = '3px';
+                closeButton.style.cursor = 'pointer';
+
+                content.appendChild(logContent);
+                content.appendChild(closeButton);
+                modal.appendChild(content);
+                document.body.appendChild(modal);
+
+                // 使用 WebSocket 或长轮询获取日志
+                const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
+                let ws;
+
+                try {
+                    ws = new WebSocket(`${protocol}//${window.location.host}/api/docker/logs/${id}`);
+                    
+                    ws.onopen = () => {
+                        logContent.textContent += "WebSocket 连接已建立,正在接收日志...\n";
+                    };
+
+                    ws.onmessage = (event) => {
+                        const filteredData = event.data.replace(/[\x00-\x09\x0B-\x0C\x0E-\x1F\x7F-\x9F]/g, '');
+                        logContent.textContent += filteredData;
+                        logContent.scrollTop = logContent.scrollHeight;
+                    };
+
+                    ws.onerror = (error) => {
+                        console.error('WebSocket错误:', error);
+                        logContent.textContent += "WebSocket 连接错误,切换到长轮询模式...\n";
+                        useLongPolling(id, logContent);
+                    };
+
+                    ws.onclose = () => {
+                        logContent.textContent += "WebSocket 连接已关闭。\n";
+                    };
+                } catch (error) {
+                    console.error('WebSocket连接失败:', error);
+                    logContent.textContent += "无法建立 WebSocket 连接,使用长轮询模式...\n";
+                    useLongPolling(id, logContent);
+                }
+
+                // 关闭按钮和模态框点击事件
+                closeButton.onclick = () => {
+                    if (ws) ws.close();
+                    document.body.removeChild(modal);
+                };
+
+                modal.onclick = (e) => {
+                    if (e.target === modal) {
+                        if (ws) ws.close();
+                        document.body.removeChild(modal);
+                    }
+                };
+
+            } catch (error) {
+                console.error('查看日志失败:', error);
+                alert('查看日志失败: ' + error.message);
+            }
+        }
+
+        function useLongPolling(id, logContent) {
+            let isPolling = true;
+
+            async function pollLogs() {
+                if (!isPolling) return;
+
+                try {
+                    const response = await fetch(`/api/docker/logs-poll/${id}`);
+                    if (!response.ok) throw new Error('获取日志失败');
+                    
+                    const logs = await response.text();
+                    logContent.textContent += logs;
+                    logContent.scrollTop = logContent.scrollHeight;
+                } catch (error) {
+                    console.error('轮询日志失败:', error);
+                    logContent.textContent += "获取日志失败,请检查网络连接...\n";
+                }
+
+                // 继续轮询
+                setTimeout(pollLogs, 2000); // 每2秒轮询一次
+            }
+
+            pollLogs();
+
+            // 返回一个停止轮询的函数
+            return () => { isPolling = false; };
+        }
+
+
+        async function restartContainer(id) {
+            if (confirm('确定要重启这个容器吗?')) {
+                try {
+                    const statusCell = document.getElementById(`status-${id}`);
+                    statusCell.innerHTML = '<div class="loading-container"><div class="loading"></div></div>';
+
+                    const response = await fetch(`/api/docker/restart/${id}`, { method: 'POST' });
+                    if (response.ok) {
+                        await new Promise(resolve => setTimeout(resolve, 2000)); // 等待2秒,确保状态已更新
+                        const newStatus = await getContainerStatus(id);
+                        statusCell.textContent = newStatus;
+                    } else {
+                        throw new Error('重启失败');
+                    }
+                } catch (error) {
+                    console.error('重启容器失败:', error);
+                    alert('重启容器失败: ' + error.message);
+                    loadDockerStatus(); // 重新加载所有容器状态
+                }
+            }
+        }
+
+        async function stopContainer(id) {
+            if (confirm('确定要停止这个容器吗?')) {
+                try {
+                    const statusCell = document.getElementById(`status-${id}`);
+                    statusCell.innerHTML = '<div class="loading-container"><div class="loading"></div></div>';
+                    
+                    const response = await fetch(`/api/docker/stop/${id}`, { method: 'POST' });
+                    if (response.ok) {
+                        await new Promise(resolve => setTimeout(resolve, 2000)); // 等待2秒,确保状态已更新
+                        const newStatus = await getContainerStatus(id);
+                        statusCell.innerHTML = `<div class="status-content">${newStatus}</div>`;
+                    } else {
+                        throw new Error('停止失败');
+                    }
+                } catch (error) {
+                    console.error('停止容器失败:', error);
+                    alert('停止容器失败: ' + error.message);
+                    loadDockerStatus(); // 重新加载所有容器状态
+                }
+            }
+        }
+
+        async function getContainerStatus(id) {
+            const response = await fetch(`/api/docker/status/${id}`);
+            if (response.ok) {
+                const data = await response.json();
+                return data.state;
+            } else {
+                throw new Error('获取容器状态失败');
+            }
+        }
+
+
+        async function updateContainer(id, currentImage) {
+            const tag = prompt(`请输入 ${currentImage} 的新标签:`, 'latest');
+            if (tag) {
+                try {
+                    const statusCell = document.getElementById(`status-${id}`);
+                    statusCell.textContent = 'Updating';
+                    statusCell.style.color = 'orange';
+
+                    const response = await fetch(`/api/docker/update/${id}`, {
+                        method: 'POST',
+                        headers: { 'Content-Type': 'application/json' },
+                        body: JSON.stringify({ tag })
+                    });
+
+                    if (response.ok) {
+                        const result = await response.json();
+                        alert(result.message || '容器更新成功');
+                    } else {
+                        const errorData = await response.json();
+                        throw new Error(errorData.error || '更新失败');
+                    }
+                } catch (error) {
+                    console.error('更新容器失败:', error);
+                    alert('更新容器失败: ' + error.message);
+                } finally {
+                    loadDockerStatus(); // 重新加载容器状态
+                }
+            }
+        }
+
+        function refreshDockerStatus() {
+            isDockerStatusLoaded = false;
+            localStorage.removeItem('dockerStatus');
+            localStorage.removeItem('dockerStatusTimestamp');
+            loadDockerStatus();
+        }
+
+        async function deleteContainer(id) {
+            if (confirm('确定要删除这个容器吗?此操作不可逆。')) {
+                try {
+                    const statusCell = document.getElementById(`status-${id}`);
+                    statusCell.textContent = 'Deleting';
+                    statusCell.style.color = 'red';
+
+                    const response = await fetch(`/api/docker/delete/${id}`, { method: 'POST' });
+                    if (response.ok) {
+                        alert('容器删除成功');
+                        loadDockerStatus(); // 重新加载容器状态
+                    } else {
+                        const errorData = await response.json();
+                        throw new Error(errorData.error || '删除失败');
+                    }
+                } catch (error) {
+                    console.error('删除容器失败:', error);
+                    alert('删除容器失败: ' + error.message);
+                    loadDockerStatus(); // 重新加载所有容器状态
+                }
+            }
+        }
+
+
+        document.addEventListener('DOMContentLoaded', function() {
+            const sidebarItems = document.querySelectorAll('.sidebar li');
+            const contentSections = document.querySelectorAll('.content-section');
+            const testDomainInput = document.getElementById('testDomain');
+            const domainSelect = document.getElementById('domainSelect');
+
+            // 当选择预定义域名时,更新输入框
+            domainSelect.addEventListener('change', function() {
+                if (this.value) {
+                    testDomainInput.value = this.value;
+                }
+            });
+
+            // 当输入框获得焦点时,清空选择框
+            testDomainInput.addEventListener('focus', function() {
+                domainSelect.value = '';
+            });
+
+            // docker监控
+            loadContainers();
+            loadMonitoringConfig();
+            
+            // 绑定测试通知按钮的点击事件
+            document.querySelector('#docker-monitoring button:nth-of-type(1)').addEventListener('click', testNotification);
+            
+            // 绑定保存配置按钮的点击事件
+            document.querySelector('#docker-monitoring button:nth-of-type(2)').addEventListener('click', saveMonitoringConfig);
+            
+            // 绑定开启/关闭监控按钮的点击事件
+            document.querySelector('#docker-monitoring button:nth-of-type(3)').addEventListener('click', toggleMonitoring);
+
+            // 为通知类型下拉框添加变更事件监听器
+            document.getElementById('notificationType').addEventListener('change', toggleNotificationFields);
+
+            refreshStoppedContainers(); // 初始加载已停止的容器
+
+            // 网络测试函数
+            function runNetworkTest() {
+                const domain = testDomainInput.value.trim();
+                const testType = document.getElementById('testType').value;
+                const resultsDiv = document.getElementById('testResults');
+
+                // 验证输入
+                if (!domain) {
+                    alert('请输入目标域名或IP地址');
+                    return;
+                }
+
+                // 验证域名格式
+                const domainRegex = /^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i;
+                // 验证IPv4格式
+                const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
+                // 验证IPv6格式
+                const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
+
+                // 检查是否为预定义的选项之一
+                const predefinedOptions = [
+                    'gcr.io', 'ghcr.io', 'quay.io', 'k8s.gcr.io', 'registry.k8s.io',
+                    'mcr.microsoft.com', 'docker.elastic.com', 'registry-1.docker.io'
+                ];
+
+                if (!predefinedOptions.includes(domain) && 
+                    !domainRegex.test(domain) && 
+                    !ipv4Regex.test(domain) && 
+                    !ipv6Regex.test(domain)) {
+                    alert('请输入有效的域名或IP地址');
+                    return;
+                }
+
+                resultsDiv.innerHTML = '测试中,请稍候...';
+
+                const controller = new AbortController();
+                const timeoutId = setTimeout(() => controller.abort(), 60000); // 60秒超时
+
+                fetch('/api/network-test', {
+                    method: 'POST',
+                    headers: {
+                        'Content-Type': 'application/json',
+                    },
+                    body: JSON.stringify({ domain, testType }),
+                    signal: controller.signal
+                })
+                .then(response => {
+                    clearTimeout(timeoutId);
+                    if (!response.ok) {
+                        throw new Error('网络测试失败');
+                    }
+                    return response.text();
+                })
+                .then(result => {
+                    resultsDiv.textContent = result;
+                })
+                .catch(error => {
+                    console.error('网络测试出错:', error);
+                    if (error.name === 'AbortError') {
+                        resultsDiv.textContent = '测试超时,请稍后再试';
+                    } else {
+                        resultsDiv.textContent = '测试失败: ' + error.message;
+                    }
+                });
+            }
+
+            // 绑定测试按钮点击事件
+            document.querySelector('#network-test button').addEventListener('click', runNetworkTest);
+
+
+            let isDockerStatusLoaded = false;
+
+            function showSection(sectionId) {
+                contentSections.forEach(section => {
+                    if (section.id === sectionId) {
+                        section.classList.add('active');
+                        if (sectionId === 'docker-status') {
+                            loadDockerStatus(); // 每次显示 Docker 状态部分时都尝试加载
+                        }
+                    } else {
+                        section.classList.remove('active');
+                    }
+                });
+                localStorage.setItem('currentSection', sectionId);
+
+                // 更新侧边栏active状态
+                sidebarItems.forEach(item => {
+                    if (item.getAttribute('data-section') === sectionId) {
+                        item.classList.add('active');
+                    } else {
+                        item.classList.remove('active');
+                    }
+                });
+            }
+
+            sidebarItems.forEach(item => {
+                item.addEventListener('click', function() {
+                    const sectionId = this.getAttribute('data-section');
+                    showSection(sectionId);
+                });
+            });
+
+
+            // docker 监控
+            // 显示消息
+            function showMessage(message, isError = false) {
+                const messageContainer = document.getElementById('messageContainer');
+                const messageElement = document.createElement('div');
+                messageElement.textContent = message;
+                messageElement.className = isError ? 'error-message' : 'success-message';
+                messageContainer.appendChild(messageElement);
+                setTimeout(() => messageElement.remove(), 3000);
+            }
+
+            // 加载容器列表
+            async function loadContainers() {
+                try {
+                    const response = await fetch('/api/stopped-containers');
+                    const containers = await response.json();
+                    renderStoppedContainers(containers);
+                } catch (error) {
+                    showMessage('加载容器列表失败: ' + error.message, true);
+                }
+            }
+            // 确保在页面加载时调用 loadContainers
+            document.addEventListener('DOMContentLoaded', loadContainers);
+
+            // 切换单个容器的监控状态
+            async function toggleContainerMonitoring(containerId, isMonitored) {
+                try {
+                    const response = await fetch(`/api/container/${containerId}/monitor`, {
+                        method: 'POST',
+                        headers: { 'Content-Type': 'application/json' },
+                        body: JSON.stringify({ isMonitored })
+                    });
+                    if (response.ok) {
+                        showMessage(`容器 ${containerId} 监控状态已${isMonitored ? '开启' : '关闭'}`);
+                    } else {
+                        throw new Error('操作失败');
+                    }
+                } catch (error) {
+                    showMessage(`切换容器监控状态失败: ${error.message}`, true);
+                }
+            }
+
+            function toggleNotificationFields() {
+                const notificationType = document.getElementById('notificationType').value;
+                const wechatFields = document.getElementById('wechatFields');
+                const telegramFields = document.getElementById('telegramFields');
+
+                if (notificationType === 'wechat') {
+                    wechatFields.style.display = 'block';
+                    telegramFields.style.display = 'none';
+                } else if (notificationType === 'telegram') {
+                    wechatFields.style.display = 'none';
+                    telegramFields.style.display = 'block';
+                }
+            }
+
+            async function testNotification() {
+                const notificationType = document.getElementById('notificationType').value;
+                let data = {
+                    notificationType: notificationType,
+                    monitorInterval: document.getElementById('monitorInterval').value
+                };
+
+                if (notificationType === 'wechat') {
+                    data.webhookUrl = document.getElementById('webhookUrl').value;
+                } else if (notificationType === 'telegram') {
+                    data.telegramToken = document.getElementById('telegramToken').value;
+                    data.telegramChatId = document.getElementById('telegramChatId').value;
+                }
+
+                try {
+                    const response = await fetch('/api/test-notification', {
+                        method: 'POST',
+                        headers: { 'Content-Type': 'application/json' },
+                        body: JSON.stringify(data)
+                    });
+
+                    if (response.ok) {
+                        const result = await response.json();
+                        showMessage(result.message || '通知测试成功!');
+                    } else {
+                        const errorData = await response.json();
+                        throw new Error(errorData.error || '测试失败');
+                    }
+                } catch (error) {
+                    showMessage('通知测试失败: ' + error.message, true);
+                }
+            }
+
+            // 修改保存配置的函数
+            async function saveMonitoringConfig() {
+                const notificationType = document.getElementById('notificationType').value;
+                let data = {
+                    notificationType: notificationType,
+                    monitorInterval: document.getElementById('monitorInterval').value,
+                    isEnabled: document.getElementById('monitoringStatus').textContent === '已开启',
+                    webhookUrl: document.getElementById('webhookUrl').value,
+                    telegramToken: document.getElementById('telegramToken').value,
+                    telegramChatId: document.getElementById('telegramChatId').value
+                };
+
+                try {
+                    const response = await fetch('/api/monitoring-config', {
+                        method: 'POST',
+                        headers: { 'Content-Type': 'application/json' },
+                        body: JSON.stringify(data)
+                    });
+                    if (response.ok) {
+                        showMessage('监控配置已保存');
+                    } else {
+                        throw new Error('保存失败');
+                    }
+                } catch (error) {
+                    showMessage('保存监控配置失败: ' + error.message, true);
+                }
+            }
+
+            async function toggleMonitoring() {
+                const currentStatus = document.getElementById('monitoringStatus').textContent;
+                const newStatus = currentStatus === '已开启' ? false : true;
+
+                try {
+                    const response = await fetch('/api/toggle-monitoring', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' },
+                    body: JSON.stringify({ isEnabled: newStatus })
+                    });
+                    if (response.ok) {
+                    const result = await response.json();
+                    if (result.success) {
+                        updateMonitoringStatus(newStatus);
+                        showMessage(newStatus ? '监控已开启' : '监控已关闭');
+                    } else {
+                        throw new Error(result.message || '操作失败');
+                    }
+                    } else {
+                    throw new Error('切换失败');
+                    }
+                } catch (error) {
+                    showMessage('切换监控状态失败: ' + error.message, true);
+                }
+            }
+
+            // 加载监控配置
+            async function loadMonitoringConfig() {
+                try {
+                    const response = await fetch('/api/monitoring-config');
+                    const config = await response.json();
+                    
+                    document.getElementById('notificationType').value = config.notificationType || 'wechat';
+                    document.getElementById('webhookUrl').value = config.webhookUrl || '';
+                    document.getElementById('telegramToken').value = config.telegramToken || '';
+                    document.getElementById('telegramChatId').value = config.telegramChatId || '';
+                    document.getElementById('monitorInterval').value = config.monitorInterval || 60;
+                    
+                    updateMonitoringStatus(config.isEnabled);
+                    toggleNotificationFields(); // 确保根据加载的配置显示正确的字段
+                } catch (error) {
+                    showMessage('加载监控配置失败: ' + error.message, true);
+                }
+            }
+
+            // 更新监控状态显示
+            function updateMonitoringStatus(isEnabled) {
+                const statusElement = document.getElementById('monitoringStatus');
+                statusElement.textContent = isEnabled ? '已开启' : '已关闭';
+                statusElement.style.color = isEnabled ? 'green' : 'red';
+                document.getElementById('toggleMonitoringBtn').textContent = isEnabled ? '关闭监控' : '开启监控';
+            }
+
+            async function refreshStoppedContainers() {
+                const spinner = document.getElementById('loadingSpinner');
+                const refreshButton = document.querySelector('#docker-monitoring button:last-child');
+                const table = document.getElementById('stoppedContainersTable');
+                
+                try {
+                    spinner.style.display = 'block';
+                    refreshButton.disabled = true;
+                    table.classList.add('disabled');
+                    
+                    const response = await fetch('/api/refresh-stopped-containers');
+                    if (!response.ok) {
+                        throw new Error('Failed to fetch stopped containers');
+                    }
+                    const containers = await response.json();
+                    renderStoppedContainers(containers);
+                    showMessage('已停止的容器状态已刷新', false);
+                } catch (error) {
+                    console.error('Error refreshing stopped containers:', error);
+                    showMessage('刷新已停止的容器状态失败: ' + error.message, true);
+                } finally {
+                    spinner.style.display = 'none';
+                    refreshButton.disabled = false;
+                    table.classList.remove('disabled');
+                }
+            }
+
+            function renderStoppedContainers(containers) {
+                const tbody = document.getElementById('stoppedContainersBody');
+                tbody.innerHTML = '';
+
+                if (containers.length === 0) {
+                    tbody.innerHTML = '<tr><td colspan="3">没有已停止的容器</td></tr>';
+                    return;
+                }
+
+                containers.forEach(container => {
+                    const row = `
+                        <tr>
+                            <td>${container.id}</td>
+                            <td>${container.name}</td>
+                            <td>${container.status}</td>
+                        </tr>
+                    `;
+                    tbody.innerHTML += row;
+                });
+            }
+
+            // 确保在页面加载时初始化停止的容器列表
+            document.addEventListener('DOMContentLoaded', () => {
+                loadMonitoringConfig();
+                document.getElementById('notificationType').addEventListener('change', toggleNotificationFields);
+            });
+
+            // 页面加载时初始化
+            window.addEventListener('load', () => {
+                loadMonitoringConfig();
+                loadContainers();
+            });
+
+
+            // 页面加载时检查登录状态
+            window.onload = async function() {
+                try {
+                    const response = await fetch('/api/check-session');
+                    if (response.ok) {
+                        isLoggedIn = localStorage.getItem('isLoggedIn') === 'true';
+                        if (isLoggedIn) {
+                            loadDocumentList();
+                            document.getElementById('adminContainer').style.display = 'flex';
+                            await loadConfig();
+                            initEditor();
+
+                            const lastSection = localStorage.getItem('currentSection') || 'basic-config';
+                            showSection(lastSection);
+                            
+                            // 立即尝试加载 Docker 状态
+                            loadDockerStatus();
+                        } else {
+                            document.getElementById('loginModal').style.display = 'flex';
+                            refreshCaptcha();
+                        }
+                    } else {
+                        throw new Error('Session check failed');
+                    }
+                } catch (error) {
+                    console.error('Error during initialization:', error);
+                    localStorage.removeItem('isLoggedIn');
+                    document.getElementById('loginModal').style.display = 'flex';
+                    refreshCaptcha();
+                } finally {
+                    document.getElementById('loadingIndicator').style.display = 'none';
+                }
+            };
+
+            // 为按钮添加交互反馈效果
+            document.addEventListener('DOMContentLoaded', function() {
+                // 为所有按钮添加点击反馈
+                const buttons = document.querySelectorAll('button');
+                buttons.forEach(button => {
+                    button.addEventListener('click', function() {
+                        // 添加波纹效果
+                        const ripple = document.createElement('span');
+                        ripple.classList.add('ripple');
+                        this.appendChild(ripple);
+                        
+                        // 设置波纹位置
+                        const rect = this.getBoundingClientRect();
+                        ripple.style.left = '50%';
+                        ripple.style.top = '50%';
+                        
+                        // 移除波纹
+                        setTimeout(() => {
+                            ripple.remove();
+                        }, 600);
+                    });
+                });
+                
+                // 增强表单交互
+                const inputs = document.querySelectorAll('input, select');
+                inputs.forEach(input => {
+                    // 聚焦时添加类
+                    input.addEventListener('focus', function() {
+                        this.parentElement.classList.add('focused');
+                    });
+                    
+                    // 失焦时移除类
+                    input.addEventListener('blur', function() {
+                        this.parentElement.classList.remove('focused');
+                    });
+                });
+                
+                // 修复网络测试页面不能手动输入域名问题
+                const testDomainInput = document.getElementById('testDomain');
+                if (testDomainInput) {
+                    testDomainInput.removeAttribute('readonly'); // 移除只读属性
+                    testDomainInput.addEventListener('input', function() {
+                        const domainSelect = document.getElementById('domainSelect');
+                        if (this.value && domainSelect) {
+                            domainSelect.value = '';
+                        }
+                    });
+                }
+                
+                // 修复用户中心页面按钮图标问题
+                const userCenterSaveBtn = document.querySelector('.user-center-section button.btn.btn-primary');
+                if (userCenterSaveBtn) {
+                    userCenterSaveBtn.innerHTML = '保存设置';
+                }
+                
+                const userCenterLogoutBtn = document.querySelector('.user-center-header .btn.btn-primary');
+                if (userCenterLogoutBtn) {
+                    userCenterLogoutBtn.innerHTML = '退出登录';
+                }
+                
+                // 修复控制面板详情按钮
+                const dashboardDetailBtns = document.querySelectorAll('.dashboard-card .card-action');
+                dashboardDetailBtns.forEach(btn => {
+                    btn.addEventListener('click', function() {
+                        const cardTitle = this.closest('.dashboard-card').querySelector('.card-title').textContent.trim();
+                        if (cardTitle === '磁盘空间') {
+                            checkDiskSpace();
+                        } else if (cardTitle === 'CPU 负载' || cardTitle === '系统内存') {
+                            showSection('docker-monitoring');
+                        } else if (cardTitle === '容器总数') {
+                            showSection('docker-status');
+                        }
+                    });
+                });
+            });
+
+            // 替换原有的alert弹窗
+            function showAlert(message, type = 'info') {
+                Swal.fire({
+                    title: type === 'error' ? '错误' : '提示',
+                    text: message,
+                    icon: type,
+                    confirmButtonText: '确定',
+                    confirmButtonColor: '#3D7CF4'
+                });
+            }
+
+            // 替换原有的confirm弹窗
+            function showConfirm(message, callback) {
+                Swal.fire({
+                    title: '确认操作',
+                    text: message,
+                    icon: 'question',
+                    showCancelButton: true,
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    confirmButtonColor: '#3D7CF4',
+                    cancelButtonColor: '#6C757D'
+                }).then((result) => {
+                    if (result.isConfirmed) {
+                        callback();
+                    }
+                });
+            }
+
+            // 覆盖默认的 alert 和 confirm
+            const originalAlert = window.alert;
+            window.alert = function(message) {
+                showAlert(message, message.toLowerCase().includes('失败') || message.toLowerCase().includes('错误') ? 'error' : 'success');
+            };
+
+            const originalConfirm = window.confirm;
+            window.confirm = function(message) {
+                return new Promise((resolve) => {
+                    showConfirm(message, () => resolve(true));
+                });
+            };
+
+            // 增强操作交互
+            function handleContainerAction(id, image, action) {
+                if (action === '') return;
+                
+                // 原有的 switch 语句处理
+                switch(action) {
+                    case 'restart':
+                        showConfirm(`确定要重启容器 ${id} 吗?`, () => restartContainer(id));
+                        break;
+                    case 'stop':
+                        showConfirm(`确定要停止容器 ${id} 吗?`, () => stopContainer(id));
+                        break;
+                    case 'update':
+                        updateContainer(id, image);
+                        break;
+                    case 'logs':
+                        viewLogs(id);
+                        break;
+                    case 'delete':
+                        showConfirm(`确定要删除容器 ${id} 吗?此操作不可逆。`, () => deleteContainer(id));
+                        break;
+                }
+                
+                // 重置选择框
+                document.querySelector(`select[onchange*="${id}"]`).value = "";
+            }
+
+            // 美化表单提交
+            async function saveDocument() {
+                const title = document.getElementById('documentTitle').value.trim();
+                const content = editor.getMarkdown();
+                
+                if (!title) {
+                    showAlert('请输入文档标题', 'error');
+                    return;
+                }
+                
+                // 显示保存中状态
+                Swal.fire({
+                    title: '正在保存',
+                    text: '请稍候...',
+                    allowOutsideClick: false,
+                    didOpen: () => {
+                        Swal.showLoading();
+                    }
+                });
+                
+                try {
+                    const response = await fetch('/api/documentation', {
+                        method: 'POST',
+                        headers: { 'Content-Type': 'application/json' },
+                        body: JSON.stringify({ 
+                            id: currentEditingDoc ? currentEditingDoc.id : null, 
+                            title, 
+                            content 
+                        })
+                    });
+                    
+                    if (response.ok) {
+                        Swal.fire({
+                            title: '保存成功',
+                            icon: 'success',
+                            timer: 1500,
+                            showConfirmButton: false
+                        }).then(() => {
+                            hideEditor();
+                            loadDocumentList();
+                        });
+                    } else {
+                        throw new Error('保存失败');
+                    }
+                } catch (error) {
+                    console.error('保存文档失败:', error);
+                    showAlert('保存文档失败: ' + error.message, 'error');
+                }
+            }
+        });
+
+        async function logout() {
+            console.log("执行退出登录操作");
+            try {
+                const response = await fetch('/api/logout', {
+                    method: 'POST',
+                    headers: { 'Content-Type': 'application/json' }
+                });
+                
+                if (response.ok) {
+                    console.log("退出登录成功");
+                    // 不再操作localStorage
+                    window.location.reload(); // 直接刷新页面
+                } else {
+                    throw new Error('退出登录失败');
+                }
+            } catch (error) {
+                console.error('退出登录失败:', error);
+                alert('退出登录失败: ' + error.message);
+            }
+        }
+
+        // 控制面板相关函数
+        async function refreshSystemStatus() {
+            console.log("刷新系统状态,获取真实数据");
+            try {
+                const response = await fetch('/api/system-stats');
+                if (!response.ok) {
+                    throw new Error('获取系统状态失败');
+                }
+                
+                const data = await response.json();
+                console.log("获取到系统数据:", data);
+                
+                // 更新控制面板数据
+                document.getElementById('totalContainers').textContent = data.containerCount || '0';
+                document.getElementById('systemMemory').textContent = data.memoryUsage || '0%';
+                document.getElementById('cpuLoad').textContent = data.cpuLoad || '0%';
+                document.getElementById('diskSpace').textContent = data.diskSpace || '0%';
+                
+                // 更新最近活动表
+                updateRecentActivities(data.recentActivities || []);
+            } catch (error) {
+                console.error('刷新系统状态失败:', error);
+                alert('刷新系统状态失败: ' + error.message);
+            }
+        }
+        
+        // 更新最近活动表
+        function updateRecentActivities(activities) {
+            const tbody = document.getElementById('recentActivitiesBody');
+            tbody.innerHTML = '';
+            
+            if (activities.length === 0) {
+                tbody.innerHTML = '<tr><td colspan="4" style="text-align: center;">暂无活动记录</td></tr>';
+                return;
+            }
+            
+            activities.forEach(activity => {
+                const row = document.createElement('tr');
+                row.innerHTML = `
+                    <td>${activity.time}</td>
+                    <td>${activity.action}</td>
+                    <td>${activity.container}</td>
+                    <td>${activity.status}</td>
+                `;
+                tbody.appendChild(row);
+            });
+        }
+
+        // 加载用户统计数据
+        async function loadUserStats() {
+            try {
+                const response = await fetch('/api/user-info');
+                if (!response.ok) {
+                    throw new Error('获取用户信息失败');
+                }
+                const data = await response.json();
+                
+                // 更新用户统计数据
+                document.getElementById('loginCount').textContent = data.loginCount || '0';
+                document.getElementById('lastLogin').textContent = data.lastLogin || '未知';
+                document.getElementById('accountAge').textContent = data.accountAge || '0';
+                
+                // 更新欢迎信息
+                document.getElementById('welcomeUsername').textContent = data.username || '管理员';
+                document.getElementById('currentUsername').textContent = data.username || '管理员';
+            } catch (error) {
+                console.error('加载用户统计数据失败:', error);
+            }
+        }
+        
+        // 安全设置保存函数
+        function saveSecuritySettings() {
+            console.log("保存安全设置");
+            const loginNotification = document.getElementById('loginNotification').value;
+            alert('安全设置已保存');
+            // 这里可以添加实际的API调用来保存设置
+        }
+
+        document.addEventListener('DOMContentLoaded', function() {
+            const sidebarItems = document.querySelectorAll('.sidebar li');
+            const contentSections = document.querySelectorAll('.content-section');
+            const testDomainInput = document.getElementById('testDomain');
+            const domainSelect = document.getElementById('domainSelect');
+            
+            // 加载系统真实数据
+            refreshSystemStatus();
+            // 加载用户统计数据
+            loadUserStats();
+
+            // 当选择预定义域名时,更新输入框
+            domainSelect.addEventListener('change', function() {
+                if (this.value) {
+                    testDomainInput.value = this.value;
+                }
+            });
+
+            // 修复: 允许手动输入域名
+            testDomainInput.removeAttribute('readonly');
+            testDomainInput.addEventListener('input', function() {
+                if (this.value) {
+                    domainSelect.value = '';
+                }
+            });
+
+            // 覆盖默认的 alert 和 confirm
+            const originalAlert = window.alert;
+            window.alert = function(message) {
+                showAlert(message, message.toLowerCase().includes('失败') || message.toLowerCase().includes('错误') ? 'error' : 'success');
+            };
+
+            const originalConfirm = window.confirm;
+            window.confirm = function(message) {
+                return new Promise((resolve) => {
+                    showConfirm(message, () => resolve(true));
+                });
+            };
+        });
+
+        // 修复: 在DOM加载完成时添加额外的事件监听器
+        document.addEventListener('DOMContentLoaded', function() {
+            // 控制面板刷新按钮
+            document.querySelector('.welcome-action').addEventListener('click', function() {
+                refreshSystemStatus();
+            });
+            
+            // 磁盘空间详情按钮
+            const diskSpaceAction = document.querySelector('.dashboard-card:nth-child(4) .card-action');
+            if (diskSpaceAction) {
+                diskSpaceAction.addEventListener('click', checkDiskSpace);
+            }
+            
+            // 绑定个人中心和退出登录按钮事件
+            const userCenterBtn = document.querySelector('.user-action-btn:not(.logout)');
+            if (userCenterBtn) {
+                userCenterBtn.addEventListener('click', function() {
+                    showSection('user-center');
+                });
+            }
+            
+            const logoutBtn = document.querySelector('.user-action-btn.logout');
+            if (logoutBtn) {
+                logoutBtn.addEventListener('click', logout);
+            }
+            
+            // 用户中心内的退出登录按钮
+            const userCenterLogoutBtn = document.querySelector('.user-center-header .btn.btn-primary');
+            if (userCenterLogoutBtn) {
+                userCenterLogoutBtn.innerHTML = '退出登录';
+                userCenterLogoutBtn.addEventListener('click', logout);
+            }
+            
+            // 用户中心内的保存设置按钮
+            const userCenterSaveBtn = document.querySelector('.user-center-section .btn.btn-primary');
+            if (userCenterSaveBtn) {
+                userCenterSaveBtn.innerHTML = '保存设置';
+                userCenterSaveBtn.addEventListener('click', saveSecuritySettings);
+            }
+        });
+    </script>
+</body>
+</html>

文件差异内容过多而无法显示
+ 173 - 805
hubcmdui/web/index.html


+ 2008 - 0
hubcmdui/web/style.css

@@ -0,0 +1,2008 @@
+/* 现代化UI样式 - 面向C端用户 */
+:root {
+    /* 主色调 */
+    --primary-color: #3D7CF4;
+    --primary-light: #5D95FD;
+    --primary-dark: #2F62C9;
+    
+    /* 辅助色 */
+    --secondary-color: #FF6B6B;
+    --secondary-light: #FF8E8E;
+    --secondary-dark: #DA5151;
+    
+    /* 中性色 */
+    --background-color: #F7F9FC;
+    --container-bg: #FFFFFF;
+    --card-bg: #FFFFFF;
+    
+    /* 文字颜色 */
+    --text-primary: #2A3749;
+    --text-secondary: #5A6A80;
+    --text-muted: #8896AB;
+    
+    /* 边框和分隔线 */
+    --border-color: #E2E8F0;
+    --border-light: #EDF1F7;
+    
+    /* 状态颜色 */
+    --success-color: #32D583;
+    --warning-color: #FFB547;
+    --danger-color: #FF5252;
+    --info-color: #4AADD4;
+    
+    /* 阴影 */
+    --shadow-sm: 0 2px 4px rgba(11, 31, 77, 0.04);
+    --shadow-md: 0 4px 12px rgba(11, 31, 77, 0.08);
+    --shadow-lg: 0 8px 24px rgba(11, 31, 77, 0.12);
+    
+    /* 圆角 */
+    --radius-sm: 4px;
+    --radius-md: 8px;
+    --radius-lg: 16px;
+    
+    /* 动画 */
+    --transition-fast: 0.15s ease;
+    --transition-normal: 0.25s ease;
+    --transition-slow: 0.4s ease;
+    
+    /* 字体 */
+    --font-sans: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
+  }
+  
+  /* 基础样式 */
+  body {
+    font-family: var(--font-sans);
+    line-height: 1.6;
+    margin: 0;
+    padding: 0;
+    background-color: var(--background-color);
+    color: var(--text-primary);
+    min-height: 100vh;
+    display: flex;
+    flex-direction: column;
+    overflow-x: hidden;
+  }
+  
+  /* 头部导航 */
+  .header {
+    background-color: var(--container-bg);
+    box-shadow: var(--shadow-md);
+    position: sticky;
+    top: 0;
+    z-index: 1000;
+    padding: 0;
+    transition: all var(--transition-normal);
+  }
+  
+  .header-content {
+    max-width: 1320px;
+    margin: 0 auto;
+    padding: 0.75rem 1.5rem;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+  
+  .logo {
+    height: 42px;
+    width: auto;
+    transition: transform var(--transition-fast);
+  }
+  
+  .logo:hover {
+    transform: scale(1.05);
+  }
+  
+  .nav-menu {
+    display: flex;
+    gap: 1.2rem;
+    align-items: center;
+  }
+  
+  .nav-menu a {
+    color: var(--text-secondary);
+    text-decoration: none;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    transition: all var(--transition-fast);
+    font-weight: 500;
+    font-size: 0.95rem;
+    letter-spacing: 0.2px;
+  }
+  
+  .nav-menu a:hover {
+    background-color: var(--primary-light);
+    color: white;
+    transform: translateY(-2px);
+  }
+  
+  /* 主容器 */
+  .container {
+    width: 90%;
+    max-width: 1320px;
+    margin: 2rem auto;
+    padding: 0;
+    flex: 1 0 auto;
+    display: flex;
+    flex-direction: column;
+  }
+  
+  .page-title {
+    font-size: 2.2rem;
+    font-weight: 700;
+    color: var(--text-primary);
+    margin-bottom: 1.5rem;
+    text-align: center;
+    line-height: 1.2;
+  }
+  
+  .page-subtitle {
+    font-size: 1.1rem;
+    color: var(--text-secondary);
+    margin-top: -0.5rem;
+    margin-bottom: 2rem;
+    text-align: center;
+    max-width: 700px;
+    margin-left: auto;
+    margin-right: auto;
+  }
+  
+  /* 选项卡 */
+  .tab-container {
+    display: flex;
+    margin-bottom: 2rem;
+    background: var(--container-bg);
+    border-radius: var(--radius-lg);
+    padding: 0.5rem;
+    box-shadow: var(--shadow-sm);
+    justify-content: center;
+    position: relative;
+    z-index: 1;
+  }
+  
+  .tab {
+    padding: 0.8rem 1.8rem;
+    border: none;
+    background: none;
+    color: var(--text-secondary);
+    cursor: pointer;
+    font-weight: 600;
+    position: relative;
+    transition: all var(--transition-normal);
+    border-radius: var(--radius-md);
+    font-size: 1rem;
+    flex: 1;
+    text-align: center;
+    max-width: 180px;
+  }
+  
+  .tab:hover {
+    color: var(--primary-color);
+  }
+  
+  .tab.active {
+    color: var(--primary-color);
+    background-color: rgba(61, 124, 244, 0.08);
+  }
+  
+  /* 内容区域 */
+  .content {
+    display: none;
+    background: var(--container-bg);
+    padding: 2.5rem;
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow-md);
+    flex: 1;
+    width: 100%;
+    box-sizing: border-box;
+    animation: fadeIn 0.3s ease-in-out;
+  }
+  
+  @keyframes fadeIn {
+    from { opacity: 0; transform: translateY(10px); }
+    to { opacity: 1; transform: translateY(0); }
+  }
+  
+  .content.active {
+    display: flex;
+    flex-direction: column;
+  }
+  
+  /* 输入框和按钮 */
+  input[type="text"] {
+    width: 100%;
+    padding: 0.9rem 1.2rem;
+    border: 2px solid var(--border-color);
+    border-radius: var(--radius-md);
+    font-size: 1rem;
+    transition: all var(--transition-fast);
+    background-color: var(--container-bg);
+    color: var(--text-primary);
+    box-shadow: var(--shadow-sm);
+  }
+  
+  input[type="text"]:focus {
+    border-color: var(--primary-color);
+    box-shadow: 0 0 0 3px rgba(61, 124, 244, 0.2);
+    outline: none;
+  }
+  
+  input[type="text"]::placeholder {
+    color: var(--text-muted);
+  }
+  
+  button {
+    background-color: var(--primary-color);
+    color: white;
+    border: none;
+    padding: 0.9rem 1.8rem;
+    border-radius: var(--radius-md);
+    cursor: pointer;
+    font-size: 1rem;
+    font-weight: 600;
+    transition: all var(--transition-fast);
+    box-shadow: var(--shadow-sm);
+  }
+  
+  button:hover {
+    background-color: var(--primary-dark);
+    transform: translateY(-2px);
+    box-shadow: var(--shadow-md);
+  }
+  
+  button:active {
+    transform: translateY(0);
+  }
+  
+  /* 搜索区域 */
+  .search-container {
+    display: flex;
+    gap: 1rem;
+    margin-bottom: 2rem;
+  }
+  
+  .search-container input {
+    flex: 1;
+  }
+  
+  .search-container button {
+    white-space: nowrap;
+  }
+  
+  /* 搜索结果样式 */
+  #searchResults {
+    display: grid;
+    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+    gap: 1.5rem;
+    margin-top: 2rem;
+  }
+  
+  .search-result-item {
+    background-color: var(--card-bg);
+    border-radius: var(--radius-md);
+    border: 1px solid var(--border-light);
+    padding: 1.5rem;
+    transition: all var(--transition-normal);
+    box-shadow: var(--shadow-sm);
+    display: flex;
+    flex-direction: column;
+  }
+  
+  .search-result-item:hover {
+    transform: translateY(-5px);
+    box-shadow: var(--shadow-md);
+    border-color: var(--primary-light);
+  }
+  
+  .search-result-item h3 {
+    font-size: 1.2rem;
+    margin: 0 0 1rem 0;
+    color: var(--text-primary);
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+  }
+  
+  .search-result-item p {
+    color: var(--text-secondary);
+    margin: 0.5rem 0;
+    font-size: 0.95rem;
+  }
+  
+  .official-badge {
+    background-color: var(--success-color);
+    color: white;
+    padding: 0.2rem 0.5rem;
+    border-radius: var(--radius-sm);
+    font-size: 0.75rem;
+    font-weight: 500;
+  }
+  
+  .image-stats {
+    display: flex;
+    gap: 1rem;
+    margin: 1rem 0;
+    color: var(--text-muted);
+    font-size: 0.9rem;
+  }
+  
+  .stars, .pull-count {
+    display: flex;
+    align-items: center;
+    gap: 0.3rem;
+  }
+  
+  .button-group {
+    display: flex;
+    gap: 0.75rem;
+    margin-top: auto;
+    padding-top: 1rem;
+  }
+  
+  .button-group button {
+    flex: 1;
+    font-size: 0.9rem;
+    padding: 0.7rem 1rem;
+  }
+  
+  .view-tags-btn {
+    background-color: var(--background-color);
+    color: var(--primary-color);
+    border: 1px solid var(--primary-color);
+  }
+  
+  .view-tags-btn:hover {
+    background-color: rgba(61, 124, 244, 0.1);
+  }
+  
+  /* 加速命令区 */
+  .input-group {
+    display: flex;
+    gap: 1rem;
+    margin-bottom: 2rem;
+  }
+  
+  .input-group input {
+    flex: 1;
+  }
+  
+  #result {
+    background-color: var(--background-color);
+    padding: 1.5rem;
+    border-radius: var(--radius-lg);
+    margin-top: 2rem;
+  }
+  
+  #result h2 {
+    margin-top: 0;
+    color: var(--text-primary);
+    font-size: 1.5rem;
+    font-weight: 600;
+    margin-bottom: 1.5rem;
+  }
+  
+  .step {
+    background: var(--container-bg);
+    padding: 1.2rem; /* 减小内边距 */
+    border-radius: var(--radius-md);
+    margin-bottom: 1rem; /* 减小步骤之间的间距 */
+    box-shadow: var(--shadow-sm);
+    border: 1px solid var(--border-light);
+    transition: transform var(--transition-normal);
+  }
+  
+  .step:hover {
+    transform: translateY(-2px);
+    box-shadow: var(--shadow-md);
+  }
+  
+  .step h3 {
+    color: var(--primary-color);
+    margin: 0 0 0.5rem 0; /* 减小标题下方间距 */
+    font-size: 1.1rem;
+    font-weight: 600;
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+  }
+  
+  .step h3::before {
+    content: "";
+    display: inline-block;
+    width: 24px;
+    height: 24px;
+    background-color: var(--primary-light);
+    border-radius: 50%;
+    color: white;
+    text-align: center;
+    line-height: 24px;
+    font-size: 0.9rem;
+  }
+  
+  /* 命令终端样式优化 */
+.command-terminal {
+    background: #1F2937;
+    border-radius: var(--radius-md);
+    overflow: visible; /* 修改为visible以避免复制按钮被裁剪 */
+    position: relative;
+    margin-bottom: 0.75rem; /* 减小命令之间的间距 */
+    min-height: fit-content; /* 设置最小高度为内容自适应 */
+}
+
+.command-terminal pre {
+    margin: 0;
+    padding: 0;
+    background: transparent;
+    display: flex; /* 使用弹性布局 */
+    align-items: center; /* 垂直居中 */
+    min-height: 44px; /* 设置最小高度 */
+}
+
+.command-terminal code {
+    display: block;
+    padding: 0.6rem 1rem; /* 减小内边距 */
+    color: #F3F4F6;
+    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
+    font-size: 0.95rem;
+    line-height: 1.4;
+    flex: 1; /* 占据剩余空间 */
+}
+
+/* 文档页面代码块样式 */
+#documentationText .command-terminal pre {
+    max-height: none; /* 移除最大高度限制 */
+    overflow: visible; /* 移除滚动条 */
+}
+
+.terminal-header {
+    background: #111827;
+    padding: 8px 12px;
+    display: flex;
+    align-items: center;
+    gap: 6px;
+}
+
+.terminal-button {
+    width: 12px;
+    height: 12px;
+    border-radius: 50%;
+}
+
+.button-red { background: #FF5F57; }
+.button-yellow { background: #FEBC2E; }
+.button-green { background: #28C840; }
+
+.copy-btn {
+    position: absolute;
+    top: 8px; /* 调整位置在终端标题栏右侧 */
+    right: 8px;
+    padding: 0.35rem 0.7rem;
+    font-size: 0.8rem;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: var(--radius-sm);
+    opacity: 0;
+    transition: opacity var(--transition-fast);
+    z-index: 10; /* 确保按钮始终在顶层 */
+    color: #F3F4F6;
+    border: none;
+}
+
+.command-terminal:hover .copy-btn {
+    opacity: 1;
+}
+
+.copy-btn:hover {
+    background-color: rgba(255, 255, 255, 0.3);
+    transform: translateY(0); /* 覆盖默认的按钮hover效果 */
+}
+
+.copy-success {
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    background: rgba(0, 0, 0, 0.8);
+    color: white;
+    padding: 0.75rem 1.5rem;
+    border-radius: var(--radius-md);
+    z-index: 1000;
+    animation: fadeInOut 1.5s ease-in-out;
+    pointer-events: none;
+}
+
+@keyframes fadeInOut {
+    0% { opacity: 0; }
+    20% { opacity: 1; }
+    80% { opacity: 1; }
+    100% { opacity: 0; }
+}
+
+/* 标签展示区域 - 修复宽度与主容器一致 */
+#imageTagsView {
+    width: 100%;
+    background-color: var(--container-bg);
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow-md);
+    margin: 0;
+    padding: 2rem;
+    transition: all var(--transition-normal);
+}
+
+.tag-header {
+    margin-bottom: 2rem;
+}
+
+.tag-breadcrumb {
+    display: flex;
+    align-items: center;
+    margin-bottom: 1.5rem;
+}
+
+.tag-breadcrumb a {
+    display: inline-flex;
+    align-items: center;
+    color: var(--primary-color);
+    text-decoration: none;
+    font-weight: 500;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    transition: all var(--transition-fast);
+}
+
+.tag-breadcrumb a:hover {
+    background-color: rgba(61, 124, 244, 0.1);
+    color: var (--primary-dark);
+}
+
+.tag-breadcrumb a::before {
+    content: "←";
+    font-size: 1.2rem;
+    margin-right: 0.5rem;
+}
+
+#currentImageTitle {
+    font-size: 1.8rem;
+    margin: 0 0 1rem 0;
+    color: var(--text-primary);
+}
+
+.image-description {
+    color: var(--text-secondary);
+    margin-bottom: 1.5rem;
+    line-height: 1.6;
+    background-color: var(--container-bg);
+    padding: 1rem 1.5rem;
+    border-radius: var(--radius-md);
+    border-left: 4px solid var(--primary-color);
+}
+
+.tag-search-container {
+    display: flex;
+    gap: 1rem;
+    margin-bottom: 2rem;
+    max-width: 600px; /* 限制搜索框宽度 */
+    margin: 0 auto 2rem; /* 居中显示并添加底部间距 */
+}
+
+.tag-search-container input {
+    flex: 1;
+}
+
+.tag-table {
+    width: 100%;
+    border-collapse: separate;
+    border-spacing: 0;
+    border-radius: var(--radius-md);
+    overflow: hidden;
+    box-shadow: var(--shadow-md);
+    margin: 0 auto; /* 居中显示 */
+}
+
+.tag-table th {
+    background-color: var(--primary-color);
+    color: white;
+    text-align: left;
+    padding: 1rem 1.5rem;
+    font-weight: 600;
+}
+
+.tag-table td {
+    padding: 1rem 1.5rem;
+    border-bottom: 1px solid var(--border-light);
+    background-color: var(--container-bg);
+}
+
+.tag-table tr:last-child td {
+    border-bottom: none;
+}
+
+.tag-table tr:hover td {
+    background-color: rgba(61, 124, 244, 0.05);
+}
+
+.tag-table td:first-child {
+    font-weight: 500;
+    color: var(--primary-color);
+    padding-left: 1.5rem; /* 第一列左对齐 */
+}
+
+.tag-table th:last-child,
+.tag-table td:last-child {
+    padding-right: 1.5rem; /* 最后一列右对齐 */
+    text-align: right; /* 操作按钮右对齐 */
+}
+
+/* OS/ARCH垂直显示样式 */
+.tag-os-arch {
+    display: flex;
+    flex-direction: column;
+    gap: 0.5rem;
+    margin: 0.5rem 0;
+}
+
+.tag-os-arch-item {
+    display: inline-flex;
+    align-items: center;
+    padding: 0.4rem 0.8rem;
+    background: var(--background-color);
+    border-radius: var(--radius-sm);
+    font-size: 0.85rem;
+    color: var(--text-secondary);
+    margin-right: 0;
+    margin-bottom: 0.25rem;
+}
+
+.tag-os-arch-more {
+    color: var(--primary-color);
+    cursor: pointer;
+    font-size: 0.85rem;
+    padding: 0.4rem 0;
+    text-decoration: underline;
+}
+
+.tag-os-arch-all {
+    display: none;
+    margin-top: 0.5rem;
+    padding-left: 0.5rem;
+    border-left: 2px solid var(--border-color);
+}
+
+.tag-os-arch-all.show {
+    display: block;
+}
+
+/* 分页控件 */
+.pagination-container {
+    display: flex;
+    justify-content: center;
+    gap: 1rem;
+    margin-top: 2rem;
+}
+
+.pagination-container button {
+    padding: 0.5rem 1.2rem;
+    border-radius: var(--radius-md);
+}
+
+.pagination-container button:disabled {
+    background-color: var(--text-muted);
+    cursor: not-allowed;
+    transform: none;
+    box-shadow: none;
+}
+
+.pagination-container span {
+    display: flex;
+    align-items: center;
+    color: var(--text-secondary);
+    font-weight: 500;
+}
+
+/* 文档区样式 */
+#documentationContent.active {
+    display: grid;
+    grid-template-columns: 280px 1fr;
+    gap: 2.5rem;
+}
+
+#documentList {
+    border-right: 1px solid var(--border-light);
+    padding-right: 1.5rem;
+}
+
+#documentList h2 {
+    font-size: 1.3rem;
+    margin: 0 0 1.5rem 0;
+    padding-bottom: 0.8rem;
+    border-bottom: 2px solid var(--border-light);
+    color: var(--text-primary);
+}
+
+#documentList ul {
+    list-style: none;
+    padding: 0;
+    margin: 0;
+}
+
+#documentList li {
+    margin-bottom: 0.8rem;
+}
+
+#documentList a {
+    display: block;
+    padding: 0.8rem 1.2rem;
+    color: var(--text-secondary);
+    text-decoration: none;
+    border-radius: var (--radius-md);
+    transition: all var(--transition-fast);
+    font-weight: 500;
+}
+
+#documentList a:hover {
+    background-color: rgba(61, 124, 244, 0.08);
+    color: var(--primary-color);
+}
+
+#documentList a.active {
+    background-color: var(--primary-color);
+    color: white;
+}
+
+#documentationText {
+    padding: 0 1rem;
+}
+
+#documentationText h2 {
+    font-size: 1.8rem;
+    margin: 0 0 1.5rem 0;
+    color: var(--text-primary);
+}
+
+#documentationText p {
+    line-height: 1.7;
+    color: var(--text-secondary);
+    margin-bottom: 1.2rem;
+}
+
+#documentationText ul, #documentationText ol {
+    color: var(--text-secondary);
+    line-height: 1.7;
+    padding-left: 1.5rem;
+    margin-bottom: 1.5rem;
+}
+
+#documentationText li {
+    margin-bottom: 0.5rem;
+}
+
+#documentationText pre {
+    margin: 1.5rem 0;
+}
+
+/* 加载中和消息提示 */
+.loading-indicator {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 3rem 0;
+    color: var(--text-secondary);
+    font-size: 1.1rem;
+}
+
+.loading-indicator::after {
+    content: "...";
+    animation: loading-dots 1.5s infinite;
+}
+
+@keyframes loading-dots {
+    0%, 20% { content: "."; }
+    40% { content: ".."; }
+    60%, 100% { content: "..."; }
+}
+
+.message-container {
+    padding: 3rem 0;
+    text-align: center;
+    color: var(--text-secondary);
+    font-size: 1.1rem;
+}
+
+/* TAG搜索无结果提示 */
+.no-filter-results {
+    margin: 1rem 0;
+    border-radius: var(--radius-md);
+    border: 1px dashed var (--border-color);
+    color: var(--text-muted);
+    text-align: center;
+    padding: 2rem;
+}
+
+/* 复制按钮位置调整 */
+.copy-btn {
+    position: absolute;
+    top: 8px; /* 调整位置在终端标题栏右侧 */
+    right: 8px;
+    padding: 0.35rem 0.7rem;
+    font-size: 0.8rem;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: var(--radius-sm);
+    opacity: 0;
+    transition: opacity var(--transition-fast);
+    z-index: 10; /* 确保按钮始终在顶层 */
+    color: #F3F4F6;
+    border: none;
+}
+
+.command-terminal:hover .copy-btn {
+    opacity: 1;
+}
+
+.copy-btn:hover {
+    background-color: rgba(255, 255, 255, 0.3);
+    transform: translateY(0); /* 覆盖默认的按钮hover效果 */
+}
+
+.copy-success {
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    background: rgba(0, 0, 0, 0.8);
+    color: white;
+    padding: 0.75rem 1.5rem;
+    border-radius: var(--radius-md);
+    z-index: 1000;
+    animation: fadeInOut 1.5s ease-in-out;
+    pointer-events: none;
+}
+
+@keyframes fadeInOut {
+    0% { opacity: 0; }
+    20% { opacity: 1; }
+    80% { opacity: 1; }
+    100% { opacity: 0; }
+}
+
+/* 标签展示区域 - 修复宽度与主容器一致 */
+#imageTagsView {
+    width: 100%;
+    max-width: 100%; /* 确保不超出父容器 */
+    box-sizing: border-box; /* 确保padding和border包含在宽度内 */
+    background-color: var(--container-bg);
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow-md);
+    margin: 0;
+    padding: 1.5rem; /* 略微减小内边距 */
+    transition: all var(--transition-normal);
+    overflow-x: hidden; /* 防止水平溢出 */
+}
+
+.tag-header {
+    margin-bottom: 2rem;
+    padding-bottom: 1.5rem;
+    border-bottom: 1px solid var(--border-light);
+}
+
+.tag-breadcrumb {
+    display: flex;
+    align-items: center;
+    margin-bottom: 1.5rem;
+}
+
+.tag-breadcrumb a {
+    display: inline-flex;
+    align-items: center;
+    color: var(--primary-color);
+    text-decoration: none;
+    font-weight: 500;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    transition: all var(--transition-fast);
+}
+
+.tag-breadcrumb a:hover {
+    background-color: rgba(61, 124, 244, 0.1);
+    color: var(--primary-dark);
+}
+
+.tag-breadcrumb a::before {
+    content: "←";
+    font-size: 1.2rem;
+    margin-right: 0.5rem;
+}
+
+#currentImageTitle {
+    font-size: 2rem;
+    margin: 0 0 1rem 0;
+    color: var(--text-primary);
+    font-weight: 700;
+}
+
+.image-description {
+    color: var(--text-secondary);
+    margin-bottom: 1.5rem;
+    line-height: 1.6;
+    background-color: var(--background-color);
+    padding: 1rem 1.5rem;
+    border-radius: var(--radius-md);
+    border-left: 4px solid var(--primary-color);
+    font-size: 1rem;
+}
+
+.image-meta {
+    display: flex;
+    align-items: center;
+    gap: 2rem;
+    margin-top: 1.5rem;
+}
+
+.image-meta span {
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+    font-size: 1rem;
+    color: var(--text-secondary);
+}
+
+.image-meta i {
+    color: var(--primary-color);
+}
+
+/* 标签搜索栏优化 */
+.tag-search-container {
+    display: flex;
+    gap: 1rem;
+    margin-bottom: 2rem;
+    padding: 1.5rem;
+    background-color: var(--background-color);
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow-sm);
+}
+
+.tag-search-container input {
+    flex: 1;
+    padding: 0.75rem 1rem;
+    border: 1px solid var(--border-color);
+    border-radius: var(--radius-md);
+    background-color: var(--container-bg);
+}
+
+.tag-search-container input:focus {
+    border-color: var(--primary-color);
+    box-shadow: 0 0 0 3px rgba(61, 124, 244, 0.2);
+}
+
+.tag-search-container .search-btn {
+    padding: 0.75rem 1.2rem;
+    white-space: nowrap;
+}
+
+/* 标签统计信息 */
+.tag-search-stats {
+    margin-bottom: 1rem;
+    padding: 0.75rem 1rem;
+    background-color: var(--background-color);
+    border-radius: var(--radius-md);
+    color: var(--text-secondary);
+}
+
+.tag-search-stats p {
+    margin: 0;
+    font-size: 0.95rem;
+}
+
+.tag-search-stats strong {
+    color: var(--primary-color);
+    font-weight: 600;
+}
+
+/* 标签表格优化 */
+.tag-table-container {
+    width: 100%;
+    overflow-x: auto; /* 在小屏幕上允许水平滚动 */
+    margin-bottom: 1rem;
+}
+
+.tag-table {
+    min-width: 100%;
+    width: 100%;
+    border-collapse: separate;
+    border-spacing: 0;
+    border-radius: var(--radius-md);
+    overflow: hidden;
+    box-shadow: var(--shadow-md);
+    margin: 0 auto;
+}
+
+.tag-table th {
+    background-color: var (--primary-color);
+    color: white;
+    text-align: left;
+    padding: 1rem 1.5rem;
+    font-weight: 600;
+}
+
+.tag-table td {
+    padding: 1rem 1.5rem;
+    border-bottom: 1px solid var(--border-light);
+    background-color: var(--container-bg);
+    vertical-align: top;
+}
+
+.tag-table tr:last-child td {
+    border-bottom: none;
+}
+
+.tag-table tr:hover td {
+    background-color: rgba(61, 124, 244, 0.05);
+}
+
+.tag-table td:first-child {
+    font-weight: 600;
+    color: var(--text-primary);
+    font-size: 1rem;
+}
+
+.tag-table th:last-child,
+.tag-table td:last-child {
+    padding-right: 1.5rem;
+    text-align: right;
+}
+
+/* 优化OS/ARCH显示样式 */
+.tag-os-arch {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 0.3rem; /* 减小间距 */
+    margin: 0;
+}
+
+.tag-os-arch-item {
+    display: inline-flex;
+    align-items: center;
+    padding: 0.3rem 0.6rem; /* 减小padding */
+    background: var(--background-color);
+    border-radius: var(--radius-sm);
+    font-size: 0.8rem; /* 减小字体 */
+    color: var(--text-secondary);
+    margin-bottom: 0.25rem;
+    border: 1px solid var(--border-light);
+    white-space: nowrap; /* 防止内容换行 */
+}
+
+.tag-os-arch-more {
+    color: var(--primary-color);
+    cursor: pointer;
+    font-size: 0.9rem;
+    padding: 0.4rem 0;
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+    margin-top: 0.5rem;
+    font-weight: 500;
+}
+
+.tag-os-arch-more i {
+    font-size: 1rem;
+}
+
+.tag-os-arch-all {
+    display: none;
+    margin-top: 0.5rem;
+    width: 100%;
+    padding-top: 0.5rem;
+    border-top: 1px dashed var(--border-light);
+    transition: all var(--transition-normal);
+}
+
+.tag-os-arch-all.show {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 0.5rem;
+}
+
+/* 加载容器样式 */
+.loading-container {
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 3rem 0;
+}
+
+/* 优化分页控件样式 */
+.pagination-container {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    gap: 1.5rem;
+    margin-top: 2rem;
+    padding: 1rem 0;
+    border-top: 1px solid var(--border-light);
+}
+
+.pagination-container button {
+    padding: 0.6rem 1.2rem;
+    border-radius: var(--radius-md);
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+    font-weight: 500;
+}
+
+.pagination-container button:disabled {
+    background-color: var(--text-muted);
+    cursor: not-allowed;
+    transform: none;
+    box-shadow: none;
+    opacity: 0.7;
+}
+
+.pagination-container span {
+    display: flex;
+    align-items: center;
+    color: var(--text-secondary);
+    font-weight: 500;
+    font-size: 1rem;
+}
+
+/* 优化按钮样式 */
+.primary-btn {
+    background-color: var(--primary-color);
+    color: white;
+    border: none;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    font-size: 0.9rem;
+    font-weight: 500;
+    cursor: pointer;
+    transition: all var(--transition-fast);
+    display: inline-flex;
+    align-items: center;
+    gap: 0.5rem;
+}
+
+.primary-btn:hover {
+    background-color: var(--primary-dark);
+    transform: translateY(-2px);
+    box-shadow: var(--shadow-sm);
+}
+  
+  /* 页脚 */
+  .footer {
+    background-color: var(--container-bg);
+    padding: 2rem 0;
+    text-align: center;
+    margin-top: 4rem;
+    border-top: 1px solid var(--border-light);
+    position: relative;
+  }
+  
+  .footer p {
+    color: var(--text-secondary);
+    font-size: 0.95rem;
+    margin: 0;
+  }
+  
+  .footer a {
+    color: var(--primary-color);
+    text-decoration: none;
+    font-weight: 500;
+    position: relative;
+  }
+  
+  .footer a::after {
+    content: '';
+    position: absolute;
+    bottom: -2px;
+    left: 0;
+    width: 0;
+    height: 1px;
+    background-color: var(--primary-color);
+    transition: width 0.3s ease;
+  }
+  
+  .footer a:hover::after {
+    width: 100%;
+  }
+  
+  .copyright-text {
+    font-weight: 600;
+    color: var(--primary-color);
+  }
+  
+  /* 响应式设计 */
+  @media (max-width: 1200px) {
+    .container {
+      width: 95%;
+    }
+    .page-title {
+      font-size: 2rem;
+    }
+    /* 优化标签页面在中等屏幕上的显示 */
+    .tag-table th, .tag-table td {
+        padding: 0.75rem 1rem;
+    }
+  }
+  
+  @media (max-width: 992px) {
+    .input-group, .search-container {
+      flex-direction: column;
+    }
+    .page-title {
+      font-size: 2rem;
+    }
+    .content {
+      padding: 2rem;
+    }
+    
+    #searchResults {
+      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
+    }
+    #documentationContent.active {
+      grid-template-columns: 1fr;
+    }
+    #documentList {
+      border-right: none;
+      padding-right: 0;
+      padding-bottom: 1.5rem;
+      margin-bottom: 1.5rem;
+    }
+    /* 优化标签页面在平板上的显示 */
+    .tag-table th:nth-child(2), 
+    .tag-table td:nth-child(2) {
+        max-width: 150px; /* 限制OS/ARCH列宽度 */
+    }
+  }
+  
+  @media (max-width: 768px) {
+    .tab-container {
+      flex-wrap: wrap;
+    }
+    .tab {
+      max-width: none;
+      flex: 0 0 100%;
+    }
+    .header-content {
+      flex-direction: column;
+      padding: 1rem;
+    }
+    .nav-menu {
+      width: 100%;
+      margin-top: 1rem;
+      justify-content: center;
+    }
+    .content {
+      padding: 1.5rem;
+    }
+    .search-result-item {
+      padding: 1.2rem;
+    }
+    /* 调整标签视图在移动设备上的显示 */
+    #imageTagsView {
+        padding: 1rem;
+    }
+    
+    .tag-header {
+        margin-bottom: 1rem;
+    }
+    
+    .tag-table th:nth-child(4), 
+    .tag-table td:nth-child(4),
+    .tag-table th:nth-child(3), 
+    .tag-table td:nth-child(3) {
+        display: none; /* 在小屏幕上隐藏日期和大小列 */
+    }
+  }
+  
+  @media (max-width: 576px) {
+    .page-title {
+      font-size: 1.8rem;
+    }
+    #searchResults {
+      grid-template-columns: 1fr;
+    }
+    .tag-table th, .tag-table td {
+      padding: 0.8rem;
+    }
+  }
+  
+  /* 新增: 特性卡片样式 */
+  .features {
+    display: grid;
+    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+    gap: 2rem;
+    margin-top: 2rem;
+    transition: all var(--transition-normal);
+  }
+  
+  .feature-card {
+    background: var(--container-bg);
+    padding: 2rem;
+    border-radius: var(--radius-lg);
+    text-align: center;
+    transition: all var(--transition-normal);
+    border: 1px solid var(--border-light);
+  }
+  
+  .feature-card:hover {
+    transform: translateY(-5px);
+    box-shadow: var(--shadow-lg);
+  }
+  
+  .feature-card i {
+    font-size: 2.5rem;
+    color: var(--primary-color);
+    margin-bottom: 1.5rem;
+  }
+  
+  .feature-card h3 {
+    color: var(--text-primary);
+    margin-bottom: 1rem;
+  }
+  
+  .feature-card p {
+    color: var(--text-secondary);
+    font-size: 0.95rem;
+  }
+  
+  /* 搜索结果项样式优化 */
+  .search-result-item {
+    background: var(--card-bg);
+    border-radius: var(--radius-lg);
+    border: 1px solid var(--border-light);
+    padding: 1.5rem;
+    transition: all var(--transition-normal);
+    box-shadow: var(--shadow-sm);
+  }
+  
+  .search-result-item:hover {
+    transform: translateY(-4px);
+    box-shadow: var(--shadow-lg);
+    border-color: var(--primary-light);
+  }
+  
+  .title-badge {
+    display: flex;
+    align-items: center;
+    gap: 0.75rem;
+  }
+  
+  .result-stats {
+    display: flex;
+    gap: 1rem;
+    color: var(--text-muted);
+    font-size: 0.9rem;
+  }
+  
+  .stats {
+    display: flex;
+    align-items: center;
+    gap: 0.4rem;
+  }
+  
+  .result-description {
+    margin: 1rem 0;
+    color: var(--text-secondary);
+    line-height: 1.6;
+  }
+  
+  .result-actions {
+    display: flex;
+    gap: 1rem;
+    margin-top: 1.5rem;
+  }
+  
+  .action-btn {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 0.5rem;
+    padding: 0.8rem;
+    border-radius: var(--radius-md);
+    font-weight: 600;
+    transition: all var(--transition-fast);
+  }
+  
+  .action-btn.primary {
+    background: var (--primary-color);
+    color: white;
+  }
+  
+  .action-btn.secondary {
+    background: var(--background-color);
+    color: var(--primary-color);
+    border: 1px solid var(--primary-color);
+  }
+  
+  .action-btn:hover {
+    transform: translateY(-2px);
+    box-shadow: var(--shadow-md);
+  }
+  
+  .action-btn.secondary:hover {
+    background-color: rgba(61, 124, 244, 0.1);
+    color: var(--primary-color);
+  }
+  
+  /* 通知提示样式 */
+  .notification-container {
+    position: fixed;
+    top: 20px;
+    right: 20px;
+    z-index: 1000;
+    transition: all 0.3s ease;
+  }
+  
+  .notification {
+    background: white;
+    border-radius: var(--radius-md);
+    padding: 1rem 1.5rem;
+    margin-bottom: 10px;
+    box-shadow: var(--shadow-lg);
+    display: flex;
+    align-items: center;
+    gap: 0.75rem;
+    animation: slideIn 0.3s ease-out;
+  }
+  
+  .notification.success {
+    border-left: 4px solid var(--success-color);
+  }
+  
+  .notification.error {
+    border-left: 4px solid var(--danger-color);
+  }
+  
+  @keyframes slideIn {
+    from {
+        transform: translateX(100%);
+        opacity: 0;
+    }
+    to {
+        transform: translateX(0);
+        opacity: 1;
+    }
+  }
+  
+  /* 加载动画样式 */
+  .loading-overlay {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background: rgba(255, 255, 255, 0.9);
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    z-index: 1000;
+    opacity: 0;
+    visibility: hidden;
+    transition: all 0.3s ease;
+  }
+  
+  .loading-overlay.active {
+    opacity: 1;
+    visibility: visible;
+  }
+  
+  .loading-spinner {
+    width: 40px;
+    height: 40px;
+    border: 3px solid var(--border-light);
+    border-top-color: var(--primary-color);
+    border-radius: 50%;
+    animation: spin 1s linear infinite;
+  }
+  
+  @keyframes spin {
+    to {
+        transform: rotate(360deg);
+    }
+  }
+  
+  /* 快速指南样式 */
+  .quick-guide {
+    background: #f8f9fa;
+    padding: 1.5rem;
+    border-radius: 8px;
+    margin: 2rem 0;
+    border: 1px solid var(--border-color);
+  }
+  
+  /* TAG页面样式优化 */
+  .image-meta-info {
+    margin: 1.5rem 0;
+    padding: 1rem;
+    background: var(--background-color);
+    border-radius: var(--radius-lg);
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+  
+  .image-stats-large {
+    display: flex;
+    align-items: center;
+    gap: 2rem;
+  }
+  
+  .stat-item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    gap: 0.5rem;
+  }
+  
+  .stat-value {
+    font-size: 1.5rem;
+    font-weight: 600;
+    color: var(--primary-color);
+  }
+  
+  .stat-label {
+    font-size: 0.9rem;
+    color: var(--text-secondary);
+  }
+  
+  .stat-divider {
+    width: 1px;
+    height: 40px;
+    background: var(--border-light);
+  }
+  
+  .official-badge-large {
+    background: var(--success-color);
+    color: white;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    font-weight: 500;
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+  }
+  
+  .image-description-card {
+    background: var(--background-color);
+    border-radius: var(--radius-lg);
+    padding: 1.5rem;
+    margin: 1.5rem 0;
+    border-left: 4px solid var(--primary-color);
+  }
+  
+  .image-description-card h3 {
+    color: var(--text-primary);
+    margin-bottom: 1rem;
+    font-size: 1.1rem;
+  }
+  
+  .image-description-card p {
+    color: var(--text-secondary);
+    line-height: 1.6;
+    margin: 0;
+  }
+  
+  .tag-search-container {
+    background: var(--container-bg);
+    padding: 1rem;
+    border-radius: var(--radius-lg);
+    box-shadow: var(--shadow-sm);
+    margin: 1.5rem 0;
+  }
+  
+  /* 标签表格样式优化 */
+  .tag-table {
+    background: var(--container-bg);
+    margin-top: 1.5rem;
+    border: 1px solid var(--border-light);
+    box-shadow: var(--shadow-sm);
+  }
+  
+  .tag-table th {
+    background: var (--primary-color);
+    color: white;
+    padding: 1rem;
+    font-weight: 600;
+    text-align: left;
+  }
+  
+  .tag-table td {
+    padding: 1rem;
+    border-bottom: 1px solid var(--border-light);
+    background-color: var(--container-bg);
+  }
+  
+  .tag-table tr:hover td {
+    background: rgba(61, 124, 244, 0.05);
+  }
+  
+  .tag-table button {
+    background: var(--primary-color);
+    color: white;
+    padding: 0.5rem 1rem;
+    border-radius: var(--radius-md);
+    border: none;
+    cursor: pointer;
+    transition: all 0.2s;
+  }
+  
+  .tag-table button:hover {
+    background: var(--primary-dark);
+    transform: translateY(-2px);
+  }
+  
+  /* 搜索结果容器样式 */
+  #searchResultsContainer {
+    width: 100%;
+    transition: all var(--transition-normal);
+  }
+  
+  /* 搜索结果列表样式 */
+  #searchResultsList {
+    width: 100%;
+    transition: all var(--transition-normal);
+  }
+  
+  .no-filter-results {
+    margin: 1rem 0;
+    border-radius: var(--radius-md);
+    border: 1px dashed var(--border-color);
+    color: var(--text-muted);
+    text-align: center;
+    padding: 2rem;
+    transition: all var(--transition-normal);
+  }
+  
+  /* 提示消息样式 */
+  .toast-notification {
+    position: fixed;
+    top: 20px;
+    left: 50%;
+    transform: translateX(-50%);
+    background-color: var(--container-bg);
+    color: var(--text-primary);
+    padding: 1rem 2rem;
+    border-radius: var(--radius-md);
+    box-shadow: var(--shadow-lg);
+    z-index: 1100;
+    animation: fadeIn 0.3s ease-in;
+    text-align: center;
+    max-width: 80%;
+  }
+  
+  .toast-notification.error {
+    border-left: 4px solid var(--danger-color);
+  }
+  
+  .toast-notification.info {
+    border-left: 4px solid var(--info-color);
+  }
+  
+  .toast-notification.fade-out {
+    opacity: 0;
+    transition: opacity 0.3s ease-out;
+  }
+
+/* 标签排序容器样式 */
+.tag-sort-container {
+  display: flex;
+  align-items: center;
+  gap: 1rem;
+  margin-bottom: 1rem;
+  padding: 0.75rem 1rem;
+  background-color: var(--background-color);
+  border-radius: var(--radius-md);
+}
+
+.tag-sort-container label {
+  font-weight: 500;
+  color: var(--text-secondary);
+}
+
+.tag-sort-container select {
+  padding: 0.5rem 1rem;
+  border: 1px solid var(--border-color);
+  border-radius: var(--radius-md);
+  background-color: var(--container-bg);
+  color: var(--text-primary);
+  font-size: 0.9rem;
+  cursor: pointer;
+  transition: all var(--transition-fast);
+}
+
+.tag-sort-container select:focus {
+  border-color: var(--primary-color);
+  outline: none;
+  box-shadow: 0 0 0 3px rgba(61, 124, 244, 0.2);
+}
+
+/* 增强标签列表用户体验 */
+.tag-table {
+  table-layout: fixed; /* 固定表格布局以提高渲染性能 */
+  width: 100%;
+}
+
+.tag-table td {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: normal; /* 允许文本换行 */
+}
+
+/* 优化分页样式 */
+.pagination-container {
+  margin-top: 2rem;
+  padding-top: 1rem;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  border-top: 1px solid var(--border-light);
+}
+
+.pagination-container .pagination-info {
+  font-size: 0.9rem;
+  color: var(--text-secondary);
+}
+
+.pagination-controls {
+  display: flex;
+  gap: 0.75rem;
+}
+
+.pagination-container button {
+  padding: 0.5rem 1rem;
+  font-size: 0.9rem;
+}
+
+/* 优化加载指示器 */
+.loading-indicator {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 3rem;
+  color: var(--text-secondary);
+  font-size: 1.1rem;
+}
+
+/* 标签动作区域 */
+.tag-actions {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 2rem;
+  gap: 1.5rem;
+}
+
+/* 修改标签搜索容器样式以适应新布局 */
+.tag-search-container {
+  display: flex;
+  gap: 1rem;
+  padding: 1rem;
+  background-color: var(--background-color);
+  border-radius: var(--radius-lg);
+  box-shadow: var(--shadow-sm);
+  flex: 1;
+  margin: 0; /* 覆盖之前的margin设置 */
+}
+
+/* 加载全部标签按钮 */
+.load-all-btn {
+  white-space: nowrap;
+  display: flex;
+  align-items: center;
+  gap: 0.5rem;
+  padding: 0.75rem 1.2rem;
+  background-color: var(--warning-color);
+  color: white;
+  font-weight: 500;
+  transition: all var(--transition-fast);
+}
+
+.load-all-btn:hover {
+  background-color: var(--secondary-color);
+  transform: translateY(-2px);
+}
+
+.load-all-btn:disabled {
+  background-color: var(--text-muted);
+  cursor: not-allowed;
+  transform: none;
+}
+
+/* 旋转加载图标动画 */
+@keyframes spin {
+  0% { transform: rotate(0deg); }
+  100% { transform: rotate(360deg); }
+}
+
+.fa-spin {
+  animation: spin 1s linear infinite;
+}
+
+/* 提示消息增强样式 */
+.toast-notification {
+  position: fixed;
+  top: 20px;
+  left: 50%;
+  transform: translateX(-50%);
+  background-color: var(--container-bg);
+  color: var(--text-primary);
+  padding: 1rem 2rem;
+  border-radius: var(--radius-md);
+  box-shadow: var(--shadow-lg);
+  z-index: 1100;
+  animation: fadeIn 0.3s ease-in;
+  text-align: center;
+  max-width: 90%;
+  display: flex;
+  align-items: center;
+  gap: 0.75rem;
+}
+
+.toast-notification i {
+  font-size: 1.2rem;
+}
+
+.toast-notification.error {
+  border-left: 4px solid var(--danger-color);
+}
+
+.toast-notification.error i {
+  color: var(--danger-color);
+}
+
+.toast-notification.info {
+  border-left: 4px solid var(--info-color);
+}
+
+.toast-notification.info i {
+  color: var(--info-color);
+}
+
+/* 优化标签表格性能 */
+.tag-table {
+  border-collapse: separate;
+  border-spacing: 0;
+  width: 100%;
+}
+
+/* 响应式调整 */
+@media (max-width: 768px) {
+  .tag-actions {
+    flex-direction: column;
+  }
+  
+  .tag-search-container {
+    width: 100%;
+  }
+  
+  .load-all-btn {
+    width: 100%;
+    justify-content: center;
+  }
+}
+
+/* 标签数量警告样式 */
+.tag-count-warning {
+  margin: 1rem 0 2rem;
+  padding: 1rem 1.5rem;
+  background-color: rgba(255, 87, 87, 0.1);
+  border-left: 4px solid var(--danger-color);
+  border-radius: var(--radius-md);
+  display: flex;
+  align-items: center;
+  gap: 1rem;
+}
+
+.tag-count-warning.moderate {
+  background-color: rgba(255, 181, 71, 0.1);
+  border-left: 4px solid var(--warning-color);
+}
+
+.tag-count-warning i {
+  font-size: 1.5rem;
+  color: var(--danger-color);
+}
+
+.tag-count-warning.moderate i {
+  color: var(--warning-color);
+}
+
+.tag-count-warning p {
+  margin: 0;
+  color: var(--text-primary);
+  font-size: 0.95rem;
+  line-height: 1.5;
+}
+
+.tag-count-warning strong {
+  font-weight: 600;
+}
+
+/* 改进加载全部标签按钮 */
+.load-all-btn:disabled {
+  background-color: var(--text-muted);
+  cursor: not-allowed;
+  transform: none !important;
+  opacity: 0.7;
+}
+
+.load-all-btn:disabled:hover {
+  background-color: var(--text-muted);
+  box-shadow: none;
+}
+
+/* 更新toast通知样式 */
+.toast-notification {
+  position: fixed;
+  top: 20px;
+  left: 50%;
+  transform: translateX(-50%);
+  background-color: var(--container-bg);
+  color: var(--text-primary);
+  padding: 1rem 2rem;
+  border-radius: var(--radius-md);
+  box-shadow: var(--shadow-lg);
+  z-index: 1100;
+  animation: fadeIn 0.3s ease-in;
+  text-align: center;
+  max-width: 90%;
+  display: flex;
+  align-items: center;
+  gap: 0.75rem;
+}
+
+.toast-notification i {
+  font-size: 1.2rem;
+}
+
+.toast-notification.error {
+  border-left: 4px solid var(--danger-color);
+}
+
+.toast-notification.error i {
+  color: var(--danger-color);
+}
+
+.toast-notification.info {
+  border-left: 4px solid var(--info-color);
+}
+
+.toast-notification.info i {
+  color: var(--info-color);
+}
+
+.toast-notification.fade-out {
+  opacity: 0;
+  transition: opacity 0.3s ease-out;
+}
+
+/* 添加标签加载进度样式 */
+.loading-progress {
+    width: 100%;
+    height: 4px;
+    background-color: var(--background-color);
+    border-radius: 2px;
+    margin: 10px 0;
+    overflow: hidden;
+}
+
+.progress-bar {
+    height: 100%;
+    background-color: var(--primary-color);
+    width: 0%;
+    transition: width 0.3s ease;
+}
+
+.loading-indicator {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    padding: 3rem 0;
+    color: var(--text-secondary);
+    font-size: 1.1rem;
+    text-align: center;
+}

部分文件因为文件数量过多而无法显示