/* QuantDB Site — unified, minimal design system */

:root {
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-code: #0f172a;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --brand: #1e3a5f;
  --brand-light: #e2e8f0;
  --accent: #4f46e5;
  --accent-light: #eef2ff;

  --green: #059669;
  --green-bg: #d1fae5;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --orange: #d97706;
  --orange-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --purple: #7c3aed;
  --purple-bg: #ede9fe;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;

  --radius: 8px;
  --radius-sm: 6px;
  --nav-height: 60px;
  --container: 1120px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--text); }
h1 { font-size: 38px; }
h2 { font-size: 28px; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 20px; margin: 28px 0 12px; }
h4 { font-size: 16px; margin: 20px 0 8px; }

p { margin-bottom: 12px; color: var(--text-muted); line-height: 1.7; }

ul, ol { margin: 0 0 16px 20px; color: var(--text-muted); }
li { margin-bottom: 6px; }

code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent);
}

pre.code {
  background: var(--bg-code);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 12px 0;
}

pre.code .comment { color: #94a3b8; font-style: italic; }
pre.code .keyword { color: #a5b4fc; }
pre.code .string { color: #6ee7b7; }
pre.code .number { color: #fbbf24; }
pre.code .func { color: #7dd3fc; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.navbar .container {
  display: flex;
  align-items: center;       /* 垂直居中：关键 */
  justify-content: space-between;  /* logo 左、nav 右 */
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

.navbar .logo {
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;             /* 防止被压缩 */
  white-space: nowrap;
  text-decoration: none;
}

.navbar .logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-links .btn-cta {
  background: var(--accent);
  color: #fff !important;
  margin-left: 8px;
}

.nav-links .btn-cta:hover { background: #4338ca; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* Hero */
.hero {
  padding: 120px 0 64px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  max-width: 720px;
}

.hero p {
  font-size: 17px;
  max-width: 640px;
  margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #4338ca; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Sections */
.section { padding: 64px 0; }

.section-header { margin-bottom: 40px; }
.section-header h2 { margin: 0 0 10px; border: none; padding: 0; }
.section-header p { max-width: 640px; margin: 0; }

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card:hover { border-color: #cbd5e1; }

/* Feature grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { font-size: 14px; margin: 0; }

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 14px;
  background: var(--accent-light);
  color: var(--accent);
}

/* Categories */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.category-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.category-item .cat-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-item h4 { font-size: 15px; margin: 0 0 4px; }
.category-item span { font-size: 13px; color: var(--text-light); }

/* Code block */
.code-wrap {
  background: var(--bg-code);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

.copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}

.copy-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Endpoint list */
.endpoint-list { display: flex; flex-direction: column; gap: 10px; }

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.endpoint-row:hover { border-color: #cbd5e1; }

.endpoint-row .method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
}

.method.get { background: var(--blue-bg); color: var(--blue); }
.method.post { background: var(--green-bg); color: var(--green); }
.method.delete { background: var(--red-bg); color: var(--red); }

.endpoint-row .path {
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag.public { background: var(--bg-soft); color: var(--text-muted); }
.tag.auth { background: var(--purple-bg); color: var(--purple); }
.tag.ch { background: var(--green-bg); color: var(--green); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray { background: var(--bg-soft); color: var(--text-muted); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pricing-card h3 { font-size: 18px; margin-bottom: 6px; }
.pricing-card .price {
  font-size: 36px;
  font-weight: 700;
  margin: 12px 0 4px;
}
.pricing-card .price span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.pricing-card .desc { font-size: 14px; margin-bottom: 20px; }
.pricing-card ul { list-style: none; margin: 0 0 20px; text-align: left; flex: 1; }
.pricing-card ul li {
  padding: 6px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-card ul li::before {
  content: "";
  width: 16px; height: 16px;
  background: var(--green-bg);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23059669' d='M13.5 4.5 6 12 2.5 8.5l1-1L6 10l6.5-6.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.pricing-card .btn { display: block; width: 100%; margin-top: auto; }

/* Download cards */
.download-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  background: var(--bg);
}

.download-card:hover { border-color: #cbd5e1; }

.download-card .dl-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent);
}

.download-card .dl-info { flex: 1; min-width: 0; }
.download-card .dl-info h3 { font-size: 16px; margin: 0 0 4px; }
.download-card .dl-info p { font-size: 14px; margin: 0 0 8px; }

.download-card .dl-btn {
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.download-card .dl-btn:hover { background: #4338ca; text-decoration: none; }

/* Footer */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer p { font-size: 13px; line-height: 1.7; margin: 0; }
.footer ul { list-style: none; margin: 0; }
.footer ul li { margin-bottom: 8px; }
.footer ul a { color: var(--text-muted); font-size: 13px; }
.footer ul a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-legal-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-legal-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-sep {
  color: var(--border);
}

/* Legal document (用户协议 / 隐私条款) */
.legal-doc {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
}

.legal-doc h2 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.legal-doc h2:first-of-type { margin-top: 8px; }

.legal-doc h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}

.legal-doc p { margin: 10px 0; }

.legal-doc ul {
  margin: 10px 0;
  padding-left: 22px;
}

.legal-doc ul li {
  margin: 6px 0;
}

.legal-doc strong { color: var(--text); }

.legal-doc a { color: var(--accent); }

.legal-doc a:hover { text-decoration: underline; }

.legal-meta {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}

.legal-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

/* Docs layout */
.doc-layout {
  display: flex;
  gap: 32px;
  padding-top: calc(var(--nav-height) + 32px);
  padding-bottom: 64px;
}

.doc-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  height: calc(100vh - var(--nav-height) - 64px);
  overflow-y: auto;
}

.doc-sidebar h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
  margin: 24px 0 10px;
}

.doc-sidebar h3:first-child { margin-top: 0; }

.doc-sidebar ul { list-style: none; margin: 0 0 16px; }
.doc-sidebar ul li { margin-bottom: 2px; }
.doc-sidebar ul a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.doc-sidebar ul a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.doc-sidebar ul a.active { background: var(--accent-light); color: var(--accent); }

.doc-content { flex: 1; min-width: 0; max-width: 820px; }
.doc-content h2:first-child { margin-top: 0; }

/* Tables */
.field-table, .param-table, .sdk-table, .compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0 24px;
}

.field-table th, .param-table th, .sdk-table th, .compare-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.field-table td, .param-table td, .sdk-table td, .compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.field-table tr:hover, .param-table tr:hover, .sdk-table tr:hover, .compare-table tr:hover { background: var(--bg-soft); }

.field-table td:first-child, .param-table td:first-child { font-family: var(--font-mono); font-weight: 600; color: var(--accent); }

.required::after { content: " *"; color: var(--red); }

/* Info box */
.info-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
}

.info-box.warn { background: var(--orange-bg); border-color: var(--orange); }
.info-box.success { background: var(--green-bg); border-color: var(--green); }

/* Usage tags */
.usage-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}
.usage-query { background: var(--green-bg); color: var(--green); }
.usage-download { background: var(--orange-bg); color: var(--orange); }
.usage-both { background: var(--blue-bg); color: var(--blue); }

/* Section anchor offset for fixed header */
.section-anchor { display: block; margin-top: -80px; padding-top: 80px; }

/* Field tables */
.field-table .type,
.field-table .example {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
}
.field-table .desc { color: var(--text); }

/* Endpoint card (docs) */
.endpoint {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
}

.endpoint-header:hover { background: var(--bg-soft); }

.endpoint-header .method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
}

.endpoint-header .path {
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
}

.endpoint-header .arrow {
  font-size: 11px;
  color: var(--text-light);
  transition: transform 0.2s;
}

.endpoint.open .endpoint-header .arrow { transform: rotate(90deg); }

.endpoint-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.endpoint.open .endpoint-body { display: block; }

.endpoint-body .desc { margin: 16px 0 12px; color: var(--text-muted); font-size: 14px; }
.endpoint-body h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 18px 0 8px;
}

/* Method cards (SDK) */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.method-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.method-card h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 4px;
}

.method-card p { font-size: 13px; margin: 0; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-q {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q:hover { background: var(--bg-soft); }

.faq-a {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-muted);
  display: none;
}

.faq-item.open .faq-a { display: block; }

.faq-q .arrow {
  font-size: 11px;
  color: var(--text-light);
  transition: transform 0.2s;
}

.faq-item.open .faq-q .arrow { transform: rotate(180deg); }

/* Responsive */
@media (max-width: 1024px) {
  .features-grid, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .nav-links .btn-cta { margin-left: 0; margin-top: 4px; }

  .hero h1 { font-size: 30px; }
  .hero { padding: 100px 0 48px; }

  .features-grid, .pricing-grid, .method-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .doc-sidebar { display: none; }
  .doc-layout { padding-top: calc(var(--nav-height) + 20px); }
  .download-card { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Account / Personal Center
   ========================================================= */

/* --- 通用辅助 --- */
.btn-sm { padding: 7px 14px; font-size: 13px; }
.muted { color: var(--text-light); font-size: 14px; margin: 0; }

/* --- 未登录：登录/注册卡 --- */
.auth-page {
  padding: calc(var(--nav-height) + 48px) 0 80px;
  background: var(--bg-soft);
  min-height: 100vh;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  border: none;
  padding: 0;
}
.auth-brand p {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
}

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
  background: var(--bg-soft);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.field { display: block; margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-msg {
  font-size: 13px;
  margin: 4px 0 12px;
  min-height: 18px;
}
.form-msg.error { color: var(--red); }
.form-msg.success { color: var(--green); }

.auth-submit { width: 100%; margin-top: 6px; }

/* 蜜罐字段：4 种隐藏方式叠加，确保对真人完全不可见
   - position:absolute  + left:-9999px  移出视口
   - opacity:0          透明
   - pointer-events:none 禁止鼠标交互
   - tabindex=-1 已在 HTML 标记键盘跳过
   自动化脚本若使用「按 label / name 填充」会落入该字段，被服务端判为 bot */
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.auth-foot {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-light);
}
.auth-foot a { color: var(--accent); }

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* --- 已登录：仪表板 --- */
.account-page {
  padding: calc(var(--nav-height) + 32px) 0 64px;
}

.account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.account-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-greeting {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  border: none;
  padding: 0;
  color: var(--text);
}
.account-sub {
  font-size: 13px;
  color: var(--text-light);
  margin: 4px 0 0;
}
.account-sub #meEmail { color: var(--text); font-weight: 500; }
.account-sep { margin: 0 6px; opacity: 0.4; }
.account-edit-link {
  margin-left: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
}
.account-edit-link:hover { border-bottom-color: var(--accent); }

/* ============================================
   邮箱修改弹窗（双因素：密码 + 6 位邮件验证码）
   ============================================ */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: relative;
  width: min(440px, 92vw);
  max-height: 90vh; overflow-y: auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
  animation: modal-in .2s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--text-light);
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px 24px; }

/* 步骤指示器 */
.modal-steps {
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 20px;
  font-size: 12px; color: var(--text-light);
}
.modal-step { flex: 1; text-align: center; padding: 6px 0; border-bottom: 2px solid var(--border, #e5e7eb); transition: all .15s; }
.modal-step.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 步骤面板 */
.modal-step-pane { display: none; }
.modal-step-pane.active { display: block; }

/* 表单行（弹窗内） */
.modal .form-row { margin-bottom: 14px; }
.modal .form-row label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.modal .form-row input[type=email],
.modal .form-row input[type=password],
.modal .form-row input[type=text] {
  width: 100%; padding: 10px 12px;
  font-size: 14px; color: var(--text);
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.modal .form-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
  background: var(--card);
}
.form-hint { display: block; font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ============================================
   邮箱验证面板（注册后 / Magic Link）
   ============================================ */
.verify-icon {
  font-size: 40px; text-align: center; margin-bottom: 8px;
}
.verify-title {
  text-align: center; font-size: 18px; font-weight: 600;
  margin: 0 0 8px; color: var(--text);
}
.verify-desc {
  text-align: center; font-size: 13px; color: var(--text-light);
  margin: 0 0 8px; line-height: 1.6;
}
.verify-desc strong {
  color: var(--accent); font-weight: 600; word-break: break-all;
}
.modal-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px;
}

/* OTP 6 位验证码框 */
.otp-box-group {
  display: flex; gap: 8px; justify-content: space-between;
  margin: 8px 0;
}
.otp-box {
  width: 44px; height: 52px;
  text-align: center; font-size: 24px; font-weight: 600;
  font-family: 'SF Mono', 'Courier New', monospace;
  background: var(--bg, #f9fafb);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  background: var(--card);
}

/* 弹窗按钮组 */
.modal-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.modal-actions .btn { flex: 1; }
.btn-block { width: 100%; padding: 10px 16px; font-size: 14px; }

/* 重新发送倒计时 */
.resend-hint {
  text-align: center; font-size: 13px; color: var(--text-light);
  margin: 16px 0 0;
}
.resend-hint a { color: var(--accent); text-decoration: none; }
.resend-hint a:hover { text-decoration: underline; }
#emailCountdown { color: var(--text-light); margin-left: 4px; }

/* 成功步骤 */
.modal-success { text-align: center; padding: 24px 0; }
.modal-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: #10b981; color: white; font-size: 32px; font-weight: 700;
  margin-bottom: 12px;
}
.modal-success h4 { margin: 0 0 8px; font-size: 17px; }
.modal-success p { margin: 0; color: var(--text-light); font-size: 14px; }
.modal-success strong { color: var(--text); font-weight: 600; }

/* 移动端适配 */
@media (max-width: 480px) {
  .modal-dialog { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .otp-box { width: 38px; height: 46px; font-size: 20px; }
}

.account-hero-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.sub-badge.active { background: var(--green-bg); color: var(--green); border-color: transparent; }
.sub-badge.expired { background: var(--orange-bg); color: var(--orange); border-color: transparent; }

.account-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.account-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: flex-start;
}

.account-nav {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.account-nav li { margin: 0; }
.account-nav a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 3px solid transparent;
}
.account-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.account-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-foot { padding: 0 4px; }

.account-main { min-width: 0; }

.account-section { display: none; }
.account-section.active { display: block; }

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px;
  border: none;
  padding: 0;
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-unit { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.stat-foot { font-size: 12px; color: var(--text-light); }

/* 通用卡片头 */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.card-meta { font-size: 12px; color: var(--text-light); }

/* 流量进度 */
.traffic-card { margin-bottom: 0; }

/* 每日 API 配额卡：与 traffic-card 同结构但用独立色，避免与流量进度条混淆 */
.quota-card { margin-top: 16px; }
.quota-card .card-meta { color: var(--accent); font-weight: 600; }
.quota-card .progress-bar { background: linear-gradient(90deg, #06b6d4, #6366f1); }  /* cyan → indigo 区分流量色 */
.quota-card .progress-bar.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.quota-card .quota-hint { margin: 12px 0 0; font-size: 12px; line-height: 1.6; }
.quota-card .quota-formula { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-2); padding: 6px 10px; background: var(--bg-2, rgba(99,102,241,0.06)); border-radius: 6px; border-left: 3px solid var(--accent); }

.progress {
  width: 100%;
  height: 10px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #7c3aed 100%);
  transition: width 0.4s ease;
}
.progress-bar.warn { background: linear-gradient(90deg, var(--orange) 0%, #ef4444 100%); }

.progress-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.progress-foot strong { color: var(--text); font-weight: 600; }

/* 订阅卡片 */
.sub-current { margin-bottom: 24px; }

.sub-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sub-detail {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  font-size: 14px;
}
.sub-detail dt { color: var(--text-light); }
.sub-detail dd { color: var(--text); margin: 0; font-weight: 500; }

.sub-actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
}
.plan-card.featured {
  border-color: var(--accent);
  background: var(--accent-light);
}
.plan-card h3 { font-size: 16px; margin: 0 0 4px; }
.plan-card .price {
  font-size: 28px;
  font-weight: 700;
  margin: 8px 0 2px;
  color: var(--text);
}
.plan-card .price span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plan-card ul {
  list-style: none;
  margin: 14px 0 16px;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.plan-card ul li {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-card ul li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
}
.plan-card .btn { width: 100%; }

/* API Key */
.key-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.key-item .key-prefix {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.key-item .key-meta { flex: 1; min-width: 0; }
.key-item .key-desc {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.key-item .key-time { font-size: 12px; color: var(--text-light); }
.key-item .key-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
}
.key-item .key-status.disabled { background: var(--bg-soft); color: var(--text-light); }

.key-item-empty {
  text-align: center;
  padding: 28px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 14px;
}
.key-item-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.key-item-empty .step {
  font-size: 12px;
  margin-top: 12px;
  text-align: left;
  display: inline-block;
}
.key-item-empty .step div { margin: 2px 0; }

.key-divider {
  display: flex;
  align-items: center;
  margin: 22px 0 16px;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.key-divider::before,
.key-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  border-top: 1px dashed var(--border);
}
.key-divider span { padding: 0 12px; }

.key-create-form { display: flex; gap: 10px; align-items: flex-end; }
.key-create-form .field { flex: 1; margin-bottom: 0; }
.key-create-form .btn { white-space: nowrap; }

.key-result { margin-top: 18px; }
.key-result .info-box p { margin: 6px 0 0; font-size: 13px; }

/* 订单 */
.order-list { display: flex; flex-direction: column; gap: 10px; }

.order-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.order-item .order-subject { font-weight: 500; color: var(--text); }
.order-item .order-amount { font-weight: 700; color: var(--text); }
.order-item .order-time { font-size: 12px; color: var(--text-light); }
.order-item .order-no { font-family: var(--font-mono); font-size: 12px; color: var(--text-light); }

.order-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}
.order-status.paid { background: var(--green-bg); color: var(--green); }
.order-status.pending { background: var(--orange-bg); color: var(--orange); }
.order-status.closed { background: var(--bg-soft); color: var(--text-light); }

.order-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-light);
  font-size: 14px;
}

/* 小屏适配 */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-detail { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .account-hero { flex-direction: column; align-items: flex-start; }
  .account-hero-right { width: 100%; justify-content: space-between; }
  .order-item { grid-template-columns: 1fr 1fr; }
  .order-item .order-no { grid-column: 1 / -1; }
  .key-create-form { flex-direction: column; align-items: stretch; }
}

/* Personal center 移动端：在所有 .account-* 基类之后，覆盖源序问题 */
@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { position: static; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
}
