* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f8fafc; color: #1e293b; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* 登录 */
.login-overlay { position: fixed; inset: 0; background: #f8fafc; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-overlay.hidden { display: none; }
.login-box { background: #fff; border-radius: 12px; padding: 2.5rem; box-shadow: 0 4px 24px rgba(0,0,0,0.08); text-align: center; width: 340px; }
.login-box h2 { font-size: 20px; color: #0f172a; margin-bottom: 6px; }
.login-box p { font-size: 13px; color: #94a3b8; margin-bottom: 1.5rem; }
.login-box input { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; margin-bottom: 1rem; outline: none; transition: border-color 0.2s; }
.login-box input:focus { border-color: #2563eb; }
.login-box .btn { width: 100%; padding: 10px; font-size: 14px; }
#login-error { font-size: 12px; color: #dc2626; margin-top: 0.8rem; min-height: 18px; }

.container header h1 { color: #0f172a; font-size: 22px; margin-bottom: 4px; }
.subtitle { color: #94a3b8; font-size: 13px; margin-bottom: 2rem; }

.section { margin-bottom: 3rem; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1.2rem; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }
.section-icon { font-size: 18px; }
.section-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.section-desc { font-size: 12px; color: #94a3b8; margin-left: auto; }

/* 排行榜 */
.ranking-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ranking-table thead th {
  background: #f1f5f9; color: #64748b; font-weight: 600; padding: 10px 12px;
  text-align: left; border-bottom: 1px solid #e2e8f0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ranking-table thead th.center { text-align: center; }
.ranking-table tbody tr { transition: background 0.15s; }
.ranking-table tbody tr:hover { background: #f8fafc; }
.ranking-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ranking-table tbody td.center { text-align: center; }
.ranking-table tbody td.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; color: #64748b; }

.score { font-weight: 700; font-size: 13px; }
.score.good { color: #16a34a; }
.score.mid { color: #ea580c; }
.score.bad { color: #dc2626; }

.badge { padding: 3px 10px; border-radius: 99px; font-size: 10px; font-weight: 600; display: inline-block; }
.badge.recommend { background: #dcfce7; color: #15803d; }
.badge.caution { background: #fef3c7; color: #b45309; }
.badge.review { background: #e0e7ff; color: #4338ca; }
.badge.reject { background: #fee2e2; color: #b91c1c; }

.rank { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.rank.top1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank.top2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank.top3 { background: linear-gradient(135deg, #fdba74, #ea580c); color: #fff; }
.rank.normal { background: #f1f5f9; color: #94a3b8; }

.scan-info { font-size: 11px; color: #94a3b8; margin-top: 12px; padding: 8px 12px; background: #fff; border-radius: 6px; border: 1px solid #f1f5f9; }

/* 历史趋势 + 订阅概览 并排 */
.mid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* 历史趋势 */
.chart-container { background: #fff; border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.chart-label { font-size: 12px; color: #64748b; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-bottom: 24px; position: relative; }
.chart-bars::after { content: ''; position: absolute; bottom: 20px; left: 0; right: 0; height: 1px; background: #e2e8f0; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; min-height: 4px; }
.bar-date { font-size: 8px; color: #94a3b8; }
.bar-score { font-size: 9px; font-weight: 700; }

.ip-selector { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.ip-chip { padding: 4px 10px; border-radius: 99px; font-size: 10px; border: 1px solid #e2e8f0; color: #64748b; cursor: pointer; transition: all 0.2s; font-family: monospace; background: #fff; }
.ip-chip.active { border-color: #2563eb; color: #2563eb; background: #eff6ff; font-weight: 600; }

.platform-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.platform-box { background: #fff; border-radius: 6px; padding: 0.6rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* 订阅概览 */
.sub-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.sub-card { background: #fff; border-radius: 8px; padding: 1rem; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.sub-card-name { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.sub-card-meta { font-size: 10px; color: #94a3b8; margin-bottom: 8px; }
.sub-card-score { font-size: 26px; font-weight: 800; }
.sub-card-label { font-size: 10px; color: #94a3b8; }
.sub-card-bar { height: 5px; border-radius: 3px; background: #f1f5f9; margin-top: 8px; overflow: hidden; }
.sub-card-fill { height: 100%; border-radius: 3px; }

/* 加工流程 */
.process-steps { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.process-step { flex: 1; text-align: center; position: relative; }
.process-step::after { content: '→'; position: absolute; right: -12px; top: 14px; color: #cbd5e1; font-size: 14px; }
.process-step:last-child::after { display: none; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin: 0 auto 6px; }
.step-label { font-size: 11px; color: #64748b; font-weight: 500; }

.process-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.process-panel { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.process-panel h4 { font-size: 12px; margin-bottom: 0.6rem; color: #0f172a; display: flex; align-items: center; gap: 6px; }

.node-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 11px; }
.checkbox { width: 16px; height: 16px; border-radius: 3px; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; cursor: pointer; }
.checkbox.checked { background: #2563eb; border-color: #2563eb; color: #fff; }

.group-tag { padding: 3px 8px; border-radius: 5px; font-size: 10px; border: 1px dashed #cbd5e1; color: #64748b; cursor: pointer; font-weight: 500; }

.editor-mock { background: #f8fafc; border-radius: 6px; padding: 0.8rem; font-family: 'SF Mono', monospace; font-size: 10px; color: #475569; line-height: 1.8; border: 1px solid #e2e8f0; }
.editor-comment { color: #94a3b8; }
.editor-key { color: #2563eb; }
.editor-val { color: #16a34a; }

.btn { padding: 7px 16px; border-radius: 8px; font-size: 11px; font-weight: 600; border: none; cursor: pointer; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: #fff; border: 1px solid #e2e8f0; color: #64748b; }

.sub-link-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; font-family: monospace; font-size: 10px; color: #2563eb; display: flex; justify-content: space-between; align-items: center; margin-top: 0.8rem; }
