/* 品牌色点缀：默认为苹果蓝，可替换为你的品牌主色 */
:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --text: #1d1d1f;
  --text-sub: #6e6e73;
  --line: #e8e8ed;
  --card: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* 导航 */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.nav-brand a { color: var(--text); text-decoration: none; }
.nav-links a {
  color: var(--text); text-decoration: none; font-size: 14px;
  margin-left: 24px; transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 7px 16px; border-radius: 980px;
}

/* 主区域 */
main { max-width: 980px; margin: 0 auto; padding: 0 24px 80px; }

.hero { text-align: center; padding: 88px 0 56px; }
.eyebrow {
  color: var(--accent); font-size: 14px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.hero h1, .page-head h1 {
  font-size: 52px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 16px;
}
.hero-sub { font-size: 19px; color: var(--text-sub); margin-bottom: 32px; }

.cta {
  display: inline-block; background: var(--accent); color: #fff;
  text-decoration: none; font-size: 16px; font-weight: 500;
  padding: 13px 30px; border-radius: 980px; border: none; cursor: pointer;
  transition: background .2s, opacity .2s;
}
.cta:hover { background: var(--accent-hover); }
.cta:disabled { opacity: 0.4; cursor: not-allowed; }
.cta.ghost { background: var(--bg-soft); color: var(--text); }
.cta.ghost:hover { background: #e9e9ed; }

/* 进度条 */
.progress-wrap { margin-bottom: 56px; }
.progress-wrap span { font-size: 13px; color: var(--text-sub); display: block; margin-bottom: 8px; }
.progress-bar { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; }
#progressFill { height: 100%; width: 0; background: var(--accent); transition: width .3s; border-radius: 3px; }

/* Part 与模块卡片 */
.parts { display: flex; flex-direction: column; gap: 48px; }
.part h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px; }
.part .part-sub { color: var(--text-sub); font-size: 14px; margin-top: -12px; margin-bottom: 20px; }

.module {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
  transition: box-shadow .2s;
}
.module:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.module-head {
  display: flex; align-items: center; gap: 20px;
  padding: 22px 26px; cursor: pointer; user-select: none;
}
.module-num {
  font-size: 32px; font-weight: 700; color: #d2d2d7;
  letter-spacing: -0.02em; min-width: 48px;
}
.module-title { font-size: 18px; font-weight: 600; flex: 1; }
.module-arrow { color: var(--text-sub); transition: transform .2s; font-size: 14px; }
.module.open .module-arrow { transform: rotate(90deg); }
.module-check { display: inline-flex; align-items: center; cursor: pointer; margin-right: 4px; }
.module-check input { display: none; }
.check-box {
  width: 20px; height: 20px;
  border: 1.5px solid #c7c7cc; border-radius: 50%;
  position: relative; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.module-check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.module-check input:checked + .check-box::after {
  content: ""; position: absolute;
  left: 6px; top: 3px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.module-body { border-top: 1px solid var(--line); padding: 8px 26px 18px 94px; }
.sub {
  padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: baseline;
}
.sub:last-child { border-bottom: none; }
.sub-dot { color: var(--accent); font-size: 12px; }
.sub-title { font-weight: 500; }
.sub-desc { color: var(--text-sub); font-size: 14px; }

/* 页面头部 */
.page-head { text-align: center; padding: 72px 0 40px; }
.page-head h1 { font-size: 44px; }
.page-head .hero-sub { margin-bottom: 0; }

/* 上传引导 */
.guide { background: var(--bg-soft); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 24px; }
.guide h2 { font-size: 17px; margin-bottom: 12px; }
.guide ol { padding-left: 20px; color: var(--text-sub); font-size: 15px; }
.guide li { margin-bottom: 6px; }

.dropzone {
  border: 2px dashed #c7c7cc; border-radius: var(--radius);
  padding: 56px 24px; text-align: center; cursor: pointer; transition: all .2s;
}
.dropzone.dragover { border-color: var(--accent); background: #f0f7ff; }
.dz-icon { font-size: 40px; color: var(--accent); margin-bottom: 12px; }
.dz-title { font-size: 17px; font-weight: 500; }
.dz-sub { color: var(--text-sub); font-size: 14px; margin-top: 6px; }

.file-info { text-align: center; margin-top: 18px; font-size: 15px; color: var(--text-sub); }
.status { text-align: center; margin-top: 18px; font-size: 15px; color: var(--text-sub); min-height: 24px; }
.status.error { color: #d70015; }

#analyzeBtn { display: block; margin: 24px auto 0; }

/* 报告 */
#report { display: flex; flex-direction: column; gap: 20px; }
.report-summary {
  background: var(--bg-soft); border-radius: var(--radius); padding: 30px;
  font-size: 17px;
}
.metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-top: 20px;
}
.metric {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; text-align: center;
}
.metric .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.metric .k { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

.board {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px;
}
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sev { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 980px; }
.sev.high { background: #ffe3e5; color: #d70015; }
.sev.medium { background: #fff3d6; color: #b25000; }
.sev.low { background: #e8f4ff; color: #0071e3; }
.board h3 { font-size: 18px; font-weight: 600; }
.board p { color: var(--text-sub); font-size: 15px; }
.board .mod-tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.mod-tag {
  font-size: 13px; color: var(--accent); background: #eef6ff;
  padding: 4px 12px; border-radius: 980px;
}

.suggestions { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.suggestions h3 { font-size: 17px; margin-bottom: 12px; }
.suggestions li { margin-bottom: 8px; margin-left: 20px; }

.conversion {
  background: var(--bg-soft); border-radius: var(--radius); padding: 30px;
  text-align: center; font-size: 16px; color: var(--text-sub);
}
.report-actions { text-align: center; margin-top: 32px; }

.footer {
  text-align: center; padding: 40px 24px; color: var(--text-sub); font-size: 13px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .hero h1, .page-head h1 { font-size: 36px; }
  .module-body { padding-left: 26px; }
  .module-num { min-width: 36px; font-size: 26px; }
}

/* 图表与历史对比 */
.chart-section, .history-section {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; margin-top: 8px;
}
.chart-section h2, .history-section h2 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px;
}
.chart-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chart-tab {
  font-size: 13px; padding: 6px 14px; border-radius: 980px;
  border: 1px solid var(--line); background: #fff; color: var(--text-sub); cursor: pointer;
  transition: all .15s;
}
.chart-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-wrap { width: 100%; }
#trendChart { display: block; width: 100%; }

.history-sub { color: var(--text-sub); font-size: 14px; margin-bottom: 16px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 10px; flex-wrap: wrap;
}
.history-meta { display: flex; flex-direction: column; gap: 2px; }
.history-time { font-size: 13px; font-weight: 600; }
.history-file { font-size: 13px; color: var(--text-sub); }
.history-stats { font-size: 12px; color: var(--text-sub); }
.history-actions { display: flex; gap: 8px; }
.ghost-btn {
  font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text); transition: all .15s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.ghost-btn.danger:hover { border-color: #d70015; color: #d70015; }

.compare-box {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 16px; background: var(--bg-soft);
}
.compare-head { font-size: 15px; margin-bottom: 14px; }
.compare-item { margin-bottom: 16px; }
.compare-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.bar-name { font-size: 12px; color: var(--text-sub); width: 34px; flex-shrink: 0; }
.bar { flex: 1; height: 14px; background: #e9e9ed; border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; }
.bar-fill.cur { background: var(--accent); }
.bar-fill.prev { background: #a9b6c4; }
.bar-val { font-size: 13px; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.compare-diff { font-size: 12px; margin-left: 44px; }
.compare-diff.up { color: #1a7f37; }
.compare-diff.down { color: #d70015; }
