/* ==========================================================================
   中国石油集团全要素生产率（TFP）测算工作台 — v5 松石青金学术研究视觉规范
   核心色系：深松青 #103e35 / #123f35 / #164b45 · 松青主色 #07665b · 暖铜金 #d3b36c / #bb985a
   底色体系：暖白宣纸 #fcfcf9 · 清朗画布 #f3f6f6 · 浅松灰 #f2f6f3 · 纯白纸面 #ffffff
   ========================================================================== */

:root {
  color-scheme: light;
  --ink: #153634;
  --body: #2d4545;
  --muted: #536866;
  --soft: #607471;
  --line: #d9e3df;
  --line-strong: #c4d3cc;
  --pale: #f2f6f3;
  --bg: #f3f6f6;
  --paper: #ffffff;
  --warm: #fcfcf9;

  --teal: #07665b;
  --teal-hover: #065448;
  --teal-dark: #10493f;
  --teal-soft: #edf5f1;
  --teal-border: #bfd7cd;
  --nav: #123b38;

  --gold: #d3b36c;
  --gold-accent: #bb985a;
  --gold-bright: #e8c789;
  --gold-soft: #fbf5e7;
  --gold-border: #e6dab8;

  --ochre: #b87a3c;
  --ochre-dark: #805329;
  --danger: #9c3d30;
  --danger-bg: #fdf2f0;
  --danger-border: #e5bfb8;

  --radius: 13px;
  --radius-md: 9px;
  --radius-sm: 6px;

  --shadow-card: 0 2px 7px rgba(23, 58, 51, 0.035);
  --shadow-hover: 0 8px 22px -6px rgba(18, 63, 53, 0.11);
  --shadow-float: 0 18px 60px -8px rgba(9, 39, 24, 0.24);

  --font-sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --font-num: Inter, "Helvetica Neue", Arial, "PingFang SC", sans-serif;

  /* 兼容辅助别名 */
  --text-primary: var(--ink);
  --text-secondary: var(--body);
  --text-muted: var(--muted);
  --border-light: var(--line);
  --border-strong: var(--line-strong);
  --bg-surface: var(--paper);
  --bg-subtle: var(--pale);
  --cnpc-navy: var(--teal-dark);
  --cnpc-navy-deep: var(--ink);
  --cnpc-navy-soft: var(--teal-soft);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid #d2a34e;
  outline-offset: 2px;
}

.num, th, td, .metric-value, .kpi-value, .kpi-meta {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.ui-icon {
  vertical-align: middle;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   1. 全屏大气门户封面 (1.14fr : 0.86fr, 100svh Editorial Pine-Teal Portal)
   ========================================================================== */
.login-screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--warm);
}

.login-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
}

/* 左侧：深松青渐变 + 底部 73% 油田晨曦摄影主视觉 */
.login-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(2.5rem, 4.2vw, 5rem);
  background: linear-gradient(150deg, #103c34 10%, #1b4b3d 52%, #43604d 100%);
  color: #fcf8ea;
}

.login-hero-photo {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 73%;
  object-fit: cover;
  object-position: 62% 56%;
  z-index: -3;
}

.login-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    180deg,
    #103b33 0%,
    #103b33 27%,
    rgba(16, 59, 51, 0.92) 33%,
    rgba(16, 59, 51, 0.65) 43%,
    rgba(16, 59, 51, 0.14) 63%,
    rgba(16, 49, 41, 0.04) 76%,
    rgba(12, 37, 33, 0.80) 100%
  );
}

.login-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.84rem;
  width: fit-content;
}

.login-seal {
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 25%;
  border: 1px solid rgba(230, 212, 169, 0.39);
  background: #103e35;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(8, 30, 24, 0.28);
}

.login-seal > img {
  display: block;
  width: 100%;
  height: 100%;
}

.login-wordmark {
  display: grid;
  gap: 0.16rem;
}

.login-wordmark strong {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  color: #fffbf0;
  line-height: 1.32;
}

.login-wordmark small {
  color: #e3cf9f;
  font-family: var(--font-num);
  font-size: 0.67rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.19em;
}

.login-cover-head {
  margin-top: clamp(2.8rem, 8.2vh, 6.8rem);
}

.login-org {
  display: flex;
  align-items: center;
  gap: 0.76rem;
  font-size: clamp(0.88rem, 1.05vw, 1.08rem);
  font-weight: 500;
  letter-spacing: 0.075em;
  color: #e5eee3;
}

.login-org::before {
  content: "";
  display: inline-block;
  width: 1.65rem;
  height: 2px;
  flex: none;
  background: var(--gold-bright);
}

.login-hero-title {
  margin-top: 1.05rem;
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 4.5vw, 5.2rem);
  line-height: 1.22;
  font-weight: 680;
  letter-spacing: 0.012em;
  color: #fcf8ea;
  text-shadow: 0 2px 12px rgba(8, 35, 28, 0.25);
}

.login-hero-title span {
  display: block;
}

.login-cover-facts {
  margin: auto 0 0;
  padding-top: 2.8rem;
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.8vw, 3rem);
  flex-wrap: wrap;
}

.login-cover-facts > div {
  padding-left: 0.9rem;
  border-left: 2px solid #d6ba7f;
}

.login-cover-facts dt {
  font-size: 0.82rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #e6e9dc;
}

.login-cover-facts dd {
  margin: 0.22rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #fffaf0;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
}

/* 右侧：暖白宣纸极简认证画布 */
.login-access {
  background: var(--warm);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: clamp(2rem, 4vw, 4.6rem) clamp(2.1rem, 5vw, 6rem);
  min-width: 0;
}

.login-access-top {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #496055;
  font-size: 0.86rem;
  font-weight: 500;
}

.login-access-top .ui-icon {
  color: #356253;
}

.login-access-main,
.login-access-foot {
  width: 100%;
  max-width: 410px;
  justify-self: center;
}

.login-access-main {
  padding: 2rem 0;
}

.login-access-main::before {
  content: "";
  display: block;
  width: 2.6rem;
  height: 0.24rem;
  background: var(--gold-accent);
  border-radius: 4px;
  margin-bottom: 1.2rem;
}

.login-access-title {
  color: var(--ink);
  font-size: clamp(1.95rem, 2.4vw, 2.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.24;
}

.login-lede {
  color: var(--muted);
  margin-top: 0.62rem;
  font-size: 0.96rem;
  line-height: 1.55;
}

/* 双角色大尺寸卡片（选中态深松青实心 + 暖金图标与对勾） */
.login-roles {
  display: grid;
  gap: 12px;
  margin: 1.75rem 0 1.55rem;
}

.role-card {
  position: relative;
  appearance: none;
  width: 100%;
  min-height: 82px;
  padding: 16px 42px 16px 17px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #ffffff;
  border: 1px solid #c9d5cc;
  border-radius: 11px;
  color: var(--ink);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.role-card:hover {
  background: #f1f5ef;
  border-color: #87a595;
  box-shadow: 0 3px 11px rgba(20, 61, 50, 0.08);
}

.role-card-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: #eef3ec;
  border: 1px solid #d8e3d8;
  border-radius: 10px;
  color: #365f4c;
  transition: all 0.16s ease;
}

.role-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.role-card-name {
  font-size: 1.04rem;
  font-weight: 640;
  color: var(--ink);
  line-height: 1.35;
}

.role-card-desc {
  font-size: 0.84rem;
  color: #53665b;
  line-height: 1.45;
}

.role-card-check {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  color: #f0d6a0;
  opacity: 0;
  display: inline-flex;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.role-card.active {
  background: #174b3e;
  border-color: #174b3e;
  color: #fffef6;
  box-shadow: 0 10px 24px -8px rgba(16, 62, 53, 0.36);
}

.role-card.active:hover {
  background: #0d3e32;
  border-color: #0d3e32;
}

.role-card.active .role-card-icon {
  background: #2b5b4b;
  border-color: #587a61;
  color: #f0d6a0;
}

.role-card.active .role-card-name {
  color: #fffef6;
}

.role-card.active .role-card-desc {
  color: #dcebe1;
}

.role-card.active .role-card-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* 登录表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  color: #6b8178;
  display: inline-flex;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  height: 44px;
  padding: 0 60px 0 40px;
  border: 1px solid #c5d4cc;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(7, 102, 91, 0.12);
}

.pwd-eye-btn {
  position: absolute;
  right: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
}

.pwd-eye-btn:hover {
  background: var(--pale);
  color: var(--ink);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--teal);
  width: 15px;
  height: 15px;
  margin: 0;
}

.login-error {
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.btn-login-submit {
  appearance: none;
  border: none;
  height: 47px;
  border-radius: 9px;
  background: var(--teal);
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px -6px rgba(7, 102, 91, 0.36);
  transition: background 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
  margin-top: 2px;
}

.btn-login-submit:hover:not(:disabled) {
  background: var(--teal-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -6px rgba(6, 84, 72, 0.42);
}

.login-access-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 1rem;
  border-top: 1px solid #dbe1d8;
  color: #5b6b60;
  font-size: 12.5px;
  line-height: 1.5;
}

.login-access-foot svg {
  color: #557358;
  flex: none;
}

/* ==========================================================================
   2. 左侧常驻深松青品牌栏 + 宽幅研究画布外壳 (#app-shell)
   ========================================================================== */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 234px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  color: #e7efea;
  isolation: isolate;
  background: linear-gradient(165deg, #123f35 0%, #133c33 50%, #12342d 100%);
  padding: 26px 17px 16px;
  z-index: 25;
  overflow-y: auto;
}

.sidebar::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: auto 0 11%;
  height: min(31%, 235px);
  background: url("/img/hero-oilfield.jpg?v=5") 66% 57% / cover no-repeat;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(0deg, transparent, black 30%, black 55%, transparent);
  mask-image: linear-gradient(0deg, transparent, black 30%, black 55%, transparent);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 6px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand img {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(221, 197, 144, 0.37);
  border-radius: 25%;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #ffffff;
  line-height: 1.38;
  white-space: nowrap;
}

.brand span {
  color: #e3cda0;
  letter-spacing: 0.14em;
  font-family: var(--font-num);
  font-size: 9.5px;
  font-weight: 640;
  margin-top: 1px;
}

.side-nav {
  display: flex;
  flex-direction: column;
}

.nav-label {
  padding: 22px 12px 8px;
  color: #adc5b8;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.nav-label.second {
  padding-top: 24px;
}

.nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: #d4e1d8;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 8px 13px;
  position: relative;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 7px;
  margin: 2px 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .ui-icon {
  color: #b9cec3;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active {
  color: #ffffff;
  background: #315d4d;
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  height: 18px;
  width: 3px;
  background: #e9c985;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  border-radius: 0 3px 3px 0;
}

.nav-item.active .ui-icon {
  color: #f3d79f;
}

.side-bottom {
  margin-top: auto;
  padding-top: 16px;
}

.user-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 4px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #254e40;
  border: 1px solid #6f8268;
  color: #f0d59b;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.user-copy {
  min-width: 0;
  flex: 1;
}

.user-copy b,
.user-copy small {
  display: block;
}

.user-copy b {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-copy small {
  font-size: 11px;
  color: #bdd1c5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.side-action-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #dce8e0;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* 右侧工作区与 62px 纯白顶栏 */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 0 clamp(18px, 2.6vw, 44px);
  gap: 16px;
}

.topbar-left,
.breadcrumb,
.top-meta,
.page-actions,
.card-tools,
.year-control {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 10px;
  min-width: 0;
}

.icon-button.menu-btn,
.menu-btn,
.header-mark,
.mobile-scrim {
  display: none;
}

.breadcrumb {
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
}

.breadcrumb > b {
  font-weight: 400;
  color: #97a69c;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 620;
}

.top-meta {
  gap: 12px;
  white-space: nowrap;
}

.top-divider {
  height: 14px;
  width: 1px;
  background: #d6e0d6;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 550;
  color: #305e50;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sync-text-short {
  display: none;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a89f;
  flex-shrink: 0;
}

.sync-pill.is-cloud .sync-dot {
  background: #0d8a72;
  box-shadow: 0 0 0 3px rgba(13, 138, 114, 0.16);
}

.sync-pill.is-local .sync-dot {
  background: var(--ochre);
  box-shadow: 0 0 0 3px rgba(184, 122, 60, 0.18);
}

.sync-pill.is-uncertain {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid #d9a043;
  color: #824d0b;
  font-weight: 630;
  cursor: pointer;
}

.sync-pill.is-uncertain .sync-dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.24);
}

/* 云端空库 / 提交待核实诚实提示横幅 (H06) */
.cloud-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--gold-soft);
  border: 1px solid #dfb66f;
  color: #6b4312;
  font-size: 13px;
  line-height: 1.55;
}

.cloud-status-banner.is-uncertain {
  background: #fff7e6;
  border-color: #d99b38;
  color: #7c4608;
}

.cloud-status-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cloud-status-banner-copy strong {
  font-size: 13.5px;
  font-weight: 660;
  color: #5b3408;
}

.cloud-status-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ==========================================================================
   3. 通用按钮、胶囊分段、选择框与松青纯净卡片
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #2e5147;
  border: 1px solid #c8d7ce;
  border-radius: 7px;
  padding: 7px 13px;
  min-height: 36px;
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: #eef5f0;
  border-color: #a4c1b4;
}

.btn-primary,
.btn-navy {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled),
.btn-navy:hover:not(:disabled) {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
}

.btn-danger-outline {
  border-color: var(--danger-border);
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-danger-outline:hover:not(:disabled) {
  background: #f9e4e0;
  border-color: #d69d92;
}

.btn-sm {
  padding: 5px 11px;
  min-height: 32px;
  font-size: 12.8px;
}

.btn-xs {
  padding: 4px 9px;
  min-height: 28px;
  font-size: 12px;
  border-radius: 6px;
}

.text-btn {
  appearance: none;
  border: none;
  padding: 4px 0;
  background: transparent;
  color: var(--teal);
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.text-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #4a625a;
}

.icon-button:hover {
  background: #eef5f0;
  border-color: #a9c5b9;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f0f4f0;
  border: 1px solid #e1e8e1;
  border-radius: 7px;
  padding: 2px;
}

.seg-btn {
  appearance: none;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #5c7166;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  padding: 6px 10px;
  min-height: 29px;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active {
  color: #075c4d;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(30, 80, 65, 0.11);
  font-weight: 650;
}

select,
.compact-select {
  appearance: none;
  min-height: 34px;
  padding: 4px 28px 4px 10px;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  background: #ffffff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='none' stroke='%23576b66' stroke-width='1.7' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
}

select:focus,
.compact-select:focus {
  outline: none;
  border-color: var(--teal);
}

.year-control {
  background: #ffffff;
  border: 1px solid #cad7ce;
  border-radius: 8px;
  padding-left: 11px;
  gap: 4px;
  color: #40574f;
  font-size: 13px;
  font-weight: 550;
}

.year-control select {
  border: 0;
  min-height: 35px;
  font-size: 13.5px;
  font-weight: 650;
  padding-left: 4px;
  background-color: transparent;
}

.span-tag,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf5f1;
  border: 1px solid #d0e1d7;
  color: #1f5a4a;
  font-size: 12px;
  font-weight: 580;
  white-space: nowrap;
}

/* ==========================================================================
   4. 主画布、页头 (.page-head)、口径控制卡 (.control-card) 与纯净卡片 (.card)
   ========================================================================== */
.main-container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px clamp(18px, 2.6vw, 44px) 40px;
  min-width: 0;
  flex: 1;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

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

.page-head h1 {
  color: var(--ink);
  font-size: clamp(27px, 2.2vw, 35px);
  font-weight: 680;
  line-height: 1.28;
  letter-spacing: -0.04em;
}

.page-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}

.page-actions {
  gap: 9px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  min-width: 0;
  padding: 20px 22px;
}

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

.card-head h2 {
  color: var(--ink);
  font-size: 17.5px;
  font-weight: 640;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.card-head p {
  color: var(--muted);
  font-size: 12.8px;
  margin-top: 3px;
  line-height: 1.5;
}

.card-tools {
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* 全局口径控制卡 */
.control-card {
  padding: 13px 20px;
  margin-bottom: 18px;
}

.filter-groups {
  display: flex;
  align-items: center;
  gap: 11px 16px;
  flex-wrap: wrap;
}

.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 12.5px;
  font-weight: 640;
  color: var(--ink);
  white-space: nowrap;
}

/* ==========================================================================
   5. 年度总览：4卡不对称指标带 (.metrics)、趋势主图与零轴双向贡献条
   ========================================================================== */
.metrics {
  display: grid;
  grid-template-columns: 1.14fr 1.03fr 1fr 1fr;
  gap: 14px;
}

.metric {
  min-width: 0;
  padding: 18px 20px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 132px;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #4b645a;
  font-size: 13.8px;
  font-weight: 560;
}

.metric-head > span {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.metric-head small {
  font-size: 11px;
  font-weight: 500;
  color: #536b60;
}

.metric-icon {
  width: 28px;
  height: 28px;
  padding: 5px;
  background: #eef4f0;
  border-radius: 7px;
  color: #5b7f71;
  display: inline-grid;
  place-items: center;
  flex: none;
}

.metric-value {
  color: var(--ink);
  font-size: clamp(28px, 2.3vw, 37px);
  font-weight: 630;
  letter-spacing: -0.04em;
  line-height: 1.24;
  margin-top: 8px;
  white-space: nowrap;
}

.metric-value small {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  padding-left: 5px;
  color: var(--soft);
}

.metric-base {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.rate {
  font-size: 12.2px;
  color: var(--soft);
  white-space: nowrap;
}

.rate strong {
  font-weight: 640;
  color: #1f6253;
  padding-left: 3px;
}

.rate strong.fall {
  color: var(--ochre-dark);
}

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

/* 首卡深松青实心高光卡片 */
.metric.primary {
  background: #164b45;
  border-color: #164b45;
  overflow: hidden;
}

.metric.primary .metric-head {
  color: #e1ede5;
}

.metric.primary .metric-head small {
  color: #d1e6d9;
  border: 1px solid #799e8f;
  padding: 0 5px;
  border-radius: 4px;
  line-height: 1.5;
}

.metric.primary .metric-icon {
  background: #285c54;
  color: #cae6d5;
}

.metric.primary .metric-value {
  color: #ffffff;
  font-size: clamp(33px, 2.7vw, 43px);
  line-height: 1.15;
}

.metric.primary .rate {
  color: #c3d8c9;
}

.metric.primary .rate strong {
  color: #e8e3b9;
}

.metric.primary .rate strong.fall {
  color: #f1d3a0;
}

.metric .spark {
  width: 42%;
  max-width: 108px;
  height: 26px;
  opacity: 0.92;
  flex-shrink: 0;
}

/* 2.12fr : 0.94fr 主趋势与贡献分析区 */
.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.12fr) minmax(260px, 0.94fr);
  gap: 16px;
  align-items: stretch;
}

.trend-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.trend-title select {
  appearance: none;
  min-width: 0;
  min-height: 0;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid #b0c8bd;
  border-radius: 0;
  padding: 0 20px 1px 1px;
}

.trend-title > svg {
  position: absolute;
  right: 1px;
  pointer-events: none;
  color: #477268;
}

/* 可交互 SVG 线型图例按钮条 */
.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.legend-interactive {
  gap: 6px 8px;
  margin-bottom: 10px;
}

.legend-interactive button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  background: #f4f8f7;
  border: 1px solid #dbe6e1;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 540;
  color: #284b43;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.legend-interactive button:hover {
  border-color: #7da998;
}

.legend-interactive button.muted {
  background: #ffffff;
  color: #6b7d77;
  border-color: #dce2df;
  border-style: dashed;
  font-weight: 400;
}

.legend-interactive button.muted .series-swatch {
  opacity: 0.35;
}

.series-swatch {
  flex: none;
  width: 24px;
  height: 12px;
}

.trend-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 20px;
  margin-top: 8px;
  padding-top: 11px;
  border-top: 1px solid #e2e9e5;
  font-size: 13px;
  color: #526b62;
}

.trend-summary > span:first-child {
  font-weight: 600;
  color: #36534b;
}

.trend-summary b {
  color: #165c50;
  margin-left: 3px;
  font-size: 14.5px;
  font-weight: 650;
}

/* 右卡：年度增长来源（零轴双向水平贡献条） */
.contribution-card {
  display: flex;
  flex-direction: column;
}

.con-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 15px;
  border-bottom: 1px solid #e5ece6;
  font-size: 13.5px;
  color: #405d55;
}

.con-total strong {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.con-list {
  display: grid;
  gap: 18px;
  margin: 18px 0 18px;
}

.con-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 5px;
  font-size: 13.5px;
  color: #345249;
}

.con-row-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 540;
}

.con-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.con-row b {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 620;
  color: var(--ink);
}

.bar-track {
  grid-column: 1 / -1;
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: #edf2ef;
}

.bar-track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  height: 14px;
  width: 1px;
  background: #adbbb0;
}

.bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
}

.contribution-card .text-btn {
  margin-top: auto;
  width: 100%;
  border-top: 1px solid #e0e9e4;
  padding-top: 13px;
  justify-content: flex-start;
}

/* ==========================================================================
   6. 增长与分解 / 财务分析 KPI 矩阵与双列图表画布
   ========================================================================== */
.kpi-strip {
  display: grid;
  gap: 14px;
}

.kpi-strip.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-strip.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.kpi-card:hover {
  border-color: #b4cabf;
  box-shadow: var(--shadow-hover);
}

.kpi-card.is-primary {
  background: #164b45;
  border-color: #164b45;
  color: #ffffff;
}

.kpi-title {
  font-size: 12.8px;
  font-weight: 580;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kpi-card.is-primary .kpi-title {
  color: #d6e7dd;
}

.kpi-value {
  font-size: 27px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.kpi-card.is-primary .kpi-value {
  color: #ffffff;
}

.kpi-unit {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--soft);
  margin-left: 5px;
  letter-spacing: 0;
}

.kpi-card.is-primary .kpi-unit {
  color: #bfd8ca;
}

.kpi-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #ebf0ec;
}

.kpi-card.is-primary .kpi-meta {
  color: #cde0d4;
  border-top-color: rgba(255, 255, 255, 0.16);
}

.delta-pos {
  color: #0b6b5c;
  font-weight: 650;
}

.delta-neg {
  color: var(--ochre-dark);
  font-weight: 650;
}

.kpi-card.is-primary .delta-pos {
  color: #e8e3b9;
}

.kpi-card.is-primary .delta-neg {
  color: #f1d3a0;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-card .card-head {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2ef;
}

.chart-canvas {
  width: 100%;
  height: 365px;
}

.chart-canvas.chart-overview {
  height: 315px;
}

/* 自定义起止年份区间核算条 */
.custom-phase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 9px 13px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--body);
}

.custom-phase-selectors {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.custom-phase-label {
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.custom-phase-dash {
  color: var(--muted);
  font-weight: 600;
}

.custom-phase-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.phase-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #dbe5df;
  color: var(--muted);
}

.phase-stat-chip strong {
  color: var(--ink);
  font-weight: 650;
}

.phase-stat-chip.is-accent strong {
  color: var(--teal);
}

/* ==========================================================================
   7. 纯净学术结果数据表 (.result-table)、年份溯源与分子分母明细
   ========================================================================== */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card > .card-head {
  padding: 18px 22px 13px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.table-context-bar {
  padding: 10px 22px;
  background: #fafcfa;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.6px;
  color: var(--muted);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  max-height: 70vh;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.result-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f2f6f2;
  color: #455e57;
  font-size: 12.2px;
  font-weight: 620;
  padding: 10px 13px;
  text-align: right;
  border-bottom: 1px solid #dce6e0;
}

.result-table thead th:first-child {
  text-align: left;
  left: 0;
  z-index: 6;
  padding-left: 22px;
}

.result-table tbody td {
  padding: 10px 13px;
  border-bottom: 1px solid #e7eee9;
  text-align: right;
  color: #2f4942;
  background: #ffffff;
  vertical-align: middle;
}

.result-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  padding-left: 22px;
  font-weight: 620;
  color: var(--ink);
  border-right: 1px solid #e9f0ec;
}

.result-table th:last-child,
.result-table td:last-child {
  padding-right: 22px;
}

.result-table tbody tr:hover td {
  background: #f2f7f4;
}

.result-table tbody tr.summary-row td {
  background: #eef5f1;
  font-weight: 660;
  color: #10493f;
  border-top: 1px solid #c9dbd2;
  border-bottom: 1px solid #c9dbd2;
}

.result-table tbody tr.custom-row td {
  background: var(--gold-soft);
  font-weight: 650;
  color: var(--ink);
}

.result-table .em-num {
  font-weight: 650;
  color: #0e5a4d;
}

.year-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 2px 5px 2px 0;
  color: #0e5d4f;
  font-family: var(--font-num);
  font-size: 13.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: underline;
  text-decoration-color: #aac6b7;
  text-underline-offset: 3px;
  cursor: pointer;
}

.year-link svg {
  color: var(--gold-accent);
  opacity: 0.85;
}

.year-link:hover {
  color: var(--teal);
  text-decoration-color: var(--teal);
}

.fin-ratio-main {
  font-weight: 600;
  color: var(--ink);
}

.fin-ratio-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}

.fin-formula-legend {
  padding: 11px 22px;
  background: var(--pale);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 11.8px;
  color: var(--muted);
}

.fin-formula-legend span strong {
  color: var(--ink);
}

.cell-pending {
  color: var(--ochre-dark) !important;
  font-weight: 600;
  font-size: 12px;
}

/* ==========================================================================
   8. 年度数据纵向渐进披露工作流 (.entry-page) 与版本时间轴 (.timeline)
   ========================================================================== */
.entry-page {
  max-width: 1260px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.entry-yearbar,
.entry-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.entry-period {
  display: grid;
  gap: 7px;
}

.entry-period > label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 650;
}

.entry-period > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-period select {
  min-width: 128px;
  font-weight: 650;
}

.entry-year-state {
  display: grid;
  align-items: center;
  grid-template-columns: 8px auto;
  column-gap: 8px;
  color: var(--teal-dark);
  font-size: 13px;
}

.entry-year-state small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.entry-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.entry-year-state[data-progress="pending"] .entry-status-dot {
  background: var(--ochre);
}

.entry-year-state[data-progress="empty"] .entry-status-dot {
  background: #86958f;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-card .card-head {
  margin-bottom: 0;
  align-items: center;
}

/* 并排双虚线上传卡 */
.entry-uploads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.entry-upload {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 17px 17px;
  border: 1.5px dashed #aebfb5;
  border-radius: 10px;
  background: #f8faf7;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.entry-upload:hover,
.entry-upload.is-dragover {
  border-color: var(--teal);
  background: #edf5f1;
}

.entry-upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d0dfd3;
  border-radius: 8px;
  color: var(--teal);
  background: #eaf2ec;
}

.entry-upload h3,
.entry-submit h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 630;
}

.entry-upload p,
.entry-submit p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.6px;
  line-height: 1.55;
}

.entry-upload-btn {
  margin-top: 11px;
  pointer-events: none;
}

/* 四表状态指示槽 */
.stmt-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.stmt-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--pale);
  font-size: 12.4px;
  font-weight: 580;
  color: var(--muted);
  white-space: nowrap;
}

.stmt-slot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9c8c1;
  flex-shrink: 0;
}

.stmt-slot.is-ready {
  background: #eaf5ef;
  border-color: #b2d4c2;
  color: #135445;
}

.stmt-slot.is-ready .stmt-slot-dot {
  background: var(--teal);
}

.wind-parsed-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.wind-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.parsed-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eef5f1;
  border: 1px solid #c5dbd0;
  color: var(--teal-dark);
  font-size: 12.2px;
  font-weight: 600;
}

.file-chip.is-supp {
  background: var(--gold-soft);
  border-color: var(--gold-border);
  color: #6b4e1e;
}

.wind-validation-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: #704e27;
}

.wind-validation-banner.is-ok {
  background: #edf5ee;
  border-color: #cce0d2;
  color: #1f5748;
}

.ext-params-box {
  background: #fafcfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.ext-params-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 11px;
}

/* 在线填报区：常驻 4 列外部参数 + 手风琴折叠财务三表 */
.entry-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-supplements {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 15px;
  padding: 15px 16px;
  background: #f8fbf9;
  border: 1px solid #d5e3db;
  border-radius: 10px;
}

.entry-supplements.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.entry-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.8px;
  font-weight: 590;
  color: var(--ink);
  margin: 0 0 6px;
}

.entry-input {
  display: flex;
  min-width: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cad7d0;
  border-radius: 7px;
  background: var(--paper);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.entry-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2.5px rgba(7, 102, 91, 0.12);
}

.entry-input.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.entry-input input {
  width: 100%;
  min-width: 0;
  display: block;
  padding: 6px 9px;
  min-height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  color: var(--ink);
}

.entry-input > span {
  display: flex;
  align-items: center;
  padding: 0 9px 0 3px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.entry-origin {
  margin-top: 4px;
  font-size: 11.3px;
  color: #6b8079;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-error {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--danger);
  line-height: 1.38;
}

.entry-groups {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.entry-groups > details + details {
  border-top: 1px solid var(--line);
}

.entry-groups > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  padding: 13px 16px;
  cursor: pointer;
  background: #ffffff;
  transition: background 0.14s ease;
}

.entry-groups > details > summary::-webkit-details-marker {
  display: none;
}

.entry-groups > details > summary:hover {
  background: #f5f9f6;
}

.entry-groups > details[open] > summary {
  background: var(--pale);
  border-bottom: 1px solid var(--line);
}

.entry-groups > details > summary::after {
  content: "";
  transform: rotate(45deg);
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  margin: -3px 4px 0 4px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.entry-groups > details[open] > summary::after {
  transform: rotate(225deg);
  margin: 4px 4px 0 4px;
}

.entry-groups > details > summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 630;
  font-size: 14px;
}

.entry-groups > details > summary > small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.entry-financial-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 16px;
  align-items: start;
}

.entry-financial-fields.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
}

.entry-submit {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.form-submit-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.field-unit {
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
}

.field-input {
  width: 100%;
  height: 37px;
  padding: 0 10px;
  border: 1px solid #cad7d0;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 13.5px;
}

.field-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2.5px rgba(7, 102, 91, 0.12);
}

.field-input.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* 版本记录时间轴 (.timeline) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.timeline li:first-child {
  border-top: none;
  padding-top: 4px;
}

.timeline-pin {
  margin-top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7f0eb;
  color: var(--teal);
  flex-shrink: 0;
}

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

.rev-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rev-title h3 {
  font-size: 14.8px;
  font-weight: 620;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.snapshot-id-tag {
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 660;
  padding: 1px 7px;
  border-radius: 4px;
  background: #eaf3ee;
  color: var(--teal-dark);
}

.revision-meta {
  font-size: 12.6px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

.snapshot-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   9. 侧滑快速编辑抽屉、宽屏业务弹窗与 Toast 通知
   ========================================================================== */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 45, 38, 0.48);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.drawer-backdrop.is-open,
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 95vw);
  z-index: 100;
  background: var(--paper);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel.is-open {
  transform: translateX(0);
}

.drawer-header,
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
}

.drawer-title-text,
.modal-title-text {
  font-size: 16.5px;
  font-weight: 660;
  color: var(--ink);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-footer,
.modal-footer {
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: #fafcfa;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  width: 100%;
  max-width: 470px;
  max-height: 88vh;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog.is-wide {
  max-width: 940px;
}

.modal-body {
  padding: 18px 22px;
  font-size: 13.5px;
  overflow-y: auto;
  flex: 1;
}

.pwd-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 弹窗内部溯源、影响预览与差异表样式 */
.modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 13.8px;
  font-weight: 650;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.trace-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.trace-stat-box {
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trace-stat-box span {
  font-size: 11.5px;
  color: var(--muted);
}

.trace-stat-box strong {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 660;
  color: var(--ink);
}

.trace-stat-box small {
  font-size: 11px;
  color: var(--body);
}

.mini-table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.mini-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f6f2;
  color: #455e57;
  font-weight: 640;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #d4e0d9;
  white-space: nowrap;
}

.mini-table th.is-num,
.mini-table td.is-num {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.mini-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #ebf1ed;
  color: var(--body);
  vertical-align: top;
}

.mini-table tbody tr:nth-child(even) td {
  background: #fafcfa;
}

.cell-coord-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eaf3ee;
  color: var(--teal-dark);
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 660;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.2px;
  font-weight: 620;
  white-space: nowrap;
}

.tag-badge.is-direct {
  background: #eaf3ee;
  color: var(--teal-dark);
}

.tag-badge.is-carryover {
  background: var(--gold-soft);
  color: #7c561d;
  border: 1px solid var(--gold-border);
}

.tag-badge.is-seed {
  background: #eff3f1;
  color: #516660;
}

.tag-badge.is-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.tag-badge.is-ok {
  background: #e7f4ed;
  color: #0e6656;
}

.impact-alert-box {
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: #704e27;
  font-size: 12.8px;
  line-height: 1.55;
}

.impact-alert-box.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.impact-note-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.impact-note-row label {
  font-size: 12.6px;
  font-weight: 640;
  color: var(--ink);
}

.impact-note-input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #cad7d0;
  border-radius: 7px;
  font-size: 13px;
}

.impact-note-input:focus {
  outline: none;
  border-color: var(--teal);
}

/* JSON 备份导入模式切换卡片 (H07) */
.restore-mode-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.restore-mode-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.restore-mode-opt:hover {
  border-color: #7ea897;
  background: #f7fbf9;
}

.restore-mode-opt.is-selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 2px rgba(7, 102, 91, 0.12);
}

.restore-mode-opt input[type="radio"] {
  accent-color: var(--teal);
  margin: 3px 0 0;
  flex-shrink: 0;
}

.restore-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.restore-mode-copy strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.38;
}

.restore-mode-copy small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast-item {
  background: #173d34;
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 560;
  box-shadow: 0 6px 22px rgba(16, 59, 40, 0.25);
  border-left: 3.5px solid var(--gold-bright);
}

.toast-item.is-success {
  border-left-color: #6fd3aa;
}

.toast-item.is-error {
  background: #6c281f;
  border-left-color: #f3b3a8;
}

/* ==========================================================================
   10. 响应式断点适配 (>=1550px / <=1240px / <=975px / <=740px / <=430px)
   ========================================================================== */
@media (min-width: 1550px) {
  .app-shell {
    grid-template-columns: 246px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 20px;
    padding-right: 20px;
  }
  .metric {
    min-height: 142px;
    padding: 20px 23px;
  }
  .analysis-grid {
    grid-template-columns: minmax(0, 2.28fr) minmax(290px, 0.92fr);
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 202px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 13px;
  }
  .kpi-strip.cols-5,
  .kpi-strip.cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .entry-supplements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trace-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 975px) {
  .login-entry {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-cover {
    min-height: clamp(14rem, 32svh, 20rem);
    padding: 1.6rem max(1.5rem, calc((100vw - 32rem) / 2));
    justify-content: space-between;
  }
  .login-hero-photo {
    inset: 0;
    height: 100%;
    object-position: 67% 57%;
  }
  .login-cover::before {
    background:
      linear-gradient(90deg, rgba(13, 51, 43, 0.96) 0%, rgba(16, 57, 48, 0.85) 36%, rgba(16, 57, 48, 0.35) 75%, rgba(16, 57, 48, 0.14)),
      linear-gradient(0deg, rgba(12, 40, 32, 0.56), transparent 65%);
  }
  .login-cover-head {
    margin-top: 1.4rem;
  }
  .login-hero-title {
    font-size: clamp(2.1rem, 6vw, 3.1rem);
  }
  .login-cover-facts {
    display: none;
  }
  .login-access {
    padding: 1.8rem max(1.5rem, calc((100vw - 29rem) / 2)) 2rem;
  }
  .login-access-top {
    justify-self: start;
  }
  .login-access-main {
    padding: 1.2rem 0 1.4rem;
  }
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .entry-financial-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 236px;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 40;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .mobile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(18, 54, 44, 0.45);
    z-index: 35;
  }
  .icon-button.menu-btn,
  .menu-btn {
    display: inline-grid;
  }
  .header-mark {
    display: block;
    flex: none;
    border-radius: 25%;
  }
  .topbar {
    padding: 0 14px;
    height: 54px;
  }
  .breadcrumb > span,
  .breadcrumb > b {
    display: none;
  }
  .top-meta {
    gap: 8px;
  }
  .sync-pill {
    display: inline-flex;
    font-size: 11.5px;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--pale);
    border: 1px solid var(--line);
  }
  .sync-pill.is-uncertain {
    background: var(--gold-soft);
    border-color: #d9a043;
    color: #824d0b;
  }
  .sync-text-full {
    display: none;
  }
  .sync-text-short {
    display: inline;
  }
  .top-divider {
    display: none;
  }
  .restore-mode-group {
    grid-template-columns: 1fr;
  }
  .main-container {
    padding: 18px 14px 32px;
  }
  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .kpi-strip.cols-5,
  .kpi-strip.cols-6,
  .entry-uploads,
  .stmt-slots,
  .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .timeline li {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .metrics,
  .kpi-strip.cols-5,
  .kpi-strip.cols-6,
  .entry-uploads,
  .entry-supplements,
  .entry-financial-fields,
  .stmt-slots,
  .form-grid-4,
  .trace-summary-grid {
    grid-template-columns: 1fr;
  }
}
