/* ===== 全局变量 ===== */
:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --text: #1a1a1a;
  --text2: #666666;
  --text3: #999999;
  --border: #e8e6e0;
  --border2: #f0efe9;
  --profit: #dc2626;
  --loss: #15945f;
  --buy: #dc2626;
  --sell: #16a34a;
  --accent: #1a56db;
  --accent-light: #eff6ff;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-width: 1024px;
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ===== 导航栏 ===== */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.navbar-logo {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-logo svg { width: 22px; height: 22px; }
.navbar-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.navbar-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.15s;
}
.navbar-nav a:hover { background: var(--border2); color: var(--text); }
.navbar-nav a.active { color: var(--text); font-weight: 700; background: var(--border2); }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-version {
  padding: 4px 8px;
  border: 1px solid #cdd8f5;
  border-radius: 999px;
  background: #f1f5ff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
}
.app-version:hover { background: #e7edff; border-color: #aebfeb; }
.update-time {
  font-size: 12px;
  color: var(--text3);
}
.btn-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-refresh:hover { border-color: var(--text3); color: var(--text); }
.btn-refresh svg { width: 14px; height: 14px; }
.btn-refresh.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 主内容 ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}
.view { display: none; }
.view.active { display: block; }

/* ===== 统计卡片 ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.home-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.stat-label {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.stat-value.profit { color: var(--profit); }
.stat-value.loss { color: var(--loss); }
.stat-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}
.pending-investment { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #f2dfb8; color: #9a650d; font-size: 11px; }
.pending-investment strong { padding: 3px 8px; border-radius: 999px; background: #fff4d8; color: #c77600; font-size: 12px; }

/* ===== 区块标题 ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .actions { display: flex; gap: 8px; }
.update-log-current { color: var(--text3); font-size: 12px; font-weight: 500; }
.updates-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0 22px;
}
.updates-header h1 { margin: 2px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.updates-header p { margin: 0; color: var(--text2); font-size: 14px; }
.updates-eyebrow { color: var(--accent) !important; font-size: 11px !important; font-weight: 800; letter-spacing: .14em; }
.update-log-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.update-log-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 22px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border2);
}
.update-log-item:last-child { border-bottom: 0; }
.update-log-item.latest { background: linear-gradient(90deg, rgba(49,87,213,.055), transparent 58%); }
.update-log-meta { display: flex; align-items: center; gap: 8px; align-self: start; }
.version-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.update-log-meta time { color: var(--text3); font-size: 11px; }
.update-log-item h3 { margin: 0 0 5px; font-size: 14px; }
.update-log-item p { margin: 0; color: var(--text2); font-size: 13px; line-height: 1.65; }

/* ===== 按钮 ===== */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--text3); background: var(--border2); }
.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover { background: #333; border-color: #333; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

/* ===== 表格 ===== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 28px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: var(--border2);
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text2);
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: #fafaf7; }
.fund-name { font-weight: 600; }
.fund-code { color: var(--text3); font-size: 12px; margin-left: 6px; }
.nav-delay-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 6px;
  border: 1px solid #d8e0ee;
  border-radius: 999px;
  background: #f5f7fb;
  color: #657086;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: 1px;
}
.nav-delay-badge.qdii,
.nav-delay-badge.qdii-etf { border-color: #d9ccff; background: #f5f0ff; color: #6d3fd1; }
.nav-delay-badge.crypto { border-color: #f1d49c; background: #fff8e8; color: #94620b; }
.nav-delay-badge.cn-etf { border-color: #bedfd3; background: #edf9f4; color: #26715b; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-domestic { background: #f0fdf4; color: #15803d; }
.tag-ofund { background: #eff6ff; color: #1d4ed8; }
.tag-overseas { background: #fef3c7; color: #b45309; }
.tag-crypto { background: #f3e8ff; color: #7c3aed; }
.profit-text { color: var(--profit); font-weight: 600; }
.loss-text { color: var(--loss); font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
}
.timeline-dot.buy { border-color: var(--buy); }
.timeline-dot.sell { border-color: var(--sell); }
.timeline-date {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 4px;
}
.timeline-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.badge-buy { background: var(--buy); }
.badge-sell { background: var(--sell); }
.timeline-fund { font-weight: 600; font-size: 14px; }
.timeline-detail {
  font-size: 12px;
  color: var(--text2);
}
.timeline-detail span { margin-right: 16px; }

/* ===== 账本卡片（首页） ===== */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all 0.15s;
  display: grid;
  grid-template-columns: minmax(190px, .62fr) minmax(420px, 1.38fr);
  align-items: center;
  gap: 20px 28px;
}
/* 顶部持仓主题圆环 */
.theme-stat-card { padding: 18px 16px; }
.allocation-chart { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; }
.allocation-donut { position: relative; flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; contain: layout paint; }
.allocation-donut::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(226,231,241,.8); }
.allocation-donut-center { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.allocation-donut-center strong { font-size: 15px; line-height: 1; }
.allocation-donut-center span { margin-top: 2px; color: var(--text3); font-size: 8px; }
.allocation-legend { flex: 1; min-width: 0; overflow: hidden; }
.allocation-legend-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) 38px; align-items: center; gap: 5px; padding: 2px 0; font-size: 9px; line-height: 1.4; }
.allocation-legend-row i { width: 8px; height: 8px; border-radius: 50%; }
.allocation-legend-row span { overflow: hidden; color: var(--text2); text-overflow: ellipsis; white-space: nowrap; }
.allocation-legend-row strong { text-align: right; }
.allocation-empty { display: grid; min-height: 76px; place-items: center; color: var(--text3); font-size: 11px; }

/* 总体 / 单账本资产走势 */
.portfolio-trend-card {
  margin-bottom: 30px;
  padding: 22px 24px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff 0%, #f8faff 100%);
  box-shadow: 0 10px 35px rgba(31, 50, 88, .055);
}
.portfolio-trend-card.compact { margin-top: -2px; }
.portfolio-trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.portfolio-trend-head h2 { margin: 2px 0 3px; font-size: 19px; letter-spacing: -.02em; }
.portfolio-trend-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.portfolio-trend-desc { color: var(--text3); font-size: 11px; }
.portfolio-trend-ranges { display: flex; gap: 3px; padding: 3px; border: 1px solid #e2e7f0; border-radius: 9px; background: #f2f5fa; }
.portfolio-trend-ranges button { min-width: 42px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text3); font-size: 11px; }
.portfolio-trend-ranges button:hover { color: var(--text); }
.portfolio-trend-ranges button.active { background: #fff; color: var(--accent); font-weight: 700; box-shadow: 0 2px 7px rgba(31, 50, 88, .1); }
.portfolio-trend-summary { display: flex; flex-wrap: wrap; gap: 10px; min-height: 48px; padding: 15px 0 3px; }
.trend-summary-item { min-width: 130px; padding-right: 18px; border-right: 1px solid var(--border2); }
.trend-summary-item:last-child { border-right: 0; }
.trend-summary-item span { display: block; margin-bottom: 1px; color: var(--text3); font-size: 10px; }
.trend-summary-item strong { font-size: 15px; }
.portfolio-trend-chart { width: 100%; height: 350px; }
.portfolio-trend-note { margin: 5px 0 0; color: var(--text3); font-size: 10px; line-height: 1.6; }

/* 定投策略卡片 */
.dca-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 15px;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.dca-item:hover { border-color: #b8c5e8; box-shadow: 0 8px 24px rgba(39,58,108,.07); }
.dca-item.has-pending { border-color: #f3c46b; box-shadow: inset 3px 0 0 #f59e0b; }
.dca-card-head, .dca-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dca-identity { min-width: 0; }
.dca-item-name { margin-right: 9px; font-size: 15px; font-weight: 750; }
.dca-item .fund-code { font-size: 12px; }
.dca-badges { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.dca-badges .valuation-status { padding: 2px 8px; font-size: 11px; }
.dca-item .nav-delay-badge { margin-left: 0; }
.dca-pending {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 96px;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f4f6fa;
  color: var(--text3);
  font-size: 11px;
}
.dca-pending strong { color: var(--text2); font-size: 24px; line-height: 1; }
.dca-pending.active { background: #fff4dc; color: #9a5b00; }
.dca-pending.active strong { color: #d27600; }
.dca-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 13px;
  padding: 13px 0;
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
}
.dca-metrics div { padding: 0 12px; border-right: 1px solid var(--border2); }
.dca-metrics div:first-child { padding-left: 0; }
.dca-metrics div:last-child { border-right: 0; }
.dca-metrics span { display: block; margin-bottom: 4px; color: var(--text3); font-size: 10px; }
.dca-metrics strong { font-size: 14px; }
.dca-item-meta { flex: 1; min-width: 220px; font-size: 11px; color: var(--text3); line-height: 1.6; }
.dca-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.dca-item-actions .btn { padding: 3px 10px; font-size: 12px; }
.sort-btn { min-width: 29px; padding-left: 7px !important; padding-right: 7px !important; font-weight: 800; }
.sort-hint { color: var(--text3); font-size: 11px; font-weight: 400; }
.holding-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 176px; }
.holding-actions-primary, .holding-actions-secondary { display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-add-one { min-height: 28px; padding: 3px 9px !important; border-color: #b9c8f1; color: var(--accent); background: #f4f7ff; font-weight: 700; }
.btn-add-one span { font-size: 14px; line-height: 1; }
.holding-pending-chip { padding: 4px 8px; border: 0; border-radius: 999px; background: #fff1d5; color: #b56900; font-size: 10px; font-weight: 800; cursor: pointer; }
.action-link { padding: 2px 4px; border: 0; background: transparent; color: var(--text3); font-size: 10px; cursor: pointer; }
.action-link:hover { color: var(--accent); }
.action-link.danger:hover { color: var(--loss); }
.dca-edit-notice {
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid #cdd9fb;
  border-radius: 9px;
  background: #f2f6ff;
  color: #3556a8;
  line-height: 1.55;
}
.form-input[readonly], .form-select:disabled {
  background: #f4f6f9;
  color: var(--text3);
  cursor: not-allowed;
}
.plan-card:hover { border-color: var(--text3); box-shadow: var(--shadow); }
.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
  padding-right: 26px;
  border-right: 1px solid var(--border2);
}
.plan-enter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #eef3ff; color: var(--accent); font-size: 18px; transition: transform .16s, background .16s; }
.plan-card:hover .plan-enter { transform: translateX(3px); background: #dfe8ff; }
.plan-name {
  font-size: 18px;
  font-weight: 700;
}
.plan-days {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.plan-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 0;
}
.plan-stat-label { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.plan-stat-value { font-size: 16px; font-weight: 700; }
.plan-holdings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border2);
  grid-column: 1 / -1;
  align-items: center;
}
.plan-holdings-label { margin-right: 2px; color: var(--text3); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.plan-holding-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--border2);
  border-radius: 4px;
  color: var(--text2);
}
.plan-holding-tag.more { background: #eef3ff; color: var(--accent); }
.plan-holding-empty { color: var(--text3); font-size: 11px; }
.table-sort { margin: -5px -7px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.table-sort:hover { background: #e8edf7; color: var(--text); }
.table-sort.active { background: #e4ebff; color: var(--accent); }
.table-sort span { margin-left: 2px; font-size: 11px; }
.position-share { display: inline-flex; min-width: 48px; justify-content: center; padding: 3px 7px; border-radius: 999px; background: #f0f3f8; color: var(--text2); font-size: 11px; font-weight: 700; }

/* ===== 基金详情页 ===== */
.fund-header {
  margin-bottom: 24px;
}
.fund-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.fund-title { font-size: 24px; font-weight: 900; }
.fund-title-code { font-size: 18px; color: var(--text3); font-weight: 400; }
.fund-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text2);
}
.fund-meta span { display: flex; align-items: center; gap: 4px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 14px; height: 14px; }

/* ===== 图表容器 ===== */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.chart-title { font-size: 16px; font-weight: 700; }
.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--border2);
  border-radius: 6px;
  padding: 3px;
}
.chart-tab {
  border: none;
  background: none;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  color: var(--text2);
  font-weight: 500;
  transition: all 0.15s;
}
.chart-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.chart-container { width: 100%; height: 360px; }

/* ===== 持仓信息卡片 ===== */
.holding-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.holding-info-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border2);
}
.holding-info-item .label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.holding-info-item .value { font-size: 22px; font-weight: 700; }
.holding-info-bottom {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.holding-info-bottom .label { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.holding-info-bottom .value { font-size: 14px; font-weight: 600; }

/* ===== 估值看板 ===== */
.valuation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.valuation-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.valuation-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.valuation-code { font-size: 11px; color: var(--text3); margin-bottom: 14px; }
.valuation-bar-wrap { margin-bottom: 10px; }
.valuation-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 4px;
}
.valuation-bar {
  height: 8px;
  background: var(--border2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.valuation-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.valuation-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}
.status-low { background: #dcfce7; color: #15803d; }
.status-mid { background: #fef9c3; color: #a16207; }
.status-high { background: #fee2e2; color: #b91c1c; }
.valuation-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border2);
}
.valuation-num .label { font-size: 10px; color: var(--text3); }
.valuation-num .value { font-size: 13px; font-weight: 600; }

/* ===== 指数页面 ===== */
.indices-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.index-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all 0.15s;
}
.index-card:hover { border-color: var(--text3); }
.index-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.index-code { font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.index-price { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.index-change { font-size: 13px; font-weight: 600; }
.index-spark { height: 40px; margin-top: 10px; }

/* ===== 模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
@keyframes modalAttention {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}
.modal.modal-attention { animation: modalAttention .24s ease; }
.modal {
  background: var(--card);
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-wide { width: 560px; }
.history-dca-summary {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #d9e2f8;
  border-radius: 8px;
  background: #f5f8ff;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.6;
}
.history-change-card {
  margin-bottom: 16px;
  padding: 16px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}
.history-change-title { margin-bottom: 13px; font-size: 13px; font-weight: 700; }
.history-change-card .form-group { margin-bottom: 8px; }
.history-preview {
  margin: 16px 0 10px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #f1f5ff;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.65;
}
.holding-buy-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}
.holding-buy-info strong { font-size: 14px; }
.holding-buy-info span { color: var(--text3); font-size: 11px; }
.holding-buy-rule { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; color: var(--text2); font-size: 12px; line-height: 1.6; }
.pending-buy-list { margin-top: 14px; }
.pending-buy-title { margin-bottom: 7px; color: #9a5b00; font-size: 12px; font-weight: 700; }
.pending-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid #f2dfb8; background: #fffaf0; color: var(--text2); font-size: 12px; }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--card);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--text);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ===== 加载态 ===== */
.loading-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text3);
  font-size: 13px;
}
.loading-dot {
  width: 6px; height: 6px;
  background: var(--text3);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ===== 基金库 ===== */
.fund-search-bar {
  margin-bottom: 20px;
}
.fund-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  transition: border-color 0.15s;
}
.fund-search-input-wrap:focus-within {
  border-color: var(--text);
}
.fund-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--text);
}
.fund-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.fund-cat-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.fund-cat-btn:hover {
  border-color: var(--text3);
  color: var(--text);
}
.fund-cat-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.fund-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.fund-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  transition: all 0.15s;
  cursor: pointer;
}
.fund-item:hover {
  border-color: var(--text3);
  box-shadow: var(--shadow);
}
.fund-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fund-item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fund-item-code {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}
.fund-item-spark {
  width: 100%;
  height: 44px;
  margin-top: auto;
}
.fund-item-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-width: 110px;
}
.fund-item-price {
  font-size: 18px;
  font-weight: 700;
}
.fund-item-change {
  font-size: 13px;
  font-weight: 600;
}
.fund-item-holding {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--border2);
  color: var(--text2);
  line-height: 1.4;
}
.fund-item-holding.has-profit {
  background: #f0fdf4;
  color: #15803d;
}
.fund-item-holding.has-loss {
  background: #fef2f2;
  color: #b91c1c;
}
.fund-item-holding .holding-label {
  font-size: 10px;
  opacity: 0.7;
  display: block;
}
.fund-item-holding .holding-value {
  font-weight: 700;
  font-size: 12px;
}
.fund-item-add {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fund-item-add:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.fund-item-add svg { width: 12px; height: 12px; }
.fund-search-result-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.fund-search-result-item:hover {
  border-color: var(--text3);
}

/* ===== 基金库表格 ===== */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.sort-arrow { font-size: 10px; color: var(--text3); }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text3);
  border-top: 1px solid var(--border);
}
.pager .btn { margin-left: 8px; }
.tag-venue {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-venue-etf { background: #eff6ff; color: #1d4ed8; }
.tag-venue-otc { background: #f0fdf4; color: #15803d; }
.cell-ellip { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.stage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; text-align: center; padding: 4px 0; }
.stage-item .label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.stage-item .value { font-size: 16px; font-weight: 700; }
.fund-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
.fund-info-item .label { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.fund-info-item .value { font-size: 13px; font-weight: 600; word-break: break-all; white-space: normal; }
.fund-info-item.wide { grid-column: 1 / -1; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px 0;
  font-size: 12px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== 2026 视觉升级：清爽、克制的资产工作台 ===== */
:root {
  --bg: #f3f6fb;
  --card: rgba(255,255,255,0.96);
  --text: #172033;
  --text2: #5d687c;
  --text3: #8b95a7;
  --border: #dfe5ef;
  --border2: #edf1f7;
  --profit: #dc3f55;
  --loss: #15945f;
  --buy: #e0445e;
  --sell: #0f9f6e;
  --accent: #3157d5;
  --accent-strong: #2444b8;
  --accent-light: #edf2ff;
  --shadow: 0 10px 30px rgba(27,39,69,0.07), 0 2px 8px rgba(27,39,69,0.04);
  --shadow-hover: 0 16px 40px rgba(32,51,101,0.12), 0 4px 12px rgba(32,51,101,0.06);
  --radius: 14px;
}
html { scroll-behavior: smooth; }
body {
  min-width: 0;
  min-height: 100vh;
  font-family: 'Noto Sans SC', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  font-size: 15px;
  background:
    radial-gradient(circle at 12% -12%, rgba(86,117,226,0.13), transparent 32rem),
    linear-gradient(180deg, #f8faff 0, var(--bg) 24rem);
  font-variant-numeric: tabular-nums;
}
button, input, select { font-size: max(16px, 1em); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(49,87,213,0.24);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--text);
  color: white;
  transform: translateY(-150%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.navbar {
  background: rgba(248,250,255,0.86);
  border-bottom-color: rgba(213,221,235,0.9);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.75);
}
.navbar-inner { max-width: 1320px; height: 68px; padding: 0 36px; gap: 34px; }
.navbar-logo { font-size: 18px; letter-spacing: -0.4px; color: #152654; }
.navbar-logo svg {
  width: 34px;
  height: 34px;
  padding: 7px;
  color: white;
  border-radius: 10px;
  background: linear-gradient(145deg, #4e70e1, #2748bd);
  box-shadow: 0 7px 16px rgba(49,87,213,0.26);
}
.navbar-nav { gap: 6px; }
.navbar-nav a { padding: 9px 14px; border-radius: 9px; color: #667085; }
.navbar-nav a:hover { background: rgba(49,87,213,0.07); color: var(--accent); }
.navbar-nav a.active { color: var(--accent); background: var(--accent-light); }
.btn-refresh { border-radius: 9px; padding: 8px 12px; background: rgba(255,255,255,0.74); }

.main { max-width: 1320px; padding: 34px 36px 72px; }
.stats-row { gap: 18px; margin-bottom: 34px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 22px 24px;
  border-color: rgba(220,227,239,0.92);
  box-shadow: var(--shadow);
}
.stat-card::after {
  content: '';
  position: absolute;
  width: 82px;
  height: 82px;
  right: -30px;
  top: -34px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(49,87,213,0.13), rgba(49,87,213,0));
}
.stat-label { font-size: 13px; letter-spacing: .02em; color: var(--text2); }
.stat-value { font-size: clamp(23px, 2vw, 29px); line-height: 1.25; letter-spacing: -0.04em; }
.stat-sub { font-size: 12px; margin-top: 7px; }
.section-title { margin: 4px 0 16px; font-size: 19px; letter-spacing: -.02em; }
.section-title > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.section-title > span:first-child::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 99px;
  background: linear-gradient(180deg, #6f8bec, var(--accent));
}

.btn, .btn-refresh, .fund-cat-btn, .fund-item-add {
  min-height: 36px;
  border-radius: 9px;
  border-color: #d9e0ec;
  transition: transform .16s ease, box-shadow .16s ease, color .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover, .btn-refresh:hover, .fund-item-add:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(35,49,82,0.09); }
.btn-primary {
  background: linear-gradient(145deg, #4165dd, #294bc4);
  border-color: #3157d5;
  box-shadow: 0 7px 16px rgba(49,87,213,0.2);
}
.btn-primary:hover { background: linear-gradient(145deg, #365bd3, #213fae); border-color: #2748bd; }

.table-wrap, .chart-card, .holding-info-card, .valuation-card, .index-card,
.plan-card, .dca-item, .timeline-content, .fund-search-input-wrap, .fund-item, .fund-search-result-item {
  border-color: rgba(220,227,239,0.95);
  box-shadow: var(--shadow);
}
.table-wrap { border-radius: var(--radius); }
thead th { padding: 12px 14px; background: #f4f7fc; color: #657086; letter-spacing: .02em; }
tbody td { padding: 12px 14px; }
tbody tr:hover { background: #f6f8fd; }
.plan-grid { gap: 18px; margin-bottom: 34px; }
.plan-card { padding: 24px; }
.plan-card:hover, .fund-item:hover, .valuation-card:hover, .index-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2e8;
  box-shadow: var(--shadow-hover);
}
.plan-card, .valuation-card, .index-card, .fund-item { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.plan-name { font-size: 19px; letter-spacing: -.02em; }
.plan-holding-tag { padding: 4px 9px; border-radius: 7px; background: #f1f4fa; }
.timeline-content { padding: 16px 18px; }
.timeline-dot { box-shadow: 0 0 0 4px var(--bg); }

.fund-header { margin: 6px 0 28px; }
.fund-title { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
.chart-card { padding: 24px; }
.chart-tabs { border-radius: 9px; padding: 4px; }
.chart-tab { border-radius: 7px; min-height: 34px; }
.chart-tab.active { color: var(--accent); box-shadow: 0 2px 8px rgba(31,50,88,.1); }
.fund-search-input-wrap { padding: 14px 18px; background: rgba(255,255,255,.96); }
.fund-search-input-wrap:focus-within { border-color: #91a7e8; box-shadow: 0 0 0 4px rgba(49,87,213,.09), var(--shadow); }
.fund-cat-btn { padding: 7px 15px; }
.fund-cat-btn.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 5px 13px rgba(49,87,213,.18); }

.modal-overlay { padding: 20px; background: rgba(17,25,45,0.48); backdrop-filter: blur(6px); }
.modal { border: 1px solid rgba(255,255,255,.65); border-radius: 18px; box-shadow: 0 28px 80px rgba(16,28,58,.26); }
.modal-header { padding: 20px 24px; }
.modal-title { letter-spacing: -.02em; }
.modal-close { width: 34px; height: 34px; border-radius: 9px; }
.modal-close:hover { background: var(--border2); color: var(--text); }
.form-label { font-size: 14px; }
.form-input, .form-select { min-height: 44px; border-radius: 9px; border-color: #d7deea; }
.form-input:focus, .form-select:focus { border-color: #6f8bec; box-shadow: 0 0 0 4px rgba(49,87,213,.1); }
.footer { max-width: 1248px; margin: 40px auto 0; }

@media (max-width: 980px) {
  .navbar-inner { padding: 0 22px; gap: 18px; }
  .navbar-nav { overflow-x: auto; scrollbar-width: none; }
  .navbar-nav::-webkit-scrollbar { display: none; }
  .navbar-nav a { white-space: nowrap; }
  .update-time { display: none; }
  .main { padding: 28px 22px 60px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .valuation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indices-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .holding-info-bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-card { grid-template-columns: minmax(180px, .7fr) minmax(380px, 1.3fr); }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .navbar { position: static; }
  .navbar-inner { height: auto; padding: 14px 16px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .navbar-logo svg { width: 31px; height: 31px; }
  .navbar-right { justify-self: end; }
  .btn-refresh { font-size: 0; width: 38px; height: 38px; padding: 10px; }
  .btn-refresh svg { width: 17px; height: 17px; }
  .navbar-nav { grid-column: 1 / -1; width: calc(100% + 32px); margin-left: -16px; padding: 0 12px 10px; }
  .navbar-nav a { padding: 8px 11px; }
  .main { padding: 22px 16px 48px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
  .stat-card { min-height: 108px; padding: 17px 16px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: clamp(20px, 6vw, 25px); }
  .section-title { align-items: flex-start; gap: 12px; }
  .section-title .actions { flex-wrap: wrap; justify-content: flex-end; }
  .plan-grid, .fund-list, .valuation-grid, .indices-grid { grid-template-columns: 1fr; gap: 12px; }
  .plan-card { display: block; padding: 19px 17px; }
  .plan-card-header { margin-bottom: 16px; padding-right: 0; border-right: 0; }
  .plan-stats { gap: 8px; margin-bottom: 14px; }
  .plan-stat-value { font-size: 14px; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .allocation-chart { min-height: 70px; }
  .portfolio-trend-card { padding: 18px 14px 14px; }
  .portfolio-trend-head { flex-direction: column; gap: 12px; }
  .portfolio-trend-ranges { width: 100%; overflow-x: auto; }
  .portfolio-trend-ranges button { flex: 1; min-width: 44px; }
  .portfolio-trend-chart { height: 320px; }
  .dca-item { padding: 16px; }
  .dca-card-head { align-items: flex-start; }
  .dca-pending { min-width: 86px; }
  .dca-metrics { grid-template-columns: 1fr 1fr; }
  .dca-metrics div:nth-child(2) { border-right: 0; }
  .dca-metrics div:nth-child(-n+2) { padding-bottom: 10px; border-bottom: 1px solid var(--border2); }
  .dca-metrics div:nth-child(n+3) { padding-top: 10px; }
  .dca-card-foot { align-items: flex-start; flex-direction: column; }
  .dca-item-meta { min-width: 100%; }
  .dca-item-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .sort-hint { display: none; }
  .table-wrap { margin-right: -16px; border-radius: 12px 0 0 12px; }
  table { min-width: 780px; }
  .chart-card { padding: 18px 14px; }
  .chart-header { align-items: flex-start; gap: 12px; flex-direction: column; }
  .chart-container { height: 300px; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .fund-info-grid { grid-template-columns: 1fr 1fr; }
  .holding-info-top { gap: 14px; }
  .holding-info-bottom { grid-template-columns: 1fr 1fr; }
  .fund-title-row { align-items: flex-start; flex-direction: column; gap: 2px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { width: 100%; max-width: none; max-height: 92vh; border-radius: 18px 18px 12px 12px; }
  .modal-body { padding: 20px; }
  .empty-state { padding: 44px 16px; }
  .footer { margin-top: 26px; padding: 24px 16px; }
}

@media (max-width: 410px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { min-height: 0; }
  .portfolio-trend-chart { height: 300px; }
  .section-title { flex-direction: column; }
  .section-title .actions { width: 100%; justify-content: flex-start; }
  .update-log-item { grid-template-columns: 1fr; gap: 9px; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===== 私有登录与云端同步 ===== */
.auth-pending > :not(.auth-gate):not(script) { visibility: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 16% 10%, rgba(106,134,232,.26), transparent 30rem),
    radial-gradient(circle at 88% 92%, rgba(49,87,213,.18), transparent 34rem),
    #f3f6fb;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 28px 80px rgba(26,45,92,.16);
  backdrop-filter: blur(18px);
}
.auth-brand {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #4e70e1, #2748bd);
  box-shadow: 0 10px 22px rgba(49,87,213,.3);
}
.auth-brand svg { width: 25px; height: 25px; }
.auth-eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.auth-card h1 { margin: 0; color: var(--text); font-size: 29px; letter-spacing: -.04em; }
.auth-copy { margin: 10px 0 28px; color: var(--text2); font-size: 14px; }
.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 7px; font-size: 14px; font-weight: 650; }
.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #d5ddeb;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
}
.auth-form input:focus { border-color: #6f8bec; outline: 0; box-shadow: 0 0 0 4px rgba(49,87,213,.1); }
.auth-error { min-height: 22px; margin: 3px 0 0; color: var(--loss); font-size: 13px; }
.auth-submit { width: 100%; min-height: 46px; justify-content: center; margin-top: 3px; font-size: 15px; }
.sync-status { color: var(--text3); font-size: 12px; white-space: nowrap; }
.sync-status.syncing { color: var(--accent); }
.sync-status.error { color: var(--loss); }
.btn-logout { white-space: nowrap; }
@media (max-width: 680px) {
  .auth-card { padding: 30px 24px; border-radius: 20px; }
  .sync-status { display: none; }
  .btn-logout { width: auto; padding: 8px 10px; font-size: 12px; }
  .form-input, .form-select, .auth-form input { font-size: 16px; }
}
