/* ============================================================
   组件样式（与 components.js 中的类名一一对应）
   ============================================================ */

/* ---------------------------- 应用外壳 ---------------------------- */
.shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface);
}

.shell__side {
  display: none;
}

.shell__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.shell__body {
  flex: 1 1 auto;
  min-width: 0;
}

.page {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 16px 16px 96px;
}

/* 外壳已经提供了一层 .page；页面内部再写 .page 时不重复加内边距 */
.page .page {
  padding: 0;
  max-width: none;
  margin: 0;
}

@media (min-width: 1024px) {
  .shell__side {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, #0a1a24 0%, #0b2230 60%, #061219 100%);
    color: #cfe3ea;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px 14px;
    z-index: 20;
  }
  .page {
    padding: 24px 28px 56px;
  }
}

/* ---------------------------- 侧边栏 ---------------------------- */
.side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.side__logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.8);
}
.side__title {
  color: #fff;
  font-weight: 650;
  letter-spacing: 1px;
  line-height: 1.2;
}
.side__sub {
  font-size: 11px;
  color: #6f8b99;
  letter-spacing: 0.6px;
}
.side__group {
  padding: 14px 10px 6px;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #5c7787;
}
.side__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #b9d2dd;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  position: relative;
}
.side__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side__item.is-active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.22), rgba(34, 211, 238, 0.04));
  color: #fff;
}
.side__item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #22d3ee;
}
.side__ico {
  width: 18px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}
.side__spacer {
  flex: 1;
}
.side__user {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side__user .avatar {
  background: rgba(34, 211, 238, 0.2);
  color: #a5f3fc;
}

/* ---------------------------- 移动顶栏 ---------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__title {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink-900);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-right: 34px;
}
.topbar__back {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-700);
  font-size: 18px;
}
.topbar__back:active {
  background: var(--line-soft);
}
.topbar--flat {
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------------------------- 移动 Tab 栏 ---------------------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-400);
  font-size: 10.5px;
  position: relative;
  transition: color 0.16s ease;
}
.tabbar__item.is-active {
  color: var(--brand-600);
  font-weight: 600;
}
.tabbar__ico {
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  height: 22px;
}
.tabbar__item.is-active .tabbar__ico {
  transform: translateY(-1px);
}
.tabbar__dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px #fff;
}
@media (min-width: 1024px) {
  .tabbar { display: none; }
}

/* ---------------------------- 卡片 ---------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
}
.card + .card {
  margin-top: 12px;
}
.card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
}
.card__bd {
  padding: 0;
}
.card__hd + .card__bd {
  margin-top: 12px;
}
.card__bd--tight {
  padding: 0;
}
.card__ft {
  margin: 12px -16px -14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.card__title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand-500);
}
.card__extra {
  font-size: 12.5px;
  color: var(--brand-600);
}

.card--hero {
  background: var(--grad-brand);
  color: #fff;
  border: 0;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 36px -22px rgba(8, 60, 78, 0.9);
  padding: 18px 18px 16px;
}
.card--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}
.card--hero .card__bd {
  position: relative;
  z-index: 1;
}

/* ---------------------------- 数字与金额 ---------------------------- */
.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink-900);
}
.amount--xl { font-size: 30px; line-height: 1.2; }
.amount--lg { font-size: 22px; line-height: 1.25; }
.amount--md { font-size: 17px; }
.amount__unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-400);
  margin-left: 3px;
  letter-spacing: 0;
}
.hero-amount {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -1px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* ---------------------------- 状态标签 ---------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.tag--brand { background: var(--brand-050); color: var(--brand-700); }
.tag--success { background: var(--success-bg); color: var(--success); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--neutral { background: var(--surface); color: var(--ink-500); }
.tag--dark { background: rgba(255, 255, 255, 0.16); color: #fff; }
.tag--dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------- 按钮 ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid transparent;
  transition: transform 0.08s ease, filter 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }
.btn--primary {
  background: linear-gradient(135deg, #0e7490, #0b5f77);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(13, 105, 130, 0.9);
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-700);
}
.btn--ghost:hover { border-color: var(--brand-400); color: var(--brand-700); }
.btn--soft { background: var(--brand-050); color: var(--brand-700); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--danger:hover { filter: brightness(0.98); }
.btn--block { width: 100%; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn--icon { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: transparent; }
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row > .btn { flex: 1; }

/* ---------------------------- 列表 ---------------------------- */
.list {
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
  width: 100%;
  text-align: left;
  transition: background 0.14s ease;
}
.list__item + .list__item {
  border-top: 1px solid var(--line-soft);
}
.list__item:hover {
  background: var(--surface-2);
}
.list__item:active {
  background: var(--surface);
}
.list__ico {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: 17px;
}
.list__main { flex: 1; min-width: 0; }
.list__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list__desc {
  display: block;
  font-size: 12.5px;
  color: var(--ink-400);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list__side { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.list__arrow { color: var(--ink-300); font-size: 16px; }

/* 单据行（融单卡片） */
.doc {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 14px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.doc:hover {
  border-color: var(--brand-100);
  box-shadow: var(--shadow-sm);
}
.doc:active { transform: scale(0.995); }
.doc + .doc { margin-top: 10px; }
.doc__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.doc__name { font-size: 14.5px; font-weight: 650; color: var(--ink-900); }
.doc__no { font-size: 11.5px; color: var(--ink-400); font-family: var(--font-mono); margin-top: 2px; }
.doc__amount { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc__meta { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.doc__meta-item { font-size: 12px; color: var(--ink-400); }
.doc__meta-item b { display: block; font-size: 13px; color: var(--ink-700); font-weight: 600; margin-top: 1px; }

/* ---------------------------- 键值行 ---------------------------- */
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 13.5px;
}
.kv + .kv { border-top: 1px dashed var(--line-soft); }
.kv__k { color: var(--ink-400); flex: 0 0 auto; }
.kv__v { color: var(--ink-800); font-weight: 600; text-align: right; word-break: break-all; }

/* ---------------------------- 分段控件 ---------------------------- */
.seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border-radius: 10px;
}
.seg__item {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.seg__item.is-active {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-xs);
}
.seg__count {
  font-size: 11px;
  padding: 0 5px;
  height: 15px;
  line-height: 15px;
  border-radius: 999px;
  background: var(--danger-bg);
  color: var(--danger);
}
@media (min-width: 768px) {
  .seg {
    display: inline-flex;
    width: auto;
  }
  .seg__item {
    flex: 0 0 auto;
    padding: 0 18px;
  }
}

/* ---------------------------- 统计卡 ---------------------------- */
.stat {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.stat__label { font-size: 12px; color: var(--ink-400); }
.stat__value {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  letter-spacing: -0.4px;
}
.stat__hint { font-size: 11px; color: var(--ink-400); margin-top: 2px; }

/* ---------------------------- 网格 ---------------------------- */
.grid { display: grid; gap: 10px; }.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid { gap: 14px; }
}
@media (min-width: 1024px) {
  .grid--2-desktop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------- 时间轴 ---------------------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline__item { position: relative; padding-bottom: 18px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  box-sizing: border-box;
}
.timeline__item::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 16px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__item.is-done::before { background: var(--brand-500); border-color: var(--brand-500); }
.timeline__item.is-current::before {
  background: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
}
.timeline__item.is-reject::before { background: var(--danger); border-color: var(--danger); }
.timeline__title { font-size: 13.5px; font-weight: 600; color: var(--ink-800); display: flex; align-items: center; gap: 8px; }
.timeline__meta { font-size: 12px; color: var(--ink-400); margin-top: 3px; }
.timeline__note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-600, var(--ink-500));
  background: var(--surface-2);
  border-radius: 8px;
  padding: 7px 9px;
  border-left: 2px solid var(--brand-100);
}

/* ---------------------------- 步骤条 ---------------------------- */
.steps { display: flex; align-items: center; gap: 6px; }
.steps__item { display: flex; align-items: center; gap: 6px; flex: 1; }
.steps__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink-400);
  flex: 0 0 22px;
}
.steps__item.is-active .steps__dot { background: var(--brand-600); color: #fff; }
.steps__item.is-done .steps__dot { background: var(--brand-100); color: var(--brand-700); }
.steps__label { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; }
.steps__item.is-active .steps__label { color: var(--ink-800); font-weight: 600; }
.steps__bar { flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.steps__bar.is-done { background: var(--brand-400); }

/* ---------------------------- 表单 ---------------------------- */
.field { margin-bottom: 14px; }
.field__label {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field__label b { color: var(--danger); font-weight: 600; }
.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  color: var(--ink-900);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  appearance: none;
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(34, 184, 212, 0.14);
}
.input--lg { height: 50px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.field__hint { font-size: 11.5px; color: var(--ink-400); margin-top: 5px; }
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%238494a7' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.check.is-checked {
  border-color: var(--brand-400);
  background: var(--brand-050);
}
.check__box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  margin-top: 1px;
}
.check.is-checked .check__box {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

/* ---------------------------- 空状态 ---------------------------- */
.empty {
  padding: 44px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-400);
}
.empty__ico {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--ink-300);
}
.empty__title { font-size: 13.5px; font-weight: 600; color: var(--ink-500); }
.empty__desc { font-size: 12px; text-align: center; max-width: 260px; }

/* ---------------------------- 底部弹层 / 弹窗 ---------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(9, 17, 28, 0.44);
  backdrop-filter: blur(2px);
  animation: fade-in 0.16s ease;
}
@media (min-width: 768px) {
  .overlay { align-items: center; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  animation: sheet-up 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
  padding-bottom: var(--safe-bottom);
}
@media (min-width: 768px) {
  .sheet {
    width: 480px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    animation: pop-in 0.18s ease;
  }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet__hd {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 16px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.sheet__title { font-size: 16px; font-weight: 650; color: var(--ink-900); }
.sheet__bd { padding: 8px 18px 16px; }
.sheet__ft {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 18px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
}
.sheet__ft > .btn { flex: 1; }

/* ---------------------------- Toast ---------------------------- */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
}
.toast--success { background: rgba(15, 157, 118, 0.96); }
.toast--warn { background: rgba(194, 117, 26, 0.96); }
.toast--danger { background: rgba(210, 60, 60, 0.96); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------- 进度条 ---------------------------- */
.progress {
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22b8d4, #0e7490);
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------- 头像 / 徽标 ---------------------------- */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-050);
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 650;
  flex: 0 0 auto;
}
.avatar--lg { width: 48px; height: 48px; font-size: 17px; }

/* ---------------------------- 提示条 ---------------------------- */
.alert {
  display: flex;
  gap: 9px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--info-bg);
  color: #1e40af;
}
.alert--warn { background: var(--warn-bg); color: #8a4d0a; }
.alert--brand { background: var(--brand-050); color: var(--brand-700); }
.alert__ico { flex: 0 0 auto; font-size: 14px; line-height: 1.4; }
.alert__title { font-weight: 650; margin-bottom: 2px; }
.pc-tip {
  background: repeating-linear-gradient(135deg, #fffaf0, #fffaf0 8px, #fdf6e9 8px, #fdf6e9 16px);
  border: 1px dashed #e6cd9a;
  color: #8a5a12;
}

/* ---------------------------- 页头 ---------------------------- */
.page-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-hd__title { font-size: 20px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.3px; }
.page-hd__sub { font-size: 12.5px; color: var(--ink-400); margin-top: 3px; }

/* ---------------------------- 表格（PC） ---------------------------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: auto;
}
.table {
  min-width: 720px;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-500);
  background: var(--surface-2);
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-800);
  vertical-align: middle;
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background 0.12s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table .is-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------- 搜索 ---------------------------- */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-400);
}
.search input {
  border: 0;
  outline: none;
  flex: 1;
  font-size: 13.5px;
  background: transparent;
  color: var(--ink-800);
}

/* ---------------------------- 主从布局（PC） ---------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1024px) {
  .split { grid-template-columns: 380px 1fr; align-items: start; }
  .split__side { position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; padding-right: 2px; }
}

/* ---------------------------- 签名板 ---------------------------- */
.signpad {
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  width: 100%;
  height: 130px;
  touch-action: none;
}

/* ---------------------------- 图表（纯 CSS） ---------------------------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.bars__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 100%; }
.bars__bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #22b8d4, #0e7490);
  min-height: 3px;
  opacity: 0.9;
}
.bars__bar.is-empty {
  background: var(--line);
  opacity: 1;
}
.bars__label { font-size: 10.5px; color: var(--ink-400); text-align: center; }

/* ---------- PC 顶栏 ---------- */
.shell__pcbar{display:flex;align-items:center;gap:12px;height:56px;padding:0 24px;background:#fff;border-bottom:1px solid var(--line,#e6eef4);position:sticky;top:0;z-index:20;flex:none}
.pcbar__title{font-size:15px;font-weight:600;color:var(--ink,#0b1220)}
.pcbar__user{display:flex;align-items:center;gap:8px;border:0;background:transparent;cursor:pointer;padding:4px 8px;border-radius:10px}
.pcbar__user:hover{background:var(--bg-soft,#f3f7fa)}
.pcbar__name{font-size:13px;font-weight:600;color:var(--ink,#0b1220)}
.pcbar__role{font-size:12px;color:var(--muted,#8494a7)}
.avatar--sm{width:30px;height:30px;font-size:12px;line-height:30px;text-align:center}

/* PC 已有顶栏标题，页面内标题隐藏，避免重复 */
@media (min-width: 900px){ .page-head__title{display:none} }

/* ---------- PC 桌面页：表格与工具栏 ---------- */
.pcmain{padding:24px 28px}
.pcbar{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.pcbar__t{font-size:20px;font-weight:700;color:var(--ink,#0b1220)}
.pcbar__s{font-size:12px;color:var(--muted,#8494a7);margin-top:4px}
.pcbar__grow{flex:1}
.tbl-card{background:#fff;border:1px solid var(--line,#e2eaf1);border-radius:12px;overflow:hidden}
.tbl-bar{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line,#e2eaf1)}
.tbl-bar__grow{flex:1}
.tbl-search{height:32px;padding:0 12px;border:1px solid var(--line,#e2eaf1);border-radius:8px;font-size:13px;outline:none;min-width:220px}
.tbl-search:focus{border-color:var(--brand,#0e7490)}
.seg{display:flex;gap:4px;background:#f3f7fa;padding:3px;border-radius:9px}
.seg__i{border:0;background:transparent;padding:6px 12px;border-radius:7px;font-size:13px;color:#5b6b7f;cursor:pointer}
.seg__i.is-on{background:#fff;color:#0e7490;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.seg__n{margin-left:6px;font-size:11px;opacity:.7}
table.dt{width:100%;border-collapse:collapse;font-size:13px}
table.dt th{background:#fafcfd;text-align:left;font-weight:600;color:#5b6b7f;font-size:12px;padding:10px 14px;border-bottom:1px solid #eef2f7;white-space:nowrap}
table.dt td{padding:11px 14px;border-bottom:1px solid #f4f7fa;color:#1a2433}
table.dt tbody tr:hover{background:#fbfdff}
table.dt tr.is-picked{background:#eff9fb}
table.dt .num{text-align:right;font-variant-numeric:tabular-nums}
table.dt .act{width:70px;text-align:right}
table.dt .dt__ck{width:40px}
.mono{font-family:Consolas,ui-monospace,monospace;font-size:12px}
.dim{color:#8494a7}
.ellipsis{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lnk{border:0;background:transparent;color:#0e7490;cursor:pointer;font-size:13px}
.st{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11.5px;font-weight:500}
.st--success{background:#e7f7f4;color:#0f766e}
.st--warn{background:#fdf4e3;color:#b45309}
.st--danger{background:#fdecec;color:#b91c1c}
.st--brand{background:#e8f4f8;color:#0e7490}
.st--neutral{background:#f1f5f9;color:#5b6b7f}
.tbl-foot{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid #f4f7fa;font-size:12px}
.tbl-foot__grow{flex:1}
.empty{text-align:center;padding:40px 0 !important;color:#8494a7}

/* ---------- PC 产品配置台 ---------- */
.cfg-wrap{display:flex;gap:16px;align-items:flex-start}
.cfg-left{width:240px;background:#fff;border:1px solid var(--line,#e2eaf1);border-radius:12px;overflow:hidden;flex:none}
.cfg-left__hd{padding:12px 14px;font-size:12px;color:#5b6b7f;border-bottom:1px solid #f1f5f9;background:#fafcfd}
.cfg-item{display:block;width:100%;text-align:left;border:0;background:transparent;padding:12px 14px;cursor:pointer;border-bottom:1px solid #f6f9fb}
.cfg-item:hover{background:#f7fbfd}
.cfg-item.is-on{background:#e9f6f9;border-left:3px solid #0e7490}
.cfg-item__n{font-size:13.5px;font-weight:600;color:#0b1220}
.cfg-item__c{font-size:11px;color:#8494a7;margin-top:3px}
.cfg-right{flex:1;background:#fff;border:1px solid var(--line,#e2eaf1);border-radius:12px;min-height:520px}
.cfg-tabs{display:flex;gap:2px;padding:10px 12px 0;border-bottom:1px solid #f1f5f9;flex-wrap:wrap}
.cfg-tab{border:0;background:transparent;padding:8px 14px;border-radius:8px 8px 0 0;font-size:13px;color:#5b6b7f;cursor:pointer}
.cfg-tab.is-on{background:#fff;color:#0e7490;font-weight:600;border:1px solid #e2eaf1;border-bottom-color:#fff;margin-bottom:-1px}
.cfg-form{padding:18px 20px}
.cfg-form__hd{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.cfg-row{display:flex;gap:14px;align-items:flex-start;padding:8px 0;border-bottom:1px dashed #f2f6f9}
.cfg-row__k{width:180px;flex:none;font-family:Consolas,monospace;font-size:12px;color:#5b6b7f;padding-top:6px}
.cfg-row__v{flex:1}
.cfg-json{width:100%;min-height:80px;font-family:Consolas,monospace;font-size:12px;padding:8px 10px;border:1px solid #e2eaf1;border-radius:8px;outline:none}
.cfg-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.cfg-empty{padding:60px 0;text-align:center;color:#8494a7}
.gate-mask{position:fixed;inset:0;background:rgba(11,18,32,.45);display:flex;align-items:center;justify-content:center;z-index:80}
.gate-box{width:380px;background:#fff;border-radius:14px;padding:22px}
.gate-box__t{font-size:16px;font-weight:700;color:#0b1220}
.gate-box__s{font-size:12px;color:#5b6b7f;margin-top:6px;line-height:1.6}
.gate-box__code{margin-top:12px;padding:8px 10px;background:#f3f9fb;border-radius:8px;font-size:12px;color:#0e7490}
.gate-box__f{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}

/* ---------- PC 材料审核（左单右料） ---------- */
.mat-wrap{display:flex;gap:16px;align-items:flex-start;min-height:560px}
.mat-left{width:300px;flex:none;background:#fff;border:1px solid var(--line,#e2eaf1);border-radius:12px;overflow:hidden;max-height:720px;overflow-y:auto}
.mat-left__hd{padding:12px 14px;font-size:12px;color:#5b6b7f;border-bottom:1px solid #f1f5f9;background:#fafcfd;position:sticky;top:0}
.mat-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #f6f9fb;background:transparent;padding:10px 14px;cursor:pointer}
.mat-item:hover{background:#f7fbfd}
.mat-item.is-on{background:#e9f6f9;border-left:3px solid #0e7490}
.mat-item__t{font-family:Consolas,monospace;font-size:12.5px;color:#0b1220}
.mat-item__s{font-size:12px;color:#5b6b7f;margin-top:2px}
.mat-item__m{font-size:11px;color:#8494a7;margin-top:3px}
.mat-right{flex:1;background:#fff;border:1px solid var(--line,#e2eaf1);border-radius:12px;overflow:hidden}
.mat-hd{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid #f1f5f9}
.mat-hd__t{font-size:15px;font-weight:700;color:#0b1220;font-family:Consolas,monospace}
.mat-hd__s{font-size:12px;color:#8494a7;margin-top:3px}
.mat-stats{display:flex;gap:10px;padding:14px 18px}
.mat-stat{flex:1;background:#fafcfd;border:1px solid #eef3f7;border-radius:10px;padding:10px 12px}
.mat-stat span{display:block;font-size:11px;color:#8494a7}
.mat-stat b{font-size:18px;color:#0b1220}
.mat-empty{padding:40px 16px;text-align:center;color:#8494a7;font-size:13px}

/* PC 提示：仅在移动端出现，附带跳转 PC 工作台 */
.pc-tip__link{display:inline-block;margin-top:6px;font-size:12px;color:#0e7490;text-decoration:none;border-bottom:1px dashed rgba(14,116,144,.4)}

/* ============================================================
   按端隔离：CSS 布局跟随入口，不再由视口宽度决定
   html.layout-mobile → 永远移动布局；html.layout-pc → 永远桌面布局
   ============================================================ */
html.layout-mobile .shell__side{display:none !important}
html.layout-mobile .tabbar{display:flex !important}
html.layout-mobile .shell__main{width:100%}
html.layout-pc .tabbar{display:none !important}
html.layout-pc .shell__side{display:flex !important}
html.layout-pc .only-mobile{display:none !important}
html.layout-mobile .only-pc{display:none !important}
@media (min-width:900px){
  html.layout-mobile .page-head__title{display:block}
}
