:root {
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-soft: #fbfcf8;
  --ink: #17202a;
  --muted: #667071;
  --line: #dde3dc;
  --red: #8f2f2d;
  --green: #245d46;
  --blue: #17345c;
  --blue-soft: #eaf0f7;
  --green-soft: #edf5ef;
  --red-soft: #f7ece9;
  --shadow: 0 18px 60px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.button-link {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: #0d2748;
}

.danger {
  background: var(--red);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  padding: 24px 18px;
  background: #fdfefb;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #102d52, #1b4d7d);
  color: white;
  box-shadow: 0 7px 18px rgba(23, 52, 92, 0.18);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}

.brand-mark .brand-axis {
  fill: none;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.brand-mark .brand-trend {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark circle {
  fill: #d8aa47;
  stroke: #fff;
  stroke-width: 1;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  padding: 10px 11px;
  border-radius: 7px;
  color: #314044;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--green-soft);
}

.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.nav-label-short {
  display: none;
}

.app {
  margin-left: 252px;
  min-height: 100vh;
  padding: 28px 34px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.2;
}

.detail-topbar {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.detail-topbar > div:first-child {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.industry-status {
  margin: -8px 0 18px;
  padding-left: 2px;
  color: var(--muted);
  font-size: 12px;
}

.crawl-banner {
  margin: 0 0 16px;
  padding: 8px 14px;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  word-break: break-all;
}

.crawl-banner:empty,
.crawl-banner.empty {
  display: none;
}

.top-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.date-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.date-pill,
.custom-range {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: #384548;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 6px 18px rgba(23, 32, 42, 0.04);
}

.date-pill.active,
.custom-range.active {
  color: var(--red);
  border-color: #e1c1bb;
  background: var(--red-soft);
}

.custom-range input {
  height: 24px;
  width: 118px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  background: white;
  font-size: 12px;
}

.custom-range button {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 12px;
}

.auth-links,
.user-chip {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-links a,
.user-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
}

.user-chip a {
  color: var(--red);
}

.page-intro,
.trend,
.card,
.empty,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.fetch-panel {
  margin-bottom: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.fetch-panel b,
.fetch-panel span {
  display: block;
}

.fetch-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions,
.edit-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button-link.subtle {
  background: white;
  color: var(--blue);
  border: 1px solid var(--line);
}

.md-list {
  border-top: 1px solid var(--line);
}

.sina-library-head {
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}

.sina-library-head h2 {
  margin: 6px 0 7px;
  font-size: 20px;
  line-height: 1.25;
}

.sina-library-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.sina-news-list {
  border-top: 1px solid var(--line);
}

.sina-news-row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 13px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.sina-rank {
  display: grid;
  gap: 3px;
  padding-top: 3px;
}

.sina-rank span {
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}

.sina-rank small {
  color: var(--muted);
  font-size: 11px;
}

.sina-news-main h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.sina-news-main h2 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.sina-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.sina-meta-line {
  display: contents;
}

.sina-meta span,
.sina-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}

.sina-meta a {
  color: var(--blue);
  font-weight: 700;
}

.ai-preview {
  /* v2: 新闻列表里的 AI 摘要已改为完整 markdown 渲染（class=ai-analysis），不再折叠；
     保留此 class 仅作历史兼容兜底，避免已缓存页面样式异常 */
  margin: 8px 0 10px;
  padding: 9px 11px;
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  background: var(--panel-soft);
  color: #455056;
  font-size: 13.5px;
  line-height: 1.65;
}

.ai-preview.ai-pending {
  border-left-color: var(--muted);
  color: var(--muted);
  font-style: italic;
}

.library-pagination {
  min-height: 64px;
  padding: 16px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.load-more-button {
  min-height: 38px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  background: var(--panel);
  font-weight: 700;
}

.load-more-button:hover {
  color: white;
  background: var(--blue);
}

.library-count {
  margin: 0;
  padding: 16px 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.detail-analysis {
  margin-top: 18px;
}

.detail-analysis > h2 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 17px;
}

.ai-analysis {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: var(--bg-soft, #f6f7f9);
  border-radius: 4px;
  color: #344054;
  font-size: 13px;
  line-height: 1.65;
}

.ai-analysis h2,
.ai-analysis h3,
.ai-analysis h4 {
  margin: 8px 0 4px;
  color: var(--blue, #17345c);
  font-weight: 600;
  font-size: 14px;
}

.ai-analysis h2:first-child,
.ai-analysis h3:first-child,
.ai-analysis h4:first-child {
  margin-top: 0;
}

.ai-analysis ul,
.ai-analysis ol {
  margin: 4px 0 8px;
  padding-left: 22px;
}

.ai-analysis li {
  margin: 2px 0;
}

.ai-analysis p {
  margin: 0 0 6px;
}

.ai-analysis p:last-child {
  margin-bottom: 0;
}

.ai-analysis strong {
  color: var(--blue, #17345c);
  font-weight: 700;
}

.ai-analysis.ai-pending {
  border-left-color: var(--muted, #98a2b3);
  color: var(--muted, #98a2b3);
  font-style: italic;
}

/* 行业研究 / 新浪 markdown 摘要里渲染的列表 + 标题更紧凑 */
.ai-analysis h1,
.ai-analysis h2,
.ai-analysis h3,
.ai-analysis h4 {
  margin: 10px 0 6px;
  font-weight: 700;
  color: var(--blue, #17345c);
  line-height: 1.4;
}

.ai-analysis h1 { font-size: 16px; }
.ai-analysis h2 { font-size: 14.5px; }
.ai-analysis h3 { font-size: 13.5px; }
.ai-analysis h4 { font-size: 13px; }

.ai-analysis ul,
.ai-analysis ol {
  margin: 4px 0 8px;
  padding-left: 22px;
}

.ai-analysis li {
  margin: 2px 0;
}

.md-summary {
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.md-summary h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.md-summary ul {
  margin: 0;
  padding-left: 20px;
  color: #344347;
  line-height: 1.75;
}

.md-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.md-item.log-item {
  grid-template-columns: 48px minmax(0, 1fr);
}

.log-summary-line {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 12px;
  line-height: 1.55 !important;
}

.log-source-links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-source-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.log-source-links a:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.rejected-news-panel {
  margin: 0 0 24px;
  padding: 13px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.rejected-news-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.rejected-news-heading h2 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.25;
}

.rejected-news-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.rejected-table-wrap {
  overflow-x: auto;
}

.rejected-news-table {
  min-width: 560px;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: none;
}

.rejected-news-table th,
.rejected-news-table td {
  padding: 6px 9px;
}

.rejected-news-table th {
  font-size: 11px;
  line-height: 1.25;
}

.rejected-news-table th:first-child,
.rejected-news-table td:first-child {
  width: 38px;
}

.rejected-news-table th:last-child,
.rejected-news-table td:last-child {
  width: 42%;
  white-space: normal;
}

.rejected-row-number {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rejected-link-cell a {
  color: var(--blue);
  font-weight: 700;
}

.table-pager {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

.pager-page,
.pager-ellipsis {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pager-page {
  border: 1px solid var(--line);
  background: white;
}

.pager-page:hover,
.pager-page.active {
  border-color: var(--blue);
  color: white;
  background: var(--blue);
}

@media (max-width: 720px) {
  .rejected-news-panel {
    padding: 10px 9px 9px;
  }

  .rejected-news-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.md-rank {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  padding-top: 4px;
}

.md-content h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.md-content h2 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.md-content p {
  margin: 0 0 8px;
  color: #344347;
  line-height: 1.65;
}

.md-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.md-meta a {
  color: var(--blue);
}

.detail-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--blue);
  background: white;
  font-size: 12px;
  font-weight: 700;
}

.detail-button:hover {
  background: var(--blue-soft);
}

.row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.delete-form {
  margin: 0;
}

.delete-button {
  border: 1px solid #e1c1bb;
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.delete-button:hover {
  background: #f4dad3;
}

.archive-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
}

.md-edit-form {
  display: grid;
  gap: 14px;
}

.edit-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.edit-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.detail-doc {
  max-width: 980px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.detail-head h2 {
  margin: 7px 0 12px;
  font-size: 28px;
  line-height: 1.25;
}

.back-link {
  color: var(--blue);
  font-size: 13px;
}

.back-link-prominent {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid #c8d6e6;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(23, 52, 92, 0.16);
}

.back-link-prominent:hover {
  background: #0d2748;
}

.doc-body {
  margin-top: 18px;
  color: #2d383b;
  line-height: 1.8;
  max-width: 880px;
}

.source-frame {
  margin-top: 18px;
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.cls-source-frame {
  overflow-x: hidden;
}

.page-intro {
  padding: 22px;
  margin-bottom: 16px;
}

.page-intro h2,
.trend h2,
.card h2 {
  margin: 6px 0 8px;
  line-height: 1.25;
}

.page-intro p,
.trend p {
  max-width: 860px;
  color: var(--muted);
}

.trend {
  margin-bottom: 16px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: linear-gradient(90deg, #ffffff 0%, #f3f8f3 100%);
}

.trend-badge {
  border-radius: 7px;
  background: var(--green);
  color: white;
  padding: 8px 10px;
  white-space: nowrap;
}

.card {
  padding: 20px;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.card-meta span,
.card-meta a {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.card-meta span:nth-child(2) {
  background: var(--green-soft);
  color: var(--green);
}

.card-body {
  color: #2d383b;
  line-height: 1.75;
}

.card-body p {
  margin: 0 0 9px;
}

.readonly-note,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.edit-box {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.edit-box summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.stack-form,
.edit-box form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #334246;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.empty {
  padding: 28px;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f2f5f0;
  color: #344347;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.table-actions form,
.inline-form {
  display: inline;
}

.inline-create {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 150px auto;
  gap: 8px;
}

.flash {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
}

.flash.error {
  background: var(--red-soft);
  color: var(--red);
}

.market-notice {
  margin: 0 0 12px;
}

.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.market-toolbar .flash {
  flex: 1 1 auto;
  margin: 0;
}

.market-toolbar form {
  flex: 0 0 auto;
  margin: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 26px;
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-card h1 {
  margin: 0 0 18px;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 8px;
  align-items: center;
}

.captcha-row img {
  width: 132px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.auth-foot {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--blue);
}

.ai-panel textarea {
  min-height: 130px;
}

.observation-list {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.observation-item {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.observation-item span {
  white-space: nowrap;
}

@media (max-width: 980px) {
  /* v1：手机端侧边栏改成横向 sticky 工具条，把首屏还给主内容 */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: #fdfefb;
  }

  /* brand 区压小，"News OS" 副标题隐藏 */
  .brand {
    flex-shrink: 0;
    margin-right: 4px;
    gap: 8px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand span {
    display: none;
  }

  /* 导航横排，溢出可横滚（隐藏滚动条） */
  .sidebar nav {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 2px;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13.5px;
  }

  /* mode-card 在手机端隐藏（信息冗余） */
  .sidebar .mode-card {
    display: none;
  }

  .app {
    margin-left: 0;
    padding: 18px 14px 44px;
  }

  /* topbar 紧凑：垂直堆叠，h1 字号收紧 */
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }
  .topbar > div:first-child {
    margin-bottom: 0;
  }
  .topbar h1 {
    font-size: 22px;
    line-height: 1.25;
  }

  .topbar.detail-topbar {
    min-height: 40px;
    margin-bottom: 10px;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }

  .detail-topbar .top-actions {
    width: auto;
    margin-left: auto;
  }

  .top-actions {
    align-items: stretch;
    margin-top: 0;
    gap: 8px;
  }

  /* 手机端固定为游客浏览视图：隐藏日期区间和账号入口。 */
  .top-actions .date-toolbar,
  .top-actions .auth-links,
  .top-actions .user-chip {
    display: none;
  }

  .date-toolbar {
    justify-content: flex-start;
    width: 100%;
  }

  .date-pill {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 13px;
  }

  .custom-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px;
    align-items: center;
    gap: 6px;
    width: 100%;
  }

  .custom-range input {
    height: 34px;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    padding: 0 8px;
  }

  .custom-range button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  /* 登录/注册按钮在 mobile 做成纯链接，去边框，紧凑 */
  .top-actions .auth-links,
  .top-actions .user-chip {
    margin-left: auto;
    background: transparent;
    border: 0;
    padding: 4px 0;
    gap: 14px;
  }
  .top-actions .auth-links a {
    color: var(--blue);
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 5px;
  }
  .top-actions .auth-links a:hover {
    background: var(--blue-soft);
  }

  .inline-create {
    grid-template-columns: 1fr;
  }

  .sina-news-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 17px 0;
  }

  .sina-rank {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 0;
  }

  .sina-rank span {
    font-size: 13px;
  }

  .sina-news-main {
    min-width: 0;
  }

  .sina-news-main h2,
  .md-content h2,
  .detail-head h2 {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .sina-news-main h2 {
    font-size: 17px;
    line-height: 1.42;
  }

  .sina-meta {
    display: grid;
    gap: 6px 10px;
    font-size: 12px;
  }

  .sina-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    min-width: 0;
  }

  .sina-news-row .detail-button {
    grid-column: 1;
    width: 100%;
    min-height: 40px;
    display: grid;
    place-items: center;
    font-size: 13px;
  }

  .ai-analysis {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.7;
  }

  .ai-analysis ul,
  .ai-analysis ol {
    padding-left: 18px;
  }

  .ai-preview {
    font-size: 14px;
    line-height: 1.65;
  }

  .ai-analysis {
    font-size: 13.5px;
    line-height: 1.7;
    padding: 10px 11px;
  }

  .library-pagination {
    min-height: 70px;
    justify-content: space-between;
    gap: 10px;
  }

  .load-more-button {
    min-height: 40px;
  }

  .detail-doc {
    max-width: 100%;
  }

  .detail-head h2 {
    font-size: 22px;
    line-height: 1.35;
    margin-top: 8px;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .detail-actions .button-link,
  .detail-actions .archive-chip {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .doc-body {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.7;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: none;
  }

  .source-frame {
    height: 62vh;
  }

  .overview-toolbar {
    width: 100%;
  }

  .core-target-grid {
    grid-template-columns: 1fr;
  }
}

/* ============== 总览页（Overview） ============== */
.overview-toolbar {
  align-items: center;
}

.overview-archive-select select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 0 8px;
  color: #384548;
  font-size: 12px;
  font-weight: 650;
  min-width: 180px;
  box-shadow: 0 6px 18px rgba(23, 32, 42, 0.04);
  cursor: pointer;
}

.overview-archive-select select:hover {
  border-color: var(--blue);
}

.overview-meta {
  margin: 8px 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  line-height: 1.6;
}

.market-index-dashboard {
  margin: 0 0 22px;
  padding: 20px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.index-dashboard-heading,
.index-chart-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.index-dashboard-heading h2,
.index-chart-heading h2 {
  margin: 0;
  color: #17262d;
  font-size: 20px;
  letter-spacing: 0;
}

.index-dashboard-heading > span,
.index-chart-heading > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.index-quote-strip {
  margin: 16px 0 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.index-quote {
  min-width: 0;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  border-right: 1px solid var(--line);
}

.index-quote:nth-child(4n) {
  border-right: 0;
}

.index-quote:nth-child(n+5) {
  border-top: 1px solid var(--line);
}

.index-quote span {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #536066;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-quote strong,
.index-quote b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.index-quote b {
  text-align: right;
}

.index-quote.is-up strong,
.index-quote.is-up b {
  color: #b13b32;
}

.index-quote.is-down strong,
.index-quote.is-down b {
  color: #16836d;
}

.index-quote.is-flat strong,
.index-quote.is-flat b {
  color: #536066;
}

.index-chart-block + .index-chart-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.index-chart-legend {
  margin: 12px 0 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #536066;
  font-size: 12px;
}

.index-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.index-chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 1px;
}

.market-history-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 330px;
  overflow: visible;
}

.market-history-chart.mobile-chart {
  display: none;
}

.interactive-index-chart {
  width: 100%;
  height: 430px;
  margin-top: 10px;
  touch-action: pan-y;
  border-radius: 4px;
  outline: none;
}

.interactive-index-chart:focus-visible {
  box-shadow: 0 0 0 2px rgba(23, 52, 92, 0.18);
}

.index-grid-line {
  stroke: #dde2de;
  stroke-width: 1;
}

.index-grid-line.vertical {
  stroke-dasharray: 3 5;
}

.index-axis-label {
  fill: #687478;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.index-line {
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.candlestick-chart .candle line {
  stroke-width: 1.2;
}

.index-data-source {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.index-data-source a {
  color: var(--blue);
}

.overview-section {
  margin-bottom: 18px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview-section h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0;
}

.overview-section .ai-analysis {
  margin: 0;
  border-left-width: 3px;
  border-radius: 4px;
  background: var(--panel-soft, #fbfcf8);
}

.overview-inner-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.overview-inner-details summary,
.overview-collapsible > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.overview-inner-details summary {
  padding: 8px 2px 0;
}

.overview-collapsible > summary {
  margin: -4px 0;
  font-size: 16px;
}

.overview-collapsible > summary .muted {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
}

.overview-details-body {
  margin-top: 12px;
}

.overview-inner-details[open] > summary,
.overview-collapsible[open] > summary {
  border-bottom: 1px solid var(--line);
}

.overview-inner-details[open] > summary {
  padding-bottom: 8px;
}

/* ----- 横向柱状图 ----- */
.bar-chart {
  margin: 6px 0 18px;
  display: grid;
  gap: 6px;
}

.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  color: #2d383b;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: #f1f3ee;
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 28px;
  border-radius: 0 3px 3px 0;
  transition: width 0.3s ease;
}

@media (max-width: 720px) {
  .bar-row {
    grid-template-columns: 110px 1fr;
  }
}

/* ----- 核心板块 / 核心股票 表格 ----- */
.core-targets-table {
  margin: 0;
}

.core-targets-table th,
.core-targets-table td {
  vertical-align: top;
}

.core-targets-table th {
  background: #f2f5f0;
  color: #344347;
  font-size: 12.5px;
}

.core-targets-table td.ct-name {
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.core-targets-table td.ct-logic {
  color: #2d383b;
  font-size: 13px;
  line-height: 1.55;
  max-width: 360px;
}

.core-targets-table td.ct-count {
  text-align: center;
  font-weight: 700;
  color: var(--red);
  font-size: 14px;
  width: 80px;
}

.core-targets-table th.ct-num {
  text-align: center;
  width: 80px;
}

.core-targets-table td.ct-stocks {
  color: #344347;
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 320px;
}

.sector-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ----- 详情页里的「核心利好板块」+「核心利好标的」单条新闻表 ----- */
.article-tables {
  margin: 18px 0 0;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-tables h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0;
}

.article-tables + .article-tables {
  margin-top: 14px;
}

/* ----- mobile 表格卡片化（≤720px）：横排 table 转竖排卡片 ----- */
@media (max-width: 720px) {
  /* 已有 max-width 规则的细节表格 */
  .core-targets-table,
  .article-tables .core-targets-table {
    border: 0;
  }
  .core-targets-table thead,
  .article-tables .core-targets-table thead {
    display: none;
  }
  .core-targets-table tbody,
  .core-targets-table tr,
  .core-targets-table td,
  .article-tables .core-targets-table tbody,
  .article-tables .core-targets-table tr,
  .article-tables .core-targets-table td {
    display: block;
    width: 100% !important;
    max-width: none !important;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .core-targets-table tr,
  .article-tables .core-targets-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 6px 0;
  }
  .core-targets-table tr:last-child,
  .article-tables .core-targets-table tr:last-child {
    border-bottom: 0;
  }
  .core-targets-table td.ct-name,
  .article-tables .core-targets-table td.ct-name {
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
    background: var(--blue-soft);
    margin: -6px 0 4px;
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
  }
  .core-targets-table td.ct-name::before,
  .article-tables .core-targets-table td.ct-name::before {
    content: "";
  }
  .core-targets-table td.ct-logic::before,
  .article-tables .core-targets-table td.ct-logic::before {
    content: "投资逻辑：";
    font-weight: 700;
    color: var(--blue);
    display: block;
    font-size: 11.5px;
    margin-bottom: 4px;
    letter-spacing: 0;
  }
  .core-targets-table td.ct-note::before,
  .article-tables .core-targets-table td.ct-note::before {
    content: "增量信息：";
    font-weight: 700;
    color: var(--blue);
    display: block;
    font-size: 11.5px;
    margin-bottom: 4px;
    letter-spacing: 0;
  }
  .core-targets-table td,
  .article-tables .core-targets-table td {
    font-size: 13.5px;
    line-height: 1.65;
  }
}

/* 概览页：财联社 iframe 限制宽度 */
.overview-section iframe {
  max-width: 100%;
  width: 100%;
}

/* 详情页 ai-analysis 在 mobile 上 padding 适配 */
@media (max-width: 720px) {
  .ai-analysis {
    margin: 12px 0;
    padding: 12px 14px !important;
    font-size: 14px;
  }
  .ai-analysis h2 { font-size: 16px; }
  .ai-analysis h3 { font-size: 14.5px; }
  .article-tables { padding: 14px 12px; }
  .article-tables h2 { font-size: 15px; }
}

/* v2：登录/注册页 mobile 适配 */
@media (max-width: 720px) {
  .auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
  }
  .auth-card {
    padding: 22px 18px;
  }
  .auth-brand {
    margin-bottom: 16px;
  }
  .auth-card h1 {
    margin: 0 0 14px;
    font-size: 22px;
  }
  .auth-foot {
    gap: 16px;
    font-size: 13.5px;
  }
  .captcha-row {
    grid-template-columns: 1fr 110px;
  }
  .captcha-row img {
    width: 110px;
    height: 42px;
  }
}

/* v4：sticky 侧边栏在滚动时给点阴影，让层次清晰 */
@media (max-width: 980px) {
  .sidebar {
    box-shadow: 0 6px 18px rgba(23, 32, 42, 0.06);
  }
}

/* 总览页 mobile 适配：缩 padding/字距 */
@media (max-width: 720px) {
  .market-index-dashboard {
    margin-bottom: 14px;
    padding: 14px 0;
  }

  .index-dashboard-heading,
  .index-chart-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .index-dashboard-heading h2,
  .index-chart-heading h2 {
    font-size: 17px;
  }

  .index-dashboard-heading > span,
  .index-chart-heading > span {
    white-space: normal;
  }

  .index-quote-strip {
    margin: 12px 0 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .index-quote,
  .index-quote:nth-child(4n) {
    padding: 9px 8px;
    border-right: 1px solid var(--line);
  }

  .index-quote:nth-child(2n) {
    border-right: 0;
  }

  .index-quote:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .index-quote strong,
  .index-quote b {
    font-size: 13px;
  }

  .index-chart-legend {
    gap: 6px 12px;
  }

  .market-history-chart {
    min-height: 0;
  }

  .interactive-index-chart {
    height: 360px;
    margin-top: 6px;
  }

  .market-history-chart.desktop-chart {
    display: none;
  }

  .market-history-chart.mobile-chart {
    display: block;
  }

  .index-chart-block + .index-chart-block {
    margin-top: 20px;
    padding-top: 18px;
  }

  .overview-section {
    padding: 14px 14px;
    margin-bottom: 12px;
  }
  .overview-section h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .overview-section .ai-analysis {
    padding: 12px 12px !important;
  }
  /* 概览页顶部"n 个核心板块/股票"canvas 限宽 */
  .overview-section canvas,
  .overview-section .chart-canvas,
  .overview-section svg {
    max-width: 100%;
  }
  /* 源新闻链接：每条一行（已 OK），单链接断行 */
  .overview-source-link {
    font-size: 13px;
    line-height: 1.6;
    display: block;
    padding: 4px 0;
  }
  /* 总览页 dataframe 表格在 mobile 上更紧凑 */
  .dataframe-table {
    font-size: 12.5px;
  }
  .dataframe-table th,
  .dataframe-table td {
    padding: 6px 8px;
  }
}

/* v3：详情页 + 单条新闻 mobile 优化 */
@media (max-width: 720px) {
  /* 详情页 .detail-actions 全宽 + 子元素均分 */
  .detail-actions {
    width: 100%;
    gap: 10px;
  }
  .detail-actions > a,
  .detail-actions > button,
  .detail-actions > form {
    flex: 1;
  }
  .detail-actions a,
  .detail-actions button {
    width: 100%;
    text-align: center;
    padding: 11px 12px;
  }

  /* 单条新闻标题字号 mobile 上保持可读 */
  .sina-news-main h2 {
    font-size: 17px;
  }
  .sina-rank {
    padding-top: 2px;
  }
  .sina-rank span {
    font-size: 13px;
  }
  .sina-rank small {
    font-size: 11px;
  }

  /* 详情页文章标题 mobile */
  .detail-doc h1,
  .detail-head h2,
  h1.detail-title {
    font-size: 21px;
    line-height: 1.3;
  }
  .detail-head {
    gap: 10px;
  }

  /* overview-section 里 ai-analysis 字号 mobile */
  .overview-section .ai-analysis {
    font-size: 14px;
  }
  .overview-section .ai-analysis li {
    line-height: 1.75;
  }
}

/* ----- 源新闻超链接列表（页面最下方） ----- */
.overview-source-section {
  border-top: 3px solid var(--blue);
}

.overview-source-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.overview-source-links li {
  margin: 0;
  padding: 0;
  line-height: 1.7;
}

.overview-source-link {
  color: var(--blue);
  font-size: 13.5px;
  text-decoration: none;
  word-break: break-word;
  border-bottom: 1px dashed transparent;
}

.overview-source-link:hover {
  color: #0d2748;
  border-bottom-color: #0d2748;
}

@media (max-width: 720px) {
  .overview-inner-details summary,
  .overview-collapsible > summary {
    min-height: 40px;
    font-size: 14px;
  }

  .overview-collapsible > summary .muted {
    display: none;
  }

  .overview-details-body {
    margin-top: 10px;
  }
}

@media (max-width: 380px) {
  .sidebar {
    gap: 6px;
    padding-inline: 10px;
  }

  .brand {
    margin-right: 0;
  }

  .brand-copy,
  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .sidebar nav {
    gap: 3px;
    overflow-x: visible;
  }

  .nav-item {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 7px;
    font-size: 13px;
  }
}

/* 主动投资页：策略净值图 / 账户统计 / 涨跌着色 */
.strategy-chart {
  width: 100%;
  height: 320px;
  margin-top: 8px;
}

.strategy-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 6px;
}

.strategy-stat {
  border: 1px solid #dde3dc;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8faf7;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strategy-stat span {
  font-size: 12px;
  color: #687478;
}

.strategy-stat strong {
  font-size: 17px;
  color: #17202a;
}

.pnl-up {
  color: #c62828;
}

.pnl-down {
  color: #2e7d32;
}

.strategy-nav {
  margin-bottom: 14px;
}

.strategy-account h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}

@media (max-width: 720px) {
  .strategy-chart {
    height: 240px;
  }
}
