* { margin:0; padding:0; box-sizing: border-box; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #080b10; color: #c9d1d9; min-height: 100vh; display: flex; }

/* === 侧边栏 === */
.sidebar { width: 240px; min-width: 240px; background: #161b22; border-right: 1px solid #30363d; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transition: width 0.25s cubic-bezier(.4,0,.2,1), min-width 0.25s cubic-bezier(.4,0,.2,1); }
.sidebar.collapsed { width: 64px; min-width: 64px; }
.sidebar-logo { padding: 18px 16px; border-bottom: 1px solid #30363d; display: flex; align-items: center; gap: 10px; height: 68px; }
.sidebar-logo .logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, #d29922, #a371f7); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; font-weight: 800; flex-shrink: 0; }
.sidebar-logo .logo-text { font-size: 15px; font-weight: 700; color: #e6edf3; white-space: nowrap; overflow: hidden; transition: opacity 0.2s, width 0.25s; }
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; overflow-x: hidden; }
.nav-group-title { font-size: 10px; color: #484f58; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; padding: 0 8px; margin-bottom: 8px; margin-top: 20px; white-space: nowrap; overflow: hidden; transition: opacity 0.2s; }
.sidebar.collapsed .nav-group-title { opacity: 0; height: 0; margin: 0; padding: 0; }
.nav-group-title:first-child { margin-top: 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #8b949e; transition: all 0.15s; margin-bottom: 2px; user-select: none; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.nav-item:hover { background: #21262d; color: #e6edf3; }
.nav-item.active { background: rgba(176,136,20,0.15); color: #d29922; font-weight: 500; }
.nav-item .nav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-item.active .nav-dot { background: #d29922; box-shadow: 0 0 6px rgba(210,153,34,0.4); }
.nav-item .nav-label { transition: opacity 0.2s, width 0.25s; }
.sidebar.collapsed .nav-item .nav-label { opacity: 0; width: 0; display: none; }

/* 侧边栏折叠按钮 */
.sidebar-toggle { padding: 12px; border-top: 1px solid #30363d; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: #484f58; transition: color 0.15s, background 0.15s; user-select: none; }
.sidebar-toggle:hover { color: #8b949e; background: rgba(33,38,45,0.6); }
.sidebar-toggle svg { transition: transform 0.25s; flex-shrink: 0; }
.sidebar-toggle .toggle-text { font-size: 11px; white-space: nowrap; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .toggle-text { display: none; }

.sidebar-footer { padding: 12px; border-top: 1px solid #30363d; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 8px; }
.sidebar-footer .user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #30363d; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #8b949e; font-weight: 600; flex-shrink: 0; }
.sidebar-footer .user-info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; transition: opacity 0.2s, width 0.25s; }
.sidebar.collapsed .user-info { opacity: 0; width: 0; min-width: 0; }
.sidebar-footer .user-name { font-size: 12px; color: #e6edf3; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .user-role { font-size: 10px; color: #484f58; }
.logout-btn { padding: 4px 10px; background: transparent; border: 1px solid rgba(248,81,73,0.3); border-radius: 4px; color: #f85149; font-size: 10px; cursor: pointer; white-space: nowrap; transition: opacity 0.2s, width 0.25s; }
.logout-btn:hover { background: rgba(248,81,73,0.1); }
.sidebar.collapsed .logout-btn { opacity: 0; width: 0; padding: 0; border: none; overflow: hidden; }

/* === 主内容区 === */
.main-wrap { margin-left: 240px; flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left 0.25s cubic-bezier(.4,0,.2,1); }
body.sidebar-collapsed .main-wrap { margin-left: 64px; }

/* === 顶部栏 === */
.top-bar { background: rgba(22,27,34,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(48,54,61,0.6); padding: 0 28px; height: 50px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.mobile-menu-btn { display: none; font-size: 20px; color: #8b949e; cursor: pointer; padding: 4px 8px; margin-right: 12px; user-select: none; }
.mobile-menu-btn:hover { color: #e6edf3; }
.top-bar .breadcrumb { font-size: 12px; color: #6e7681; }
.top-bar .breadcrumb span { color: #8b949e; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.update-time { font-size: 11px; color: #484f58; }
.auto-refresh { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6e7681; cursor: pointer; }
.auto-refresh input[type="checkbox"] { accent-color: #d29922; width: 13px; height: 13px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #3fb950; display: inline-block; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* === 页面容器 === */
.page { display: none; }
.page.active { display: block; }
.page-container { max-width: 1600px; margin: 0 auto; padding: 24px 32px; }

/* === 整体总览区 === */
.overview-box { background: linear-gradient(145deg, #111820 0%, #161b22 50%, #1a1520 100%); border: 1px solid rgba(48,54,61,0.5); border-radius: 16px; padding: 32px 40px; margin-bottom: 24px; position: relative; overflow: hidden; }
.overview-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #d29922, #a371f7, #f85149, #d29922); }
.overview-box::after { content: ''; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(210,153,34,0.06) 0%, transparent 70%); pointer-events: none; }
.overview-header { font-size: 13px; font-weight: 600; color: #8b949e; margin-bottom: 22px; text-transform: uppercase; letter-spacing: 1.5px; text-align: center; }
.overview-box-top { display: flex; justify-content: flex-start; margin-bottom: 8px; }
.run-timer-wrap { display: flex; align-items: center; gap: 8px; }
.run-timer-label { font-size: 11px; color: #6e7681; font-weight: 500; }
.run-timer { font-family: 'Courier New', monospace; font-size: 12px; color: #d29922; background: rgba(210,153,34,0.1); padding: 3px 10px; border-radius: 6px; border: 1px solid rgba(210,153,34,0.2); letter-spacing: 0.5px; }
.run-timer.timer-done { color: #3fb950; background: rgba(63,185,80,0.1); border-color: rgba(63,185,80,0.2); }
.overview-row { display: flex; gap: 0; }
.overview-item { flex: 1; text-align: center; position: relative; padding: 8px 0; }
.overview-item:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 5%; height: 90%; width: 1px; background: rgba(48,54,61,0.6); }
.overview-item .ov-num { font-size: 44px; font-weight: 800; margin-bottom: 8px; line-height: 1; letter-spacing: -1px; }
.overview-item .ov-label { font-size: 12px; color: #6e7681; font-weight: 500; letter-spacing: 0.5px; }
.overview-item.ov-total .ov-num { color: #d29922; text-shadow: 0 0 20px rgba(210,153,34,0.2); }
.overview-item.ov-success .ov-num { color: #3fb950; text-shadow: 0 0 20px rgba(63,185,80,0.2); }
.overview-item.ov-fail .ov-num { color: #f85149; text-shadow: 0 0 20px rgba(248,81,73,0.2); }
.overview-item.ov-wait .ov-num { color: #6e7681; }

/* === 设备选择区 === */
.device-box { background: linear-gradient(135deg, #161b22, #14191f); border: 1px solid rgba(48,54,61,0.5); border-radius: 12px; padding: 14px 20px; margin-bottom: 20px; }
.device-box-header { font-size: 11px; color: #6e7681; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }
.device-box .tabs { display: flex; gap: 6px; margin-bottom: 0; }
.tab-btn { padding: 8px 28px; border: 1px solid rgba(48,54,61,0.6); border-radius: 8px; background: rgba(33,38,45,0.6); cursor: pointer; font-size: 13px; font-weight: 600; color: #8b949e; transition: all 0.2s; }
.tab-btn:hover { background: #30363d; color: #e6edf3; border-color: #484f58; }
.tab-btn.active { background: linear-gradient(135deg, #b08814, #e2b844); color: white; border-color: transparent; box-shadow: 0 2px 12px rgba(176,136,20,0.3); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* === 百分比数据区 === */
.rate-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rate-card { flex: 1; min-width: 200px; border: 1px solid rgba(48,54,61,0.5); border-radius: 12px; padding: 16px 22px; display: flex; align-items: center; gap: 16px; transition: all 0.2s; }
.rate-card:hover { border-color: rgba(210,153,34,0.3); transform: translateY(-1px); }
.rate-card .rate-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.rate-card .rate-info { flex: 1; }
.rate-card .rate-num { font-size: 28px; font-weight: 800; line-height: 1.2; }
.rate-card .rate-label { font-size: 11px; color: #6e7681; margin-top: 2px; }
.rate-card.rc-success { background: linear-gradient(135deg, #0d1f12, #121a16); }
.rate-card.rc-success .rate-icon { background: rgba(63,185,80,0.15); color: #3fb950; }
.rate-card.rc-success .rate-num { color: #3fb950; }
.rate-card.rc-fail { background: linear-gradient(135deg, #1f0d0d, #1a1212); }
.rate-card.rc-fail .rate-icon { background: rgba(248,81,73,0.15); color: #f85149; }
.rate-card.rc-fail .rate-num { color: #f85149; }
.rate-card.rc-error { background: linear-gradient(135deg, #1f1a0d, #1a1812); }
.rate-card.rc-error .rate-icon { background: rgba(210,153,34,0.15); color: #d29922; }
.rate-card.rc-error .rate-num { color: #d29922; }

/* === 统计卡片 === */
.stats-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 130px; border: 1px solid rgba(48,54,61,0.5); border-radius: 12px; padding: 18px 16px; text-align: center; transition: all 0.2s; position: relative; overflow: hidden; }
.stat-card:hover { border-color: rgba(210,153,34,0.3); transform: translateY(-1px); }
.stat-card .num { font-size: 32px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.5px; }
.stat-card .label { font-size: 11px; color: #6e7681; font-weight: 500; }
.stat-card.total { background: linear-gradient(145deg, #111d2b, #141a22); }
.stat-card.total .num { color: #d29922; }
.stat-card.success { background: linear-gradient(145deg, #0d1f12, #121a16); }
.stat-card.success .num { color: #3fb950; }
.stat-card.fail { background: linear-gradient(145deg, #1f0d0d, #1a1212); }
.stat-card.fail .num { color: #f85149; }
.stat-card.running { background: linear-gradient(145deg, #1f1a0d, #1a1812); }
.stat-card.running .num { color: #d29922; }

/* === 总览进度条（炫酷版） === */
.overview-progress { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(48,54,61,0.4); }
.overview-progress .progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.overview-progress .progress-title { font-size: 13px; color: #8b949e; font-weight: 500; }
.overview-progress .progress-pct { font-size: 24px; font-weight: 800; color: #3fb950; letter-spacing: -0.5px; }
.overview-progress .progress-bar-bg { width: 100%; height: 12px; background: rgba(33,38,45,0.8); border-radius: 6px; overflow: hidden; }
.overview-progress .progress-bar-fill { height: 100%; border-radius: 6px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); background: linear-gradient(90deg, #b08814, #d29922, #3fb950, #d29922); background-size: 300% 100%; animation: gradientMove 4s ease infinite; position: relative; }
.overview-progress .progress-bar-fill::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent); animation: shimmer 2s infinite; }
@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.overview-progress .progress-detail { display: flex; gap: 24px; margin-top: 12px; font-size: 12px; color: #8b949e; }
.overview-progress .progress-detail span { display: flex; align-items: center; gap: 6px; }
.overview-progress .progress-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.overview-progress .pd-val { color: #e6edf3; font-weight: 600; margin-left: 2px; }

/* === 设备分段色块条 === */
.segment-bar { margin-bottom: 16px; }
.segment-bar-header { font-size: 12px; color: #8b949e; font-weight: 500; margin-bottom: 8px; }
.segment-bar-track { display: flex; height: 32px; border-radius: 8px; overflow: hidden; background: #21262d; }
.segment-bar-track .seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; transition: flex 0.6s cubic-bezier(0.4,0,0.2,1); min-width: 0; overflow: hidden; white-space: nowrap; position: relative; }
.segment-bar-track .seg-success { background: #0d2818; color: #3fb950; flex: var(--seg-success, 0); }
.segment-bar-track .seg-running { background: #2a2006; color: #d29922; flex: var(--seg-running, 0); }
.segment-bar-track .seg-fail { background: #2a0d0d; color: #f85149; flex: var(--seg-fail, 0); }
.segment-bar-track .seg-wait { background: #161b22; color: #6e7681; flex: var(--seg-wait, 0); }
.segment-bar-track .seg-empty { flex: 1; background: #161b22; color: #484f58; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 400; }
.segment-bar-legend { display: flex; gap: 16px; margin-top: 8px; }
.segment-bar-legend span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6e7681; }
.segment-bar-legend .leg-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* === 失败子类型区域 === */
.fail-sub-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.fail-sub-card { flex: 1; min-width: 130px; background: linear-gradient(145deg, #1a1012, #171314); border: 1px solid rgba(48,54,61,0.5); border-radius: 10px; padding: 14px 16px; text-align: center; transition: all 0.2s; }
.fail-sub-card:hover { border-color: rgba(248,81,73,0.4); transform: translateY(-1px); }
.fail-sub-card .num { font-size: 22px; font-weight: 800; margin-bottom: 3px; color: #f85149; }
.fail-sub-card .label { font-size: 11px; color: #6e7681; }

/* === 运行异常表格区 === */
.error-section { margin-top: 4px; }
.error-section-title { font-size: 13px; color: #e6edf3; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.error-section-title .warn-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: rgba(248,81,73,0.12); border-radius: 6px; font-size: 11px; }
.error-section-title .count-tag { font-size: 11px; color: #f85149; background: rgba(248,81,73,0.1); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.error-table-wrap { max-height: 400px; overflow-y: auto; background: linear-gradient(180deg, #0c0f14, #0a0d11); border: 1px solid rgba(48,54,61,0.5); border-radius: 10px; }
.error-table-wrap::-webkit-scrollbar { width: 5px; }
.error-table-wrap::-webkit-scrollbar-track { background: transparent; }
.error-table-wrap::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.error-table-wrap::-webkit-scrollbar-thumb:hover { background: #484f58; }
.error-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.error-table thead { position: sticky; top: 0; z-index: 1; }
.error-table th { text-align: left; padding: 10px 14px; color: #8b949e; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #30363d; white-space: nowrap; background: #161b22; }
.error-table td { padding: 9px 14px; border-bottom: 1px solid rgba(48,54,61,0.3); color: #c9d1d9; white-space: nowrap; font-size: 12px; }
.error-table tbody tr { transition: background 0.15s; }
.error-table tbody tr:hover td { background: rgba(22,27,34,0.8); }
.error-table tbody tr:last-child td { border-bottom: none; }

/* === 徽章 === */
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-success { background: rgba(63,185,80,0.12); color: #3fb950; }
.badge-fail { background: rgba(248,81,73,0.12); color: #f85149; }
.badge-running { background: rgba(210,153,34,0.12); color: #d29922; }
.badge-other { background: rgba(139,148,158,0.12); color: #8b949e; }

/* === 提取店铺页面 === */
.extract-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.extract-tab-btn { padding: 8px 24px; border: 1px solid rgba(48,54,61,0.6); border-radius: 8px; background: rgba(33,38,45,0.6); cursor: pointer; font-size: 13px; font-weight: 600; color: #8b949e; transition: all 0.2s; }
.extract-tab-btn:hover { background: #30363d; color: #e6edf3; border-color: #484f58; }
.extract-tab-btn.active { background: linear-gradient(135deg, #b08814, #e2b844); color: white; border-color: transparent; box-shadow: 0 2px 12px rgba(176,136,20,0.3); }
.extract-tab-btn .tab-count { font-size: 11px; font-weight: 400; opacity: 0.7; margin-left: 6px; }
.extract-panel { display: none; animation: fadeIn 0.3s ease; }
.extract-panel.active { display: block; }
.extract-summary { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.extract-summary-card { flex: 1; min-width: 120px; border: 1px solid rgba(48,54,61,0.5); border-radius: 12px; padding: 16px 20px; text-align: center; transition: all 0.2s; background: linear-gradient(145deg, #161b22, #14191f); }
.extract-summary-card:hover { border-color: rgba(210,153,34,0.3); transform: translateY(-1px); }
.extract-summary-card .num { font-size: 32px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.5px; color: #d29922; }
.extract-summary-card .label { font-size: 11px; color: #6e7681; font-weight: 500; }

/* === 提取操作栏 === */
.extract-action-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.extract-action-left { display: flex; align-items: center; gap: 10px; }
.extract-action-btn { padding: 10px 28px; background: linear-gradient(135deg, #238636, #2ea043); color: #fff; border: 1px solid rgba(63,185,80,0.3); border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap; letter-spacing: 0.5px; position: relative; overflow: hidden; }
.extract-action-btn::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent); pointer-events: none; }
.extract-action-btn:hover { background: linear-gradient(135deg, #2ea043, #3fb950); box-shadow: 0 0 20px rgba(63,185,80,0.25); transform: translateY(-1px); border-color: #3fb950; }
.extract-action-btn::after { content: ' ↗'; opacity: 0.6; font-size: 11px; }
.scan-action-btn {
  padding: 10px 22px; background: linear-gradient(135deg, #b08814, #d29922);
  color: #fff; border: 1px solid rgba(210,153,34,0.3); border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  white-space: nowrap; letter-spacing: 0.5px;
}
.scan-action-btn:hover {
  background: linear-gradient(135deg, #d29922, #e2b844);
  box-shadow: 0 0 16px rgba(210,153,34,0.25); transform: translateY(-1px);
}

/* === 国家筛选器 === */
.country-filter { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.country-filter-label { font-size: 11px; color: #6e7681; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-right: 2px; flex-shrink: 0; }
.country-chip { padding: 5px 12px; border: 1px solid rgba(48,54,61,0.6); border-radius: 6px; font-size: 12px; color: #8b949e; cursor: pointer; transition: all 0.15s; user-select: none; white-space: nowrap; background: rgba(22,27,34,0.6); }
.country-chip:hover { border-color: #d29922; color: #e6edf3; background: rgba(210,153,34,0.08); }
.country-chip.active { background: rgba(210,153,34,0.15); border-color: #d29922; color: #d29922; font-weight: 600; }
.country-chip .chip-count { color: inherit; opacity: 0.7; font-weight: 400; margin-left: 2px; }
.country-chip.active .chip-count { opacity: 1; }
.country-chip.chip-all { border-style: dashed; }
.extract-search { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.extract-search input { flex: 1; padding: 10px 16px; background: #161b22; border: 1px solid #30363d; border-radius: 8px; color: #c9d1d9; font-size: 13px; outline: none; transition: border-color 0.2s; }
.extract-search input:focus { border-color: #d29922; }
.extract-search input::placeholder { color: #484f58; }
.extract-update-info { font-size: 11px; color: #484f58; white-space: nowrap; }
.shop-table-wrap { max-height: 600px; overflow-y: auto; background: linear-gradient(180deg, #0c0f14, #0a0d11); border: 1px solid rgba(48,54,61,0.5); border-radius: 10px; }
.shop-table-wrap::-webkit-scrollbar { width: 5px; }
.shop-table-wrap::-webkit-scrollbar-track { background: transparent; }
.shop-table-wrap::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.shop-table-wrap::-webkit-scrollbar-thumb:hover { background: #484f58; }
.shop-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.shop-table thead { position: sticky; top: 0; z-index: 1; }
.shop-table th { text-align: left; padding: 10px 14px; color: #8b949e; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #30363d; white-space: nowrap; background: #161b22; }
.shop-table td { padding: 9px 14px; border-bottom: 1px solid rgba(48,54,61,0.3); color: #c9d1d9; white-space: nowrap; font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.shop-table tbody tr { transition: background 0.15s; }
.shop-table tbody tr:hover td { background: rgba(22,27,34,0.8); }
.shop-table tbody tr:last-child td { border-bottom: none; }
.shop-table td.cell-url { color: #d29922; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.shop-table td.cell-text { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.shop-empty { text-align: center; padding: 60px 36px; color: #484f58; font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 0; border-top: 1px solid rgba(48,54,61,0.3); margin-top: 0; }
.page-btn { padding: 6px 12px; background: rgba(33,38,45,0.6); border: 1px solid rgba(48,54,61,0.5); border-radius: 6px; color: #8b949e; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.page-btn:hover:not(:disabled) { background: #30363d; color: #e6edf3; border-color: #d29922; }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-info { font-size: 12px; color: #8b949e; min-width: 60px; text-align: center; }
.page-total { font-size: 11px; color: #484f58; margin-left: 8px; }

/* === 工具类 === */
.empty { text-align: center; padding: 40px 20px; color: #484f58; font-size: 13px; }
.loading { text-align: center; padding: 40px; color: #6e7681; font-size: 13px; }

/* === 无障碍与性能 === */
@media (prefers-reduced-motion: reduce) {
  .progress-bar-fill,
  .progress-bar-fill::after,
  .status-dot,
  .overview-box::before { animation: none; }
}

body.tab-hidden .progress-bar-fill,
body.tab-hidden .progress-bar-fill::after,
body.tab-hidden .status-dot {
  animation-play-state: paused;
}

/* === 提取店铺模态框 === */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #161b22; border: 1px solid #30363d; border-radius: 14px;
  width: 420px; max-width: 90vw; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}
.modal-title {
  padding: 18px 24px; font-size: 15px; font-weight: 700; color: #e6edf3;
  border-bottom: 1px solid #30363d;
}
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; min-height: 0; }
.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field label {
  font-size: 11px; color: #6e7681; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}
.modal-field select, .modal-field input {
  padding: 9px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px;
  color: #c9d1d9; font-size: 13px; outline: none; transition: border-color 0.2s;
}
.modal-field select:focus, .modal-field input:focus { border-color: #d29922; }
.modal-available { font-size: 20px; font-weight: 800; color: #d29922; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid #30363d;
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-btn {
  padding: 8px 22px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.modal-btn-cancel { background: #21262d; color: #8b949e; border-color: #30363d; }
.modal-btn-cancel:hover { background: #30363d; color: #e6edf3; }
.modal-btn-confirm {
  background: linear-gradient(135deg, #238636, #2ea043); color: #fff; border-color: rgba(63,185,80,0.3);
}
.modal-btn-confirm:hover { box-shadow: 0 0 16px rgba(63,185,80,0.25); transform: translateY(-1px); }
.modal-btn-confirm:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }

/* === 扫号报告 === */
.scan-summary { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.scan-summary-card { flex: 1; min-width: 80px; border: 1px solid rgba(48,54,61,0.5); border-radius: 10px; padding: 14px; text-align: center; }
.scan-summary-card .num { font-size: 28px; font-weight: 800; }
.scan-summary-card .label { font-size: 10px; color: #6e7681; margin-top: 2px; text-transform: uppercase; }
.scan-summary-card.sc-alive { background: linear-gradient(145deg, #0d1f12, #121a16); }
.scan-summary-card.sc-alive .num { color: #3fb950; }
.scan-summary-card.sc-banned { background: linear-gradient(145deg, #1f0d0d, #1a1212); }
.scan-summary-card.sc-banned .num { color: #f85149; }
.scan-summary-card.sc-error { background: linear-gradient(145deg, #1f1a0d, #1a1812); }
.scan-summary-card.sc-error .num { color: #d29922; }

.scan-country-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.scan-country-table th, .scan-country-table td { padding: 8px 12px; border-bottom: 1px solid rgba(48,54,61,0.3); text-align: center; }
.scan-country-table th { color: #8b949e; font-weight: 600; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid #30363d; }
.scan-country-table td { color: #c9d1d9; }
.scan-country-table .col-country { text-align: left; }
.scan-country-table .col-alive { color: #3fb950; font-weight: 600; }
.scan-country-table .col-banned { color: #f85149; font-weight: 600; }
.scan-country-table .col-error { color: #d29922; }
.scan-progress-msg { text-align: center; padding: 20px; color: #d29922; font-size: 14px; font-weight: 600; }

.scan-detail-list { max-height: 180px; overflow-y: scroll; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; user-select: text; }
.scan-detail-list::-webkit-scrollbar { width: 4px; }
.scan-detail-list::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }
.scan-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; border-bottom: 1px solid rgba(48,54,61,0.3); font-size: 12px; color: #c9d1d9; }
.scan-detail-row:last-child { border-bottom: none; }
.sc-alive-text { color: #3fb950; font-weight: 600; font-size: 11px; }
.sc-banned-text { color: #f85149; font-weight: 600; font-size: 11px; }
.sc-error-text { color: #d29922; font-weight: 600; font-size: 11px; }

/* === 授权码管理 === */
.license-panel { background: linear-gradient(145deg, #111820 0%, #161b22 50%, #151220 100%); border: 1px solid rgba(48,54,61,0.5); border-radius: 14px; display: flex; overflow: hidden; position: relative; }
.license-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #a371f7, #d29922); z-index: 1; }
.license-main { flex: 0 0 240px; padding: 28px; display: flex; flex-direction: column; align-items: center; }
.license-gen-btn { padding: 10px 28px; background: linear-gradient(135deg, #b08814, #d29922); color: #fff; border: 1px solid rgba(210,153,34,0.3); border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap; letter-spacing: 0.5px; }
.license-gen-btn:hover { background: linear-gradient(135deg, #d29922, #e2b844); box-shadow: 0 0 20px rgba(210,153,34,0.25); transform: translateY(-1px); }
.license-history { flex: 1; padding: 28px; border-left: 1px solid rgba(48,54,61,0.4); background: rgba(0,0,0,0.1); }
.license-panel-title { font-size: 14px; font-weight: 700; color: #e6edf3; margin-bottom: 20px; text-align: center; }
.license-main-body { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.license-current { width: 100%; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 20px; min-height: 100px; }
.license-placeholder { color: #484f58; font-size: 13px; text-align: center; padding: 20px 0; }
.license-history-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.license-history-list::-webkit-scrollbar { width: 4px; }
.license-history-list::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }
.license-history-item { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 10px 14px; font-size: 12px; color: #c9d1d9; }
.lic-top-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.license-history-item .lic-code { font-family: monospace; color: #d29922; font-size: 11px; word-break: break-all; flex: 1; }
.lic-copy-btn { flex-shrink: 0; padding: 4px 12px; background: linear-gradient(135deg, #238636, #2ea043); color: #fff; border: 1px solid rgba(63,185,80,0.3); border-radius: 5px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.lic-copy-btn:hover { box-shadow: 0 0 10px rgba(63,185,80,0.25); }
.lic-copy-btn.copied { background: #30363d; color: #8b949e; }
.license-history-item .lic-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.license-history-item .lic-col { color: #8b949e; font-size: 11px; text-align: center; }
.license-history-item .lic-remark { color: #e6edf3; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.lic-bot-row { text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.lic-ext-btn { padding: 4px 14px; background: transparent; border: 1px solid rgba(210,153,34,0.3); border-radius: 4px; color: #d29922; font-size: 11px; cursor: pointer; }
.lic-ext-btn:hover { background: rgba(210,153,34,0.1); }
.lic-del-btn { padding: 4px 14px; background: transparent; border: 1px solid rgba(248,81,73,0.3); border-radius: 4px; color: #f85149; font-size: 11px; cursor: pointer; }
.lic-del-btn:hover { background: rgba(248,81,73,0.1); }

/* === 登录页 === */
.login-overlay { position: fixed; top:0;left:0;right:0;bottom:0; background:#080b10; z-index:9999; display:flex; align-items:center; justify-content:center; }
.login-box { width:360px; max-width:90vw; padding:40px 32px; background:#161b22; border:1px solid #30363d; border-radius:14px; text-align:center; }
.login-title { font-size:20px; font-weight:700; color:#e6edf3; margin-bottom:28px; }
.login-field { margin-bottom:16px; }
.login-field input { width:100%; padding:12px 16px; background:#0d1117; border:1px solid #30363d; border-radius:8px; color:#c9d1d9; font-size:14px; outline:none; }
.login-field input:focus { border-color:#d29922; }
.login-error { color:#f85149; font-size:12px; margin-bottom:12px; min-height:18px; }
.login-btn { width:100%; padding:12px; background:linear-gradient(135deg,#b08814,#e2b844); color:#fff; border:none; border-radius:8px; font-size:15px; font-weight:700; cursor:pointer; transition:all 0.2s; }
.login-btn:hover { box-shadow:0 2px 16px rgba(176,136,20,0.3); }

/* === 用户管理 === */
.user-table-wrap { width:100%; max-height:500px; overflow-y:auto; background:linear-gradient(180deg,#0c0f14,#0a0d11); border:1px solid rgba(48,54,61,0.5); border-radius:10px; }
.user-table-wrap::-webkit-scrollbar { width:4px; }
.user-table-wrap::-webkit-scrollbar-thumb { background:#30363d; border-radius:2px; }
.user-table { width:100%; border-collapse:collapse; font-size:12px; }
.user-table th { text-align:left; padding:10px 14px; color:#8b949e; font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid #30363d; white-space:nowrap; background:#161b22; position:sticky; top:0; z-index:1; }
.user-table td { padding:9px 14px; border-bottom:1px solid rgba(48,54,61,0.3); color:#c9d1d9; white-space:nowrap; }
.user-table tbody tr:hover td { background:rgba(22,27,34,0.8); }
.perm-toggle { display:flex; gap:6px; }
.perm-chip { padding:3px 10px; border-radius:10px; font-size:10px; font-weight:600; cursor:pointer; border:1px solid #30363d; background:#21262d; color:#484f58; transition:all 0.15s; user-select:none; }
.perm-chip.on { background:rgba(63,185,80,0.12); border-color:rgba(63,185,80,0.3); color:#3fb950; }
.perm-chip.perm-locked { background:rgba(33,38,45,0.6); border-color:#21262d; color:#484f58; cursor:default; pointer-events:none; }

/* === 手机端适配 === */
@media (max-width: 900px) {
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar .logo-text, .sidebar .nav-label, .sidebar .user-info, .sidebar .nav-group-title { display: none; }
  .sidebar.collapsed { width: 0; min-width: 0; overflow: hidden; }
  .main-wrap { margin-left: 64px; }
  body.sidebar-collapsed .main-wrap { margin-left: 0; }
  .page-container { padding: 16px; }
  .overview-box { padding: 20px 16px; }
  .overview-item .ov-num { font-size: 28px; }
  .rate-row, .stats-row, .fail-sub-row { flex-direction: column; }
  .rate-card, .stat-card { min-width: auto; }
  .extract-action-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
  .license-panel { flex-direction: column; }
  .license-main { flex: none; width: 100%; }
  .license-history { border-left: none; border-top: 1px solid rgba(48,54,61,0.4); }
  .modal-box { width: 95vw; }
  .device-box .tabs { flex-wrap: wrap; }
  .tab-btn { padding: 6px 16px; font-size: 12px; }
}

@media (max-width: 600px) {
  .mobile-menu-btn { display: block; }
  .sidebar { display: none; z-index: 300; }
  .sidebar.show { display: flex; width: 240px; min-width: 240px; }
  .main-wrap { margin-left: 0 !important; }
  .overview-item .ov-num { font-size: 22px; }
  .overview-item .ov-label { font-size: 10px; }
  .overview-box { padding: 14px 10px; }
  .shop-table-wrap, .error-table-wrap { max-height: 300px; }
  .shop-table td, .error-table td { font-size: 10px; padding: 6px 8px; }
  .license-history-item .lic-meta { grid-template-columns: 1fr 1fr; }
  .lic-bot-row { justify-content: flex-start; flex-wrap: wrap; }
  .extract-search { flex-direction: column; gap: 6px; }
}
