/* 注：颜色 token 由 css/skin.css 提供（必须先加载）
   这里只保留非颜色变量 */
:root {
  --radius: 8px;
  /* 阴影跟随主题基础色微调 */
  --shadow: 0 1px 2px var(--shadow-soft), 0 14px 34px var(--base-glow);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#siteHeader,
#siteFooter {
  flex: 0 0 auto;
}

.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.page-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 8px 0 28px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 12px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  background: #fff;
  border: 1px solid var(--base-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 48px;
  box-shadow: var(--shadow);
}

.search-icon {
  display: inline-flex;
  margin-right: 8px;
}

#searchInput {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
  height: 100%;
  background: transparent;
  color: var(--text);
}

.clear-btn {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.clear-btn:hover {
  color: var(--text-mid);
}

.primary-btn {
  background: var(--base-gradient);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  padding: 0 28px;
  height: 48px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px var(--base-glow);
}

.primary-btn:hover {
  background: var(--base-hover);
  box-shadow: 0 12px 28px var(--base-glow);
}

.primary-btn.wide {
  min-width: 200px;
}

.primary-btn:disabled {
  background: var(--text-soft);
  cursor: not-allowed;
}

.section-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 6px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.section-subtitle .hl {
  color: var(--accent);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  margin-top: 32px;
}

.empty-hint code {
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.tables-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.stock-table th,
.stock-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.stock-table thead th {
  background: var(--base-gradient);
  color: #fff;
  font-weight: 600;
  border-color: var(--base);
}

.stock-table thead th.first-col {
  background: var(--base);
  font-size: 13px;
  line-height: 1.4;
}

.stock-table td.metric-name {
  color: var(--text);
  background: var(--bg);
  font-weight: 500;
  text-align: center;
}

.stock-table td.pos {
  color: var(--up);
}

.stock-table td.neg {
  color: var(--down);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Metric chip bar ===== */
.metric-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 20px;
}

.metric-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.metric-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.metric-chip {
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-mid);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  line-height: 24px;
}

.metric-chip:hover {
  border-color: var(--base);
  color: var(--base);
}

.metric-chip.on {
  background: var(--base-gradient);
  border-color: var(--base);
  color: #fff;
  box-shadow: 0 6px 18px var(--base-glow);
}

.metric-chip.on:hover {
  background: var(--base-hover);
  border-color: var(--base-hover);
  color: #fff;
}

.metric-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.metric-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s;
}

.metric-link-btn:hover {
  color: var(--base);
}

.metric-dot {
  color: var(--border);
  font-size: 12px;
  user-select: none;
}

/* ===== Chart card & tabs ===== */
.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px 16px;
  margin-top: 16px;
}

.chart-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.chart-tabs-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.indicator-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.indicator-tabs .tab {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.indicator-tabs .tab.active {
  background: var(--base-gradient);
  color: #fff;
  border-color: var(--base);
}

.chart-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 420px;
}

.footer {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.site-footer {
  width: 100%;
  max-width: 1280px;
  margin: 32px auto 0;
  padding: 0 20px 32px;
  display: flex;
  flex-direction: column;
}

/* ===== Footer 折叠开关：默认收起，hover 预览 / 点击锁定 =====
   关键：DOM 顺序就是 row 在前、toggle 在后（layout.js）。
   flex-direction: column 自然让 row 在上、toggle 在下，无需 order。*/
.site-footer-toggle {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 18px 8px 16px;
  background: var(--card-bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-mid);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
  transition: background 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.2s ease;
}

.site-footer-toggle:hover {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--base-border);
  box-shadow: 0 6px 16px var(--base-glow);
  transform: translateY(-1px);
}

.site-footer-toggle:focus-visible {
  outline: 2px solid var(--base);
  outline-offset: 2px;
}

.site-footer-toggle .toggle-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.site-footer-toggle .toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.site-footer-toggle:hover .toggle-icon {
  transform: scale(1.12);
}

.site-footer-toggle .toggle-text {
  font-weight: 600;
  color: var(--text);
}

.site-footer-toggle .toggle-hint {
  font-size: 11.5px;
  color: var(--text-soft);
  opacity: 0.85;
}

.site-footer-toggle .toggle-chevron {
  display: inline-block;
  font-size: 11px;
  color: var(--text-soft);
  transition: transform 0.28s ease, color 0.2s ease;
}

.site-footer.is-locked .site-footer-toggle .toggle-chevron {
  transform: rotate(180deg);
  color: var(--base-text);
}

.site-footer.is-locked .site-footer-toggle .toggle-hint {
  display: none;
}

.site-footer.is-locked .site-footer-toggle .toggle-text::after {
  content: '（点击收起）';
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--text-soft);
  font-weight: 400;
}

/* ===== Panel 默认收起（向上展开，所以用 margin-bottom 撑开间距） ===== */
.site-footer-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: stretch;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.36s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.26s ease,
              margin-bottom 0.32s ease;
}

/* hover 预览：仅在 hover-capable 设备 */
@media (hover: hover) {
  .site-footer[data-collapsed="true"]:hover .site-footer-row {
    max-height: 600px;
    opacity: 1;
    margin-bottom: 12px;
    pointer-events: auto;
  }
}

/* 锁定展开（点击 toggle 后） */
.site-footer.is-locked .site-footer-row {
  max-height: 1200px;
  opacity: 1;
  margin-bottom: 12px;
  pointer-events: auto;
}

.donate-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--base-soft) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--base-border);
  border-radius: 16px;
  box-shadow: 0 6px 18px var(--base-glow);
  min-height: 136px;
}

.donate-card .donate-qr {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--base-border);
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
  align-self: center;
}

.donate-card .donate-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.donate-card .donate-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  line-height: 1.5;
  text-align: left;
}

.donate-card .donate-title {
  color: var(--accent-text);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.donate-card .donate-line {
  color: var(--text-mid);
  font-size: 11.5px;
}

.wishpool-shell {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 14px 20px;
  background:
    radial-gradient(circle at 10% 10%, var(--base-glow), transparent 28%),
    radial-gradient(circle at 90% 0%, var(--accent-glow), transparent 24%),
    linear-gradient(135deg, var(--card-bg), var(--card-bg-soft));
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px var(--base-glow);
}

.wishpool-shell::after {
  display: none;
}

.wishpool-heading {
  display: none;
}

.wishpool-kicker {
  color: var(--base-text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.wishpool-title,
.wishpool-subtitle,
.wishpool-input-wrap,
.wishpool-label {
  display: none;
}

.wishpool-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.wishpool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wishpool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wishpool-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--base-border);
  border-radius: 999px;
  outline: none;
  background: var(--top-nav-text);
  color: var(--text);
  font-size: 14px;
  line-height: 38px;
  font-family: inherit;
  padding: 0 16px;
  width: 100%;
  box-sizing: border-box;
}

.wishpool-input-email {
  flex: 1 1 220px;
  height: 34px;
  line-height: 34px;
  font-size: 13px;
  background: var(--top-nav-text-soft);
}

.wishpool-input::placeholder {
  color: var(--text-soft);
}

.wishpool-submit {
  flex-shrink: 0;
  width: auto;
  max-width: none;
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--base-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 18px 36px var(--base-glow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.wishpool-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px var(--base-glow);
}

.wishpool-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.wishpool-status {
  min-height: 0;
  font-size: 12px;
  color: var(--text-mid);
  white-space: nowrap;
  flex-shrink: 0;
}

.wishpool-status.pending {
  color: var(--base);
}

.wishpool-status.success {
  color: var(--down);
}

.wishpool-status.error {
  color: var(--accent);
}



@media (max-width: 768px) {
  .container {
    padding: 16px 12px 48px;
  }
  .page-title {
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 16px;
  }
  .search-bar {
    flex-direction: column;
    gap: 10px;
  }
  .search-input-wrap,
  .primary-btn {
    width: 100%;
  }
  .section-title {
    font-size: 18px;
  }
  .indicator-label {
    font-size: 16px;
  }
  .chart-canvas-wrap {
    height: 320px;
  }
  .stock-table {
    font-size: 12px;
  }
  .stock-table th,
  .stock-table td {
    padding: 8px 6px;
  }
  .site-footer {
    padding: 0 12px 26px;
  }
  .site-footer-toggle {
    font-size: 12px;
    padding: 7px 14px;
    gap: 6px;
  }
  .site-footer-toggle .toggle-hint {
    display: none;
  }
  .site-footer-row {
    grid-template-columns: 1fr;
  }
  .donate-card {
    min-height: 0;
    padding: 10px 14px;
  }
  .donate-card .donate-qr {
    width: 88px;
    height: 88px;
  }
  .wishpool-shell {
    border-radius: 12px;
    padding: 12px 14px;
  }
  .wishpool-panel {
    flex-wrap: wrap;
  }
  .wishpool-submit {
    width: 100%;
    height: 38px;
  }
  .wishpool-input {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .chart-canvas-wrap {
    height: 280px;
  }
}

/* ===== Search stage (空状态居中 / 查询后紧凑) ===== */
.search-stage {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  transition: max-width 0.3s ease, gap 0.3s ease;
}

.search-stage > .search-bar,
.search-stage > .metric-bar {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.search-stage.is-centered {
  min-height: calc(100vh - 360px);
  justify-content: center;
}

.search-stage.is-centered .search-bar {
  max-width: 720px;
  margin: 0 auto;
  gap: 14px;
}

.search-stage.is-centered .search-input-wrap {
  height: 60px;
  border-radius: 12px;
}

.search-stage.is-centered .search-input-wrap #searchInput {
  font-size: 18px;
}

.search-stage.is-centered .search-input-wrap .search-icon svg {
  width: 22px;
  height: 22px;
}

.search-stage.is-centered .primary-btn {
  height: 60px;
  padding: 0 36px;
  font-size: 17px;
  border-radius: 12px;
  box-shadow: 0 14px 30px var(--primary-glow);
}

.search-stage.is-centered .metric-bar {
  max-width: 720px;
  margin: 0 auto;
  justify-content: center;
}

.search-stage:not(.is-centered) .notif-bar,
.search-stage:not(.is-centered) .search-bar,
.search-stage:not(.is-centered) .metric-bar {
  max-width: 720px;
  margin: 0 auto 0;
}

/* ===== Notification bar (demo) ===== */
.notif-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  height: 40px;
  margin: 0 auto 12px;
  padding: 0 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.notif-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--base-gradient);
}

.notif-bar-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--base);
  background: var(--base-soft);
  border-radius: 50%;
  animation: notif-pulse 2.4s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--base-glow); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

.notif-bar-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  user-select: none;
}

.notif-bar-viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.notif-bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  height: 100%;
}

.notif-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notif-tag {
  flex-shrink: 0;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.02em;
}

.tag-recap    { background: var(--base-soft); color: var(--base-text); }
.tag-analysis { background: var(--accent-soft); color: var(--accent-text); }
.tag-biyang   { background: var(--accent-soft); color: var(--accent-text); }
.tag-ai       { background: var(--base-soft); color: var(--base-text); }

.notif-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.notif-bar-dots {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding-left: 4px;
}

.notif-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.notif-dot:hover {
  background: var(--text-soft);
}

.notif-dot.active {
  background: var(--base);
  transform: scale(1.3);
}

@media (max-width: 768px) {
  .notif-bar {
    height: 36px;
    padding: 0 10px;
    gap: 8px;
  }
  .notif-tag      { font-size: 10px; padding: 0 6px; }
  .notif-item     { font-size: 12px; }
  .notif-time     { display: none; }
  .notif-bar-icon { width: 20px; height: 20px; }
  .notif-bar-label { font-size: 11px; }
}

@media (max-width: 480px) {
  .notif-bar-dots { display: none; }
}

/* ===== Stock info bar ===== */
.stock-info-bar {
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
}

.info-bar-line {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.info-bar-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  min-width: 220px;
  flex: 0 1 auto;
}

.info-bar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

.info-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.info-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
}

.info-badge-board {
  background: var(--base-soft);
  color: var(--base-text);
}

.info-badge-industry {
  background: var(--accent-soft);
  color: var(--accent-text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-badge-valuation-high {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.info-badge-valuation-mid {
  background: #fffbeb;
  color: #92400e;
}

.info-badge-valuation-low {
  background: var(--base-soft);
  color: var(--base-text);
}

.info-kv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  flex: 1 1 520px;
}

.info-kv {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: fit-content;
}

.info-kv-label {
  font-size: 11px;
  color: var(--text-muted);
}

.info-kv-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.info-kv-value.ok,
.info-kv-value.strong {
  color: var(--down);
}

.info-kv-value.warn {
  color: #b45309;
}

.info-kv-value.muted {
  font-weight: 400;
  color: var(--text-muted);
}

.info-bar-foot {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
  text-align: right;
}

.table-scroll.has-info-bar {
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.table-scroll.has-info-bar .stock-table {
  border-radius: 0;
  box-shadow: none;
  border-top: 0;
}

@media (max-width: 640px) {
  .info-bar-line {
    align-items: flex-start;
    gap: 10px;
  }
  .info-kv-row {
    display: flex;
    gap: 10px 16px;
  }
  .info-bar-title {
    font-size: 14px;
  }
}
.notif-text a {
  color: var(--base);
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: auto;
}
.notif-text a:hover {
  filter: brightness(1.15);
}


/* ============================================================ */
/*  登录 / 用户区                                            */
/* ============================================================ */
.auth-area {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  flex-shrink: 0;
}
.auth-btn {
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.auth-btn:hover { background: var(--hover-bg); color: var(--text); }
.auth-btn-login { color: var(--primary); border-color: var(--primary); }
.auth-btn-login:hover { background: var(--primary); color: #fff; }
.auth-btn-logout { color: var(--text-muted); }
.auth-btn-profile { color: var(--text); }
.auth-btn-profile:hover { background: var(--hover-bg); color: var(--primary); }
.auth-btn-admin { color: var(--primary); font-weight: 500; }
.auth-btn-admin:hover { background: var(--primary); color: #fff; }
.auth-user { display: flex; align-items: center; gap: 6px; }
.auth-username { font-size: 13px; color: var(--text); font-weight: 500; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-role { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--primary); color: #fff; }
.auth-role[data-role="ADMIN"] { background: #e53; }
.auth-role[data-role="MANAGER"] { background: var(--primary); }

/* ============================================================ */
/*  登录弹窗                                                  */
/* ============================================================ */
.modal-overlay {
  /* 用 longhand 兜底：inset 在某些 flex container 内被识别成非 0，需要 top/right/bottom/left 兜住 */
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 400px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.auth-error { color: #e53; font-size: 13px; background: #fff0ee; border: 1px solid #fcc; border-radius: 6px; padding: 8px 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text); }
.form-input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; background: var(--surface); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }

/* ============================================================ */
/*  登录弹窗：扫码 + 登录码 + 手机 + 邮箱(密码/验证码) 多 Tab     */
/* ============================================================ */
.modal-box.modal-box-auth { width: 440px; }
.auth-tabs {
  display: flex; padding: 0 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.auth-tab {
  flex: 1; padding: 11px 2px; background: none; border: 0;
  border-bottom: 2px solid transparent;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active {
  color: var(--primary); font-weight: 600;
  border-bottom-color: var(--primary);
}
.auth-pane { display: flex; flex-direction: column; gap: 12px; }

/* 验证码行：输入框 + 发送按钮 横向对齐 */
.auth-code-row {
  display: flex; gap: 8px; align-items: stretch;
}
.auth-code-input { flex: 1; }
.auth-send-btn {
  flex: 0 0 auto; min-width: 110px;
  padding: 8px 10px;
  font-size: 13px; color: var(--primary);
  background: var(--surface); border: 1px solid var(--primary);
  border-radius: 6px; cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.auth-send-btn:hover:not(:disabled) {
  background: var(--primary); color: #fff;
}
.auth-send-btn:disabled {
  cursor: not-allowed; opacity: 0.55;
  border-color: var(--border); color: var(--text-muted);
}

/* inline 链接按钮（小号） */
.auth-link-btn.inline {
  display: inline; background: none; border: 0; padding: 0;
  color: var(--primary); font-size: 12px; cursor: pointer;
  text-decoration: underline;
}
.auth-link-btn.inline:hover { opacity: 0.8; }

.auth-success {
  color: #07c160; font-size: 13px;
  background: #f0fff5; border: 1px solid #b7eccc;
  border-radius: 6px; padding: 8px 12px;
}
.auth-spinner {
  width: 32px; height: 32px; margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-scan-loading,
.auth-scan-fallback,
.auth-scan-unavailable {
  padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.auth-scan-loading p { margin: 0; }
.auth-scan-frame {
  position: relative; width: 220px; height: 220px;
  margin: 0 auto; padding: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; overflow: hidden;
}
.auth-scan-frame img {
  display: block; width: 100%; height: 100%; object-fit: contain;
}
.auth-scan-mask {
  position: absolute; inset: 0;
  background: rgba(7,193,96,0.85); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; letter-spacing: 2px;
}
.auth-scan-tip { margin: 0; text-align: center; font-size: 13px; color: var(--text); }
.auth-scan-status {
  margin: 0; text-align: center; font-size: 12px; color: var(--text-muted);
  min-height: 16px;
}
.auth-scan-status.is-warn { color: #e53; }
.auth-scan-status.is-ok { color: #07c160; font-weight: 600; }
.auth-link-btn {
  display: block; margin: 4px auto 0;
  background: none; border: 0;
  color: var(--primary); font-size: 12px; cursor: pointer;
  text-decoration: underline;
}
.auth-link-btn:hover { opacity: 0.8; }
.auth-foot-note {
  margin: -4px 0 0; font-size: 11px; color: var(--text-soft); text-align: center;
}

@media (max-width: 480px) {
  .modal-box.modal-box-auth { width: 92vw; }
  .auth-scan-frame { width: 180px; height: 180px; }
}
