/* 风格沿用月报网页（AI Hub）：Tailwind 默认字体栈、slate 灰阶、indigo/violet 主色、圆角卡片；文字最小 14px */

html {
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
  color: #1e293b;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 图标：统一线性描边 */
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* 顶部导航栏 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.brand-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(to top right, #4f46e5, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(224, 231, 255, 1), 0 2px 4px -2px rgba(224, 231, 255, 1);
  flex-shrink: 0;
}

.brand-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  background: linear-gradient(to right, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 14px;
  line-height: 20px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 主体 */
.main {
  max-width: 80rem;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #334155;
}

.tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  font-weight: 600;
}

.view-section > * + * {
  margin-top: 16px;
}

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  color: #1e293b;
}

.card-note {
  margin-top: 12px;
  font-size: 14px;
  line-height: 20px;
  color: #94a3b8;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.grid-2 > .card {
  margin-top: 0;
}

@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .main {
    padding: 32px 32px 48px;
  }

  .header-inner {
    padding: 12px 32px;
  }
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-amber {
  border-color: #fde68a;
  background: #fffbeb;
  color: #d97706;
}

.badge-slate {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #475569;
}

.badge-green {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #059669;
}

.badge-red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

/* 涨跌：红涨绿跌 */
.up { color: #ef4444; font-weight: 600; }
.down { color: #059669; font-weight: 600; }
.flat { color: #94a3b8; }
/* 亏损金额 */
.neg { color: #dc2626; font-weight: 600; }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (min-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi {
  padding: 14px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
}

.kpi-label {
  font-size: 14px;
  line-height: 20px;
  color: #64748b;
}

.kpi-value {
  margin-top: 4px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: #1e293b;
}

.kpi-value.accent {
  color: #4f46e5;
}

.kpi-sub {
  margin-top: 2px;
  font-size: 14px;
  line-height: 20px;
  color: #94a3b8;
}

/* 进度条 */
.progress-item + .progress-item {
  margin-top: 14px;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 20px;
}

.progress-name {
  font-weight: 600;
  color: #334155;
}

.progress-val {
  color: #64748b;
  text-align: right;
}

.progress-val strong {
  color: #1e293b;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  border-radius: 9999px;
  background: #f1f5f9;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
}

.progress-remark {
  margin-top: 4px;
  font-size: 14px;
  line-height: 20px;
  color: #94a3b8;
}

/* 复盘条目 */
.insight + .insight {
  margin-top: 12px;
}

.insight {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
}

.insight-tag {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.insight-tag.amber {
  border-color: #fde68a;
  background: #fffbeb;
  color: #d97706;
}

.insight-tag.green {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #059669;
}

.insight-tag.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.insight-text {
  color: #475569;
  line-height: 22px;
}

.insight-text strong {
  color: #1e293b;
  font-weight: 700;
}

/* 图表 */
.chart-box {
  position: relative;
  height: 240px;
}

.chart-box.tall {
  height: 280px;
}

.chart-box.short {
  height: 200px;
}

.seg-tabs {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.seg-btn {
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.seg-btn.active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.table-wrap.scroll-y {
  max-height: 380px;
  overflow-y: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.tbl th {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-align: left;
}

.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr:hover td {
  background: #f8fafc;
}

.tbl .r {
  text-align: right;
}

.tbl .b {
  font-weight: 700;
  color: #1e293b;
}

.tbl tr.sub td {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
}

.tbl tr.total td {
  background: #1e293b;
  color: #fff;
  font-weight: 700;
}

.tbl tr.muted td {
  color: #94a3b8;
}

/* 备注列表 */
.note-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  line-height: 22px;
}

.note-list li + li {
  margin-top: 6px;
}

.empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}

/* ---------- 以下为本站新增组件，数值沿用上面同一套 ---------- */

/* 顶部右侧数据截止标签 */
.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 每个图表/表格上方的一句大白话 */
.card-desc {
  margin: -8px 0 16px;
  color: #64748b;
  line-height: 22px;
}

.card-desc strong {
  color: #1e293b;
  font-weight: 700;
}

/* 五个大数字 */
@media (min-width: 1024px) {
  .kpi-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.kpi-value.neg {
  color: #dc2626;
}

.kpi-value.pos {
  color: #4f46e5;
}

/* 一句话结论 */
.lead {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(to bottom right, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
  color: #334155;
  font-size: 16px;
  line-height: 26px;
}

.lead strong {
  color: #4338ca;
  font-weight: 700;
}

.lead .neg {
  color: #dc2626;
}

/* 对比小格 */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 表格里的数字列不换行、负数标红 */
.tbl td.neg {
  color: #dc2626;
  font-weight: 600;
}

.tbl td.wrap {
  white-space: normal;
  min-width: 220px;
  line-height: 22px;
}

.tbl tr.warn td {
  background: #fffbeb;
}

/* 经营建议 */
.advice + .advice {
  margin-top: 12px;
}

.advice {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #f8fafc;
}

.advice-no {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: linear-gradient(to top right, #4f46e5, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.advice-body {
  min-width: 0;
  flex: 1;
}

.advice-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.advice-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: #1e293b;
}

.advice-text {
  color: #475569;
  line-height: 22px;
}

.advice-action {
  margin-top: 6px;
  color: #4338ca;
  line-height: 22px;
}

/* 页脚 */
.page-foot {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 16px 32px;
  text-align: center;
  color: #94a3b8;
  line-height: 22px;
}

@media (max-width: 640px) {
  .brand-sub {
    white-space: normal;
  }

  .kpi-value {
    font-size: 20px;
    line-height: 28px;
  }

  .card {
    padding: 16px;
  }
}

/* 窄的可换行单元格 + 单元格内小字说明 */
.tbl td.wrap-s {
  white-space: normal;
  min-width: 140px;
  max-width: 200px;
}

.tbl td.wrap {
  max-width: 420px;
}

.cell-sub {
  margin-top: 2px;
  color: #94a3b8;
  font-weight: 400;
}
