/* ==================== CSS 变量 ==================== */ :root { /* 主色 */ --primary: #1976D2; --primary-dark: #0D47A1; --primary-light: #BBDEFB; --accent: #03A9F4; --accent-secondary: #FF6F00; /* 背景 */ --bg-main: #F0F2F5; --bg-card: #FFFFFF; --bg-surface: #FAFAFA; --bg-hover: #F5F7FA; /* 文字 */ --text-primary: #1A237E; --text-body: #202124; --text-secondary: #5F6368; --text-hint: #9AA0A6; --text-white: #FFFFFF; /* 状态 */ --status-connected: #2E7D32; --status-connecting: #F57C00; --status-error: #C62828; --status-disconnected: #757575; /* 语义色 */ --success: #4CAF50; --warning: #FF9800; --error: #F44336; --info: #2196F3; /* 分隔线 */ --divider: #EBEEF0; --border: #E0E0E0; /* 树视图 */ --tree-folder: #1565C0; --tree-file: #5F6368; --tree-bg: #F5F7FA; --tree-selected: #E3F2FD; --tree-target: #FFF3E0; /* 圆角 */ --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; /* 阴影 */ --shadow-sm: 0 1px 3px rgba(0,0,0,0.08); --shadow-md: 0 2px 8px rgba(0,0,0,0.10); --shadow-lg: 0 4px 16px rgba(0,0,0,0.12); /* 过渡 */ --transition: 0.2s ease; } /* ==================== 全局重置 ==================== */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans CJK SC', sans-serif; background: var(--bg-main); color: var(--text-body); line-height: 1.6; min-height: 100vh; } /* ==================== 头部 ==================== */ .header { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); color: var(--text-white); padding: 0; box-shadow: var(--shadow-md); position: sticky; top: 0; z-index: 100; } .header-content { max-width: 960px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; } .header-left { display: flex; align-items: center; gap: 12px; } .header-icon { font-size: 32px; } .header-title { font-size: 22px; font-weight: 700; margin: 0; } .header-subtitle { font-size: 13px; opacity: 0.85; margin: 0; } .header-right { display: flex; align-items: center; gap: 12px; } .status-indicator { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(255,255,255,0.15); border-radius: var(--radius-sm); } .status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; } .status-dot-disconnected { background: var(--status-disconnected); box-shadow: 0 0 0 3px rgba(117,117,117,0.2); } .status-dot-connecting { background: var(--status-connecting); animation: pulse 1.2s infinite; } .status-dot-connected { background: var(--status-connected); box-shadow: 0 0 0 3px rgba(46,125,50,0.2); } .status-dot-error { background: var(--status-error); box-shadow: 0 0 0 3px rgba(198,40,40,0.2); } @keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(245,124,0,0.3); } 50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(245,124,0,0.1); } } .status-text { font-size: 14px; font-weight: 500; } /* ==================== 主内容 ==================== */ .main { max-width: 960px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; } /* ==================== 卡片 ==================== */ .card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: var(--transition); border: 1px solid var(--divider); } .card:hover { box-shadow: var(--shadow-md); } .card-disabled { opacity: 0.55; pointer-events: none; } .card-header { padding: 16px 20px; border-bottom: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; } .card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); } .card-actions { display: flex; gap: 8px; flex-wrap: wrap; } /* ==================== 按钮 ==================== */ .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); white-space: nowrap; font-family: inherit; } .btn:disabled { opacity: 0.45; cursor: not-allowed; } .btn-sm { padding: 6px 12px; font-size: 13px; } .btn-lg { padding: 12px 24px; font-size: 16px; width: 100%; } .btn-primary { background: var(--primary); color: var(--text-white); } .btn-primary:hover:not(:disabled) { background: var(--primary-dark); } .btn-primary-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); } .btn-primary-outline:hover:not(:disabled) { background: var(--primary-light); } .btn-outline { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border); } .btn-outline:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); } .btn-danger { background: var(--error); color: var(--text-white); } .btn-danger:hover:not(:disabled) { background: #D32F2F; } .btn-danger-outline { background: transparent; color: var(--error); border: 1px solid var(--error); } .btn-danger-outline:hover:not(:disabled) { background: #FFEBEE; } /* ==================== 设备列表 ==================== */ .device-list { padding: 12px 20px; } .empty-hint { padding: 24px; text-align: center; color: var(--text-hint); font-size: 14px; } .device-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--divider); margin-bottom: 8px; transition: var(--transition); } .device-card:last-child { margin-bottom: 0; } .device-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); } .device-card-active { border-color: var(--success); background: #E8F5E9; } .device-info { flex: 1; min-width: 0; } .device-name { font-size: 15px; font-weight: 600; color: var(--text-body); margin-bottom: 4px; } .device-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); } .device-sep { color: var(--text-hint); } .device-actions { display: flex; gap: 8px; flex-shrink: 0; } .btn-icon { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: inherit; } .btn-icon:hover { border-color: var(--primary); color: var(--primary); } .btn-connect { background: var(--primary); color: var(--text-white); border-color: var(--primary); } .btn-connect:hover { background: var(--primary-dark); color: var(--text-white); } .btn-danger { color: var(--error); } .btn-danger:hover { border-color: var(--error); color: var(--error); background: #FFEBEE; } /* ==================== 文件树 ==================== */ .tree-status { padding: 8px 20px; border-bottom: 1px solid var(--divider); } .tree-status-text { font-size: 13px; color: var(--text-secondary); } .tree-container { padding: 8px 12px; max-height: 400px; overflow-y: auto; background: var(--tree-bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); } .tree-node { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); user-select: none; } .tree-node:hover { background: var(--bg-hover); } .tree-node-selected { background: var(--tree-selected); } .tree-node-target { background: var(--tree-target); } .tree-icon-folder { font-size: 18px; } .tree-icon-file { font-size: 16px; opacity: 0.7; } .tree-name { font-size: 14px; color: var(--text-body); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tree-target-badge { font-size: 11px; padding: 2px 8px; background: var(--accent-secondary); color: var(--text-white); border-radius: 10px; font-weight: 500; } .tree-children { /* 子节点容器 */ } /* ==================== 文件传输 ==================== */ .transfer-section { padding: 12px 20px; border-bottom: 1px solid var(--divider); } .transfer-section:last-child { border-bottom: none; } .transfer-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; } .file-select-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .file-info { flex: 1; min-width: 0; } .file-name { display: block; font-size: 14px; font-weight: 500; color: var(--text-body); } .file-detail { font-size: 12px; color: var(--text-secondary); } .target-folder-display { padding: 10px 14px; background: var(--bg-surface); border: 1px solid var(--divider); border-radius: var(--radius-sm); font-size: 14px; color: var(--primary); font-weight: 500; } /* 进度条 */ .progress-container { padding: 12px 20px; display: flex; align-items: center; gap: 12px; } .progress-bar { flex: 1; height: 8px; border: none; border-radius: 4px; background: var(--divider); overflow: hidden; } .progress-bar::-webkit-progress-bar { background: var(--divider); border-radius: 4px; } .progress-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width 0.3s; } .progress-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; } .progress-text { font-size: 13px; color: var(--text-secondary); white-space: nowrap; } /* ==================== 传输记录 ==================== */ .history-list { padding: 8px 20px; max-height: 300px; overflow-y: auto; } .history-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--divider); } .history-item:last-child { border-bottom: none; } .history-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 14px; font-weight: 700; flex-shrink: 0; } .history-icon-success { background: #E8F5E9; color: var(--success); } .history-icon-fail { background: #FFEBEE; color: var(--error); } .history-name { font-size: 14px; font-weight: 500; color: var(--text-body); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .history-detail { font-size: 12px; color: var(--text-secondary); } .history-time { font-size: 11px; color: var(--text-hint); white-space: nowrap; } /* ==================== 日志面板 ==================== */ .log-panel { overflow: hidden; transition: var(--transition); } .log-panel.collapsed { max-height: 0; } .log-container { padding: 8px 20px; max-height: 240px; overflow-y: auto; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 12px; } .log-line { padding: 3px 0; border-bottom: 1px solid rgba(0,0,0,0.03); word-break: break-all; } .log-info { color: var(--text-secondary); } .log-success { color: var(--success); } .log-warning { color: var(--warning); } .log-error { color: var(--error); } .log-send { color: var(--primary); } .log-receive { color: var(--accent); } /* ==================== 弹窗 ==================== */ .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 16px; } .overlay-visible { display: flex; } .modal { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; } .modal-header { padding: 16px 20px; border-bottom: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center; } .modal-title { font-size: 18px; font-weight: 600; color: var(--text-primary); } .modal-close { width: 32px; height: 32px; border: none; background: var(--bg-surface); border-radius: 50%; font-size: 20px; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); } .modal-close:hover { background: var(--error); color: var(--text-white); } .modal-body { padding: 20px; } .scan-status { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-surface); font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; text-align: center; } .scan-status-active { background: #FFF3E0; color: var(--warning); } .scan-status-success { background: #E8F5E9; color: var(--success); } .scan-status-error { background: #FFEBEE; color: var(--error); } .form-group { margin-bottom: 16px; } .form-row { display: flex; gap: 12px; } .form-row .form-group { flex: 1; } .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-body); margin-bottom: 6px; } .form-input, .form-select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-body); background: var(--bg-card); transition: var(--transition); font-family: inherit; } .form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,118,210,0.1); } .form-hint { font-size: 12px; color: var(--text-hint); margin-top: 4px; } .modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; } /* ==================== Toast ==================== */ .toast-container { position: fixed; top: 80px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; } .toast { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; max-width: 320px; } .toast-info { background: var(--info); color: var(--text-white); } .toast-success { background: var(--success); color: var(--text-white); } .toast-warning { background: var(--warning); color: var(--text-white); } .toast-error { background: var(--error); color: var(--text-white); } .toast-fade { opacity: 0; transform: translateX(20px); transition: all 0.3s; } @keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } } /* ==================== 页脚 ==================== */ .footer { text-align: center; padding: 24px 16px; font-size: 12px; color: var(--text-hint); } /* ==================== 滚动条 ==================== */ ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--text-hint); } /* ==================== 响应式 ==================== */ @media (max-width: 640px) { .header-content { padding: 12px 16px; } .header-title { font-size: 18px; } .header-subtitle { font-size: 12px; } .main { padding: 16px 12px; } .card-header { padding: 12px 16px; } .card-actions { gap: 6px; } .btn-sm { padding: 5px 10px; font-size: 12px; } .form-row { flex-direction: column; } .toast-container { right: 8px; left: 8px; } .toast { max-width: none; } }