/* 字体侵权自查 — 苹果简约浅色，大厂风。单强调色 #0071e3。 */
:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --danger: #d70015;
  --danger-bg: #fdf0f1;
  --success: #007a3d;
  --success-bg: #eefaf2;
  --muted-bg: #f5f5f7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 32px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
h2 { font-size: 20px; line-height: 1.35; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  border: 0; background: none; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
  font-size: 15px; color: var(--text-secondary);
}
.nav-link:hover { color: var(--text); background: var(--muted-bg); }
.nav-link.active { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.lang-switch:hover { color: var(--text); border-color: var(--text-secondary); }
.user-chip {
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--text-secondary);
}

/* ---- 按钮 / 输入 ---- */
.btn {
  border: 0; border-radius: 980px; cursor: pointer;
  font-size: 15px; font-weight: 500; padding: 10px 20px;
  transition: background .15s ease, opacity .15s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--muted-bg); color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: #e8e8ed; }
.btn-sm { font-size: 14px; padding: 7px 14px; }
.btn-block { width: 100%; margin-top: 16px; }

.input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 15px; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .15); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.field-error { color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.field-success { color: var(--success); font-size: 14px; margin: 10px 0 0; }
.field-note { color: var(--text-secondary); font-size: 13px; margin: 10px 0 0; }

/* ---- 主体 ---- */
main { padding: 40px 24px 64px; }
.view { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.hero { max-width: 720px; margin-bottom: 28px; }
.lede { font-size: 18px; color: var(--text-secondary); margin: 0; }
.quota-line { font-size: 14px; color: var(--text-secondary); margin: 14px 0 0; }
.quota-line strong { color: var(--text); }

.login-notice {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.login-notice span { flex: 1; min-width: 200px; }

/* ---- 核查三卡 ---- */
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.check-card { display: flex; flex-direction: column; }
.check-card h2 { display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; flex: none;
}
.card-desc { color: var(--text-secondary); font-size: 15px; }
.names-meta { text-align: right; font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* 拖拽区 */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: 28px 16px; text-align: center; cursor: pointer;
  background: var(--muted-bg); transition: border-color .15s ease, background .15s ease;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dropzone.dragging { border-color: var(--accent); background: #eaf3fd; }
.dz-icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 4px; }
.dz-text { font-size: 15px; font-weight: 500; margin: 0; }
.dz-hint { font-size: 13px; color: var(--text-secondary); margin: 0; }
.dz-file { font-size: 14px; color: var(--accent); font-weight: 500; margin: 6px 0 0; word-break: break-all; }

.progress { height: 6px; border-radius: 3px; background: var(--border-light); margin-top: 14px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s ease; }

/* ---- 报告 ---- */
.report { margin-top: 36px; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.report-head h2 { margin: 0; font-size: 24px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-source { color: var(--text-secondary); font-size: 14px; word-break: break-all; }
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 24px; }
.summary-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 16px; text-align: center;
}
.summary-card .count { display: block; font-size: 28px; font-weight: 700; line-height: 1.2; }
.summary-card .label { font-size: 13px; color: var(--text-secondary); }
.summary-card.red .count { color: var(--danger); }
.summary-card.green .count { color: var(--success); }
.summary-card.gray .count { color: var(--text-secondary); }

.report-group { margin-bottom: 20px; }
.report-group > h3 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 9px; border-radius: 980px; white-space: nowrap;
}
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-gray { background: var(--muted-bg); color: var(--text-secondary); }

.font-item {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 10px;
}
.font-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.font-name { font-size: 16px; font-weight: 600; word-break: break-word; }
.font-meta { color: var(--text-secondary); font-size: 14px; margin: 6px 0 0; }
.font-note { font-size: 14px; margin: 8px 0 0; }
.font-links { margin: 8px 0 0; font-size: 14px; }
.font-links a { word-break: break-all; }
.replacement {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--success-bg); font-size: 14px; color: var(--text);
}
.replacement strong { color: var(--success); }

.report-disclaimer { color: var(--text-secondary); font-size: 13px; margin-top: 20px; }

/* 加载中 */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; color: var(--text-secondary); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border-light); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 定价 ---- */
.page-head { max-width: 720px; margin-bottom: 28px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-tag {
  position: absolute; top: -11px; left: 20px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 980px;
}
.plan-name { font-size: 18px; font-weight: 600; }
.plan-price { font-size: 32px; font-weight: 700; margin: 8px 0 4px; }
.plan-price small { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.plan-desc { color: var(--text-secondary); font-size: 14px; flex: 1; }
.plan ul { margin: 12px 0 0; padding-left: 18px; font-size: 14px; color: var(--text); }
.plan li { margin-bottom: 4px; }
.pay-note h2 { margin-bottom: 12px; }
.pay-steps { margin: 0 0 12px; padding-left: 20px; }
.pay-steps li { margin-bottom: 6px; }
.pay-mail { margin: 0; }
.pay-qr { margin-top: 16px; text-align: center; }
.pay-qr img { width: 220px; height: 220px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--surface); }
.pay-qr .field-note { text-align: center; }
.order-panel {
  margin-top: 20px; padding: 18px; border-radius: var(--radius-sm);
  background: var(--success-bg); border: 1px solid #cdeeda;
}
.order-panel h3 { font-size: 17px; margin: 0 0 8px; }
.order-no { font-size: 15px; margin: 0 0 6px; }
.order-no strong { font-size: 18px; letter-spacing: .02em; }
.order-meta { color: var(--text-secondary); font-size: 14px; margin: 0 0 6px; }
.order-note { font-size: 14px; margin: 0 0 12px; }
.plan-buy { margin-top: 16px; }

/* ---- 登录 ---- */
.auth-card { max-width: 480px; margin: 0 auto; }
.code-row { display: flex; gap: 12px; align-items: flex-end; margin-top: 16px; }
.code-input-wrap { flex: 1; min-width: 0; }
.code-row .btn { flex: none; margin-bottom: 1px; white-space: nowrap; }
#loginForm .btn-block { margin-top: 20px; }

/* ---- 我的 ---- */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.quota-big { font-size: 40px; font-weight: 700; line-height: 1.1; margin: 4px 0 8px; }
.quota-big small { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.redeem-row { display: flex; gap: 10px; }
.redeem-row .input { flex: 1; min-width: 0; }
.redeem-row .btn { flex: none; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; }
.history-list li {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--border-light); font-size: 14px;
}
.history-list li:first-child { border-top: 0; }
.history-source { word-break: break-all; color: var(--text); }
.history-meta { color: var(--text-secondary); white-space: nowrap; }
.empty-note { color: var(--text-secondary); margin: 12px 0 0; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state p { margin-bottom: 20px; }
#logoutBtn { margin-top: 20px; }

/* ---- 页脚 ---- */
.footer { border-top: 1px solid var(--border-light); padding: 28px 0 36px; color: var(--text-secondary); font-size: 13px; }
.footer p { margin: 0 0 4px; }
.footer-sub { color: var(--text-secondary); }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .check-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  h1 { font-size: 26px; }
  main { padding: 28px 16px 48px; }
  .wrap { padding: 0 16px; }
  .nav-link { padding: 8px 8px; font-size: 14px; }
  .brand span:last-child { display: none; }
  .user-chip { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .code-row { flex-direction: column; align-items: stretch; }
  .code-row .btn { width: 100%; }
  .report-head { align-items: flex-start; flex-direction: column; }
}
