/*
 * 簡錢 JianMoney · 暖調極簡品牌層
 * 僅覆蓋視覺 token 與品牌外殼；不承載任何選股或互動邏輯。
 * 舊 styles.css 保留，移除此檔引用即可回到原視覺。
 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@600;700&display=swap');

.brand-v2 {
  --brand-navy: #384752;
  --brand-gold: #cbb494;
  --brand-gold-strong: #8a633b;
  --brand-cream: #f8f1e9;
  --brand-ink: #212529;

  /* 選股頁 token */
  --bg: #faf7f2;
  --bg-2: #fffdfb;
  --surface: #f7f0e7;
  --surface-2: #eee4d8;
  --surface-hi: #e4d7c8;
  --border: #e7dccf;
  --border-2: #d7c6b3;
  --text: #27333e;
  --text-dim: #4e5962;
  --text-mute: #737b81;
  --text-faint: #9b9b96;
  --accent: #8a633b;
  --accent-dim: #cbb494;
  --accent-bg: #f3eadf;
  --info: #384752;
  --info-bg: #edf0f2;

  /* 績效／日誌頁相容 token */
  --surface2: #eee4d8;
  --border2: #d7c6b3;
  --text-1: #27333e;
  --text-2: #687178;
  --text-3: #999b98;
  --accent-2: #a97d4c;
  --accent-bd: #ddc8ae;
  --yellow: #a97d4c;
  --yellow-bg: #f6eddf;

  background: var(--bg);
  color: var(--text);
}

/* 品牌列：溫暖、清楚、保持產品工具的緊湊度。 */
.brand-v2 .topbar {
  min-height: 64px;
  height: 64px;
  padding: 0 22px;
  gap: 14px;
  background: rgb(255 253 251 / 94%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 28px rgb(56 71 82 / 5%);
  backdrop-filter: blur(14px);
}

.brand-v2 .brand {
  min-width: 224px;
  gap: 10px;
  color: var(--brand-navy);
  text-decoration: none;
}

.brand-v2 .brand-logo-mark {
  display: block;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
}

.brand-v2 .brand-text { line-height: 1.05; }
.brand-v2 .brand-name {
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--brand-navy);
}
.brand-v2 .brand-sub {
  margin-top: 4px;
  color: var(--brand-gold-strong);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand-v2 .topbar-nav {
  gap: 4px;
  margin-left: 4px;
}
.brand-v2 .tnav {
  height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.brand-v2 .tnav:hover {
  color: var(--brand-navy);
  background: #f6efe6;
}
.brand-v2 .tnav.active {
  color: var(--brand-navy);
  background: #efe3d4;
  border-bottom-color: transparent;
  font-weight: 600;
}

.brand-v2 .status-chip {
  background: #f7f2eb;
  border-color: var(--border);
}
.brand-v2 .topbar-meta,
.brand-v2 .topbar-right { color: var(--text-mute); }
.brand-v2 .nav-clock { color: var(--text-mute); }

/* 次要資料帶降低視覺重量，將注意力留給主要工作區。 */
.brand-v2 .ticker-bar,
.brand-v2 .db-bar {
  background: #f8f3ec;
  border-color: var(--border);
}

/* 主頁 KPI：用留白、卡片與單一深色主卡建立層級。 */
.brand-v2 .kpi-strip {
  gap: 12px;
  padding: 16px 18px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand-v2 .kpi-card {
  min-width: 0;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgb(56 71 82 / 5%);
}
.brand-v2 .kpi-label {
  color: var(--text-mute);
  letter-spacing: .08em;
}
.brand-v2 .kpi-value {
  font-size: 27px;
  color: var(--brand-navy);
}
.brand-v2 .kpi-sub { color: var(--text-mute); }
.brand-v2 .kpi-card:first-child {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  box-shadow: 0 14px 32px rgb(56 71 82 / 17%);
}
.brand-v2 .kpi-card:first-child .kpi-label { color: #d8c3a8; }
.brand-v2 .kpi-card:first-child .kpi-value { color: #fffdfb; }
.brand-v2 .kpi-card:first-child .kpi-sub { color: #dce1e4; }

/* 卡片與表格只做色彩圓潤化，不改資料密度與行為。 */
.brand-v2 .sidebar,
.brand-v2 .tabs-bar,
.brand-v2 .opts-bar,
.brand-v2 .table-wrap,
.brand-v2 .stock-card,
.brand-v2 .news-card {
  border-color: var(--border);
}
.brand-v2 table.stocks tbody tr:hover { background: #f8f1e8; }

/* 最高正面訊號：深藍實心建立權威感，暖金描邊連回品牌識別。 */
.brand-v2 .sbadge.sb-super {
  color: #fffdfb;
  background: linear-gradient(135deg, #263540 0%, #405561 100%);
  border: 1.5px solid #b99765;
  box-shadow:
    0 2px 7px rgb(38 53 64 / 26%),
    inset 0 0 0 1px rgb(255 253 251 / 8%);
  font-weight: 700;
  letter-spacing: .035em;
}
.brand-v2 .sbadge.sb-super:hover { filter: brightness(1.08); }

/* ── 第二階段：智選首頁的編輯式決策工作台 ── */
.brand-v2.editorial-v2 .editorial-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
  min-height: 112px;
  padding: 18px 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 10%, rgb(203 180 148 / 18%), transparent 30%),
    linear-gradient(118deg, #fffdfb 0%, #faf4ec 64%, #f5eadc 100%);
  border-bottom: 1px solid var(--border);
}
.brand-v2.editorial-v2 .editorial-hero::after {
  content: '';
  position: absolute;
  right: 18%;
  bottom: -82px;
  width: 170px;
  height: 170px;
  border: 1px solid rgb(138 99 59 / 11%);
  border-radius: 50%;
}
.brand-v2.editorial-v2 .editorial-hero-copy,
.brand-v2.editorial-v2 .editorial-status { position: relative; z-index: 1; }
.brand-v2.editorial-v2 .editorial-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--brand-gold-strong);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-v2.editorial-v2 .editorial-eyebrow-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-gold);
}
.brand-v2.editorial-v2 .editorial-hero h1 {
  margin: 0;
  color: var(--brand-navy);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(25px, 2.2vw, 31px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .025em;
}
.brand-v2.editorial-v2 .editorial-hero h1 span { color: var(--brand-gold-strong); }
.brand-v2.editorial-v2 .editorial-hero p {
  margin: 6px 0 0;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.6;
}
.brand-v2.editorial-v2 .editorial-status {
  width: 218px;
  flex: 0 0 218px;
  padding: 13px 15px;
  background: rgb(255 253 251 / 78%);
  border: 1px solid rgb(138 99 59 / 18%);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgb(56 71 82 / 7%);
  backdrop-filter: blur(8px);
}
.brand-v2.editorial-v2 .editorial-status-label {
  margin-bottom: 5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
}
.brand-v2.editorial-v2 .editorial-status-value {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-navy);
  font-size: 14px;
  font-weight: 650;
}
.brand-v2.editorial-v2 .editorial-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4d9870;
  box-shadow: 0 0 0 4px rgb(77 152 112 / 12%);
}
.brand-v2.editorial-v2 .editorial-status-value.is-alert .editorial-status-dot {
  background: #b95d54;
  box-shadow: 0 0 0 4px rgb(185 93 84 / 13%);
}
.brand-v2.editorial-v2 .editorial-status-note {
  margin-top: 5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* 五項 KPI 維持完整，候選股作為主要決策數字。 */
.brand-v2.editorial-v2 .kpi-strip {
  grid-template-columns: 1.15fr repeat(4, 1fr);
  padding-top: 13px;
}
.brand-v2.editorial-v2 .kpi-card { padding: 14px 17px; }
.brand-v2.editorial-v2 .kpi-card:first-child {
  position: relative;
  overflow: hidden;
}
.brand-v2.editorial-v2 .kpi-card:first-child::after {
  content: '';
  position: absolute;
  right: -24px;
  top: -35px;
  width: 100px;
  height: 100px;
  border: 1px solid rgb(203 180 148 / 24%);
  border-radius: 50%;
}

/* 左欄由規則清單改為三段式決策流程，內容仍沿用既有回測規則。 */
.brand-v2.editorial-v2 .guide { padding: 15px 12px 18px; }
.brand-v2.editorial-v2 .g-title {
  margin: 0 3px 5px;
  color: var(--brand-navy);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 17px;
  letter-spacing: .04em;
}
.brand-v2.editorial-v2 .g-sub { margin: 0 3px 12px; line-height: 1.65; }
.brand-v2.editorial-v2 .g-flow { display: flex; flex-direction: column; gap: 10px; }
.brand-v2.editorial-v2 .g-stage {
  padding: 11px;
  background: #fffdfb;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgb(56 71 82 / 4%);
}
.brand-v2.editorial-v2 .g-stage.is-primary {
  background: linear-gradient(145deg, #fffdfb, #f8f0e5);
  border-color: #ddc8ae;
}
.brand-v2.editorial-v2 .g-stage.is-risk { background: #fcfaf7; }
.brand-v2.editorial-v2 .g-stage-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.brand-v2.editorial-v2 .g-stage-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: var(--brand-navy);
  color: #fffdfb;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.brand-v2.editorial-v2 .g-stage.is-primary .g-stage-num {
  background: var(--brand-gold-strong);
}
.brand-v2.editorial-v2 .g-stage-kicker {
  color: var(--text-faint);
  font-size: 9px;
  letter-spacing: .06em;
}
.brand-v2.editorial-v2 .g-stage-title {
  margin-top: 1px;
  color: var(--brand-navy);
  font-size: 13px;
  font-weight: 650;
}
.brand-v2.editorial-v2 .g-eng { padding: 7px; border-radius: 10px; }
.brand-v2.editorial-v2 .g-eng-main {
  background: #f4e9da;
  border-color: var(--brand-gold);
}
.brand-v2.editorial-v2 .g-eng-main .g-eng-name { color: var(--brand-gold-strong); }
.brand-v2.editorial-v2 .g-note { margin-top: 8px; }
.brand-v2.editorial-v2 .g-steps { gap: 10px; }
.brand-v2.editorial-v2 .g-step { position: relative; gap: 9px; }
.brand-v2.editorial-v2 .g-n {
  background: #efe3d4;
  color: var(--brand-gold-strong);
}
.brand-v2.editorial-v2 .g-sell-rule {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}
.brand-v2.editorial-v2 .g-guard {
  color: #934e47;
  background: #fbefed;
  border-color: #e8c7c3;
}
.brand-v2.editorial-v2 .g-stage .g-fold { margin-top: 9px; }
.brand-v2.editorial-v2 .g-stage .g-fold summary { font-weight: 550; }
.brand-v2.editorial-v2 .g-evidence {
  margin: 11px 4px 0;
  color: var(--text-faint);
  font-size: 9.5px;
  line-height: 1.5;
}
.brand-v2.editorial-v2 .g-lock-fold { margin: 12px 4px 0; }

/* 表格維持專業密度，只加強欄名、公司與列的辨識。 */
.brand-v2.editorial-v2 .tabs-bar { background: #fffdfb; }
.brand-v2.editorial-v2 .ctab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-gold-strong);
}
.brand-v2.editorial-v2 .opts-bar { background: #faf7f2; }
.brand-v2.editorial-v2 table.stocks thead {
  background: #f4ede4;
  box-shadow: 0 1px 0 var(--border), 0 7px 15px rgb(56 71 82 / 4%);
}
.brand-v2.editorial-v2 table.stocks thead th {
  padding: 11px 14px;
  color: #6f7477;
  letter-spacing: .045em;
}
.brand-v2.editorial-v2 table.stocks tbody td { padding: 11px 14px; }
.brand-v2.editorial-v2 table.stocks tbody tr:nth-child(even) { background: #fcfaf7; }
.brand-v2.editorial-v2 table.stocks tbody tr:hover { background: #f5ede2; }
.brand-v2.editorial-v2 table.stocks td.sid { color: var(--brand-navy); }
.brand-v2.editorial-v2 table.stocks td.sname { font-weight: 600; }
.brand-v2.editorial-v2 .industry-tag { background: #f4eee7; border-color: #e5d8c9; }

@media (max-width: 860px) {
  .brand-v2 .topbar {
    height: auto;
    min-height: 0;
    padding: 10px 12px 8px;
    gap: 8px 10px;
  }
  .brand-v2 .brand {
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand-v2 .brand-logo-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .brand-v2 .brand-name { font-size: 17px; }
  .brand-v2 .brand-sub { font-size: 9px; }
  .brand-v2 .topbar-nav {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    gap: 3px;
  }
  .brand-v2 .tnav {
    height: 35px;
    padding: 0 12px;
  }
}

@media (max-width: 768px) {
  .brand-v2 .page-header {
    flex-wrap: wrap;
    gap: 16px;
  }
  .brand-v2 .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .brand-v2 .kpi-strip {
    gap: 10px;
    padding: 12px;
  }
  .brand-v2 .kpi-card {
    padding: 14px;
    border-radius: 14px;
  }
  .brand-v2 .kpi-card:last-child { grid-column: 1 / -1; }
  .brand-v2.editorial-v2 .editorial-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 20px 16px;
  }
  .brand-v2.editorial-v2 .editorial-hero::after { right: -60px; bottom: -95px; }
  .brand-v2.editorial-v2 .editorial-hero h1 { font-size: 28px; }
  .brand-v2.editorial-v2 .editorial-hero p { max-width: 320px; }
  .brand-v2.editorial-v2 .editorial-status {
    width: auto;
    flex-basis: auto;
  }
  .brand-v2.editorial-v2 .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .brand-v2.editorial-v2 .kpi-card:first-child { grid-column: 1 / -1; }
}
