/* ==========================================================================
   筑联科信 · 应用层样式
   在 base.css（设计系统）之上补充：响应式手机全屏、弹窗、表单、项目页、
   后台移动导航、合同排版与打印等。
   ========================================================================== */

:root {
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Sans 3",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --page-bg: #eef2f7;
  --ok-soft: #e5f6ec;
  --danger-soft: #fde8e8;
  --warn-soft: #fdf3e2;
  --shadow-lg: 0 24px 60px #061a3033;
}

body {
  background:
    radial-gradient(1200px 500px at 50% -10%, #dfe9f4 0%, transparent 60%),
    var(--page-bg);
}

#app {
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid #ffffff14;
}

.topbar-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #ffffff1f;
  border: 1px solid #ffffff33;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar-brand .brand-logo-sm {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px #00000040);
}

.brand-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px #00000040);
}

.login-logo {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px #00000033);
}

.admin-logo-img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px #00000026);
}

.topbar-brand .brand-text {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.topbar-brand small {
  margin-left: 8px;
}

.topbar-actions .ghost-btn {
  white-space: nowrap;
}

.topbar-actions .ghost-btn.primary {
  background: #ffffff;
  color: var(--navy);
  border-color: #ffffff;
}

.ghost-btn.demo-compact {
  display: none;
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .topbar-brand {
    font-size: 14px;
  }
  .topbar-brand small {
    display: none;
  }
  .mode-switch button {
    padding: 7px 12px;
    font-size: 13px;
  }
  .topbar-actions {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }
  .ghost-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ---------- 演示路径提示（桌面端） ---------- */
.demo-guide {
  width: 260px;
  margin-left: 24px;
  align-self: flex-start;
  position: sticky;
  top: 84px;
}

.demo-guide .card {
  box-shadow: var(--shadow);
}

.demo-guide ol {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.demo-guide .demo-tip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .demo-guide {
    display: none;
  }
}

/* ---------- 手机框架 / 移动端全屏 ---------- */
.phone-screen {
  isolation: isolate;
}

.home-hero {
  padding-top: 44px;
}

.phone-scroll-hint {
  position: absolute;
  inset: auto 0 0;
  height: 16px;
  pointer-events: none;
  background: linear-gradient(transparent, #061a301a);
  z-index: 2;
}

.status-bar {
  padding-top: 10px;
}

.status-bar span:last-child {
  letter-spacing: 0.04em;
  font-size: 11px;
}

@media (max-width: 560px) {
  .app-shell {
    min-height: 100dvh;
  }
  #app[data-mode="mini"] {
    height: 100dvh;
    overflow: hidden;
  }
  #app[data-mode="mini"] .stage {
    flex: 1;
    min-height: 0;
    padding: 0;
  }
  #app[data-mode="mini"] .phone-frame {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
  }
  .phone-notch {
    display: none;
  }
  #app[data-mode="mini"] .phone-screen {
    border-radius: 0;
    height: 100%;
  }
  .status-bar {
    display: none;
  }
  .home-hero {
    padding-top: 16px;
  }
  .brand-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 8px;
  }
  .login-logo {
    width: 52px;
    height: 52px;
  }
  .nav-bar {
    padding-top: 14px;
  }
  .nav-bar h1 {
    font-size: 17px;
  }
  .page-pad {
    padding: 14px 14px 32px;
  }
  .toast {
    bottom: 20px;
    max-width: calc(100vw - 32px);
    text-align: center;
  }
  body:has(.sticky-footer) #toast-root {
    bottom: 104px;
  }
  .home-hero {
    padding-bottom: 24px;
  }
  .mini-body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .topbar {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .topbar-brand {
    font-size: 13px;
    gap: 6px;
    flex-shrink: 0;
  }
  .topbar-brand .brand-mark {
    width: 26px;
    height: 26px;
    font-size: 13px;
    border-radius: 7px;
  }
  .topbar-brand small {
    display: none;
  }
  .mode-switch {
    padding: 2px;
    flex-shrink: 0;
  }
  .mode-switch button {
    padding: 6px 9px;
    font-size: 12px;
  }
  .topbar-actions {
    order: 0;
    width: auto;
    margin-left: auto;
    gap: 5px;
    flex-shrink: 0;
  }
  .ghost-btn {
    padding: 5px 7px;
    font-size: 11px;
    border-radius: 6px;
  }
  .demo-wide {
    display: none;
  }
  .ghost-btn.demo-compact {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
  }
}

@media (max-width: 365px) {
  .topbar-brand .brand-text {
    display: none;
  }
  .mode-switch button {
    padding: 5px 7px;
    font-size: 11px;
  }
}

/* ---------- 通用补充组件 ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.full { width: 100%; }
.center { text-align: center; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
}

.sec-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--navy);
}

.sec-head span {
  color: var(--muted);
  font-size: 12px;
}

.divider-dashed {
  height: 1px;
  border-top: 1px dashed var(--line);
  margin: 12px 0;
}

.empty-mini {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 8px;
}

.note-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.price {
  color: var(--navy);
  font-weight: 700;
}

.price small {
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}

.mono {
  font-variant-numeric: tabular-nums;
}

/* 步骤条 */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 12px;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.step i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef1f5;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.step.on {
  color: var(--navy);
  font-weight: 600;
}

.step.on i {
  background: var(--navy);
  color: #fff;
}

.step.done i {
  background: var(--ok-soft);
  color: var(--ok);
}

.step:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.step:last-child:after {
  display: none;
}

/* 服务选择卡 */
.pick-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pick-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #1a6fb514;
}

.pick-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.pick-head .check-box {
  margin-top: 2px;
}

.pick-title {
  flex: 1;
  min-width: 0;
}

.pick-title strong {
  display: block;
  font-size: 14px;
}

.pick-title .muted {
  margin-top: 3px;
  font-size: 12px;
}

.pick-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.opt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  background: #fbfcfe;
  cursor: pointer;
  transition: all 0.15s;
}

.opt.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--navy);
  font-weight: 600;
}

.opt .radio-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #c5ced8;
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.opt.on .radio-dot {
  border-color: var(--accent);
}

.opt.on .radio-dot:after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.opt .price {
  margin-left: auto;
  font-size: 12.5px;
}

/* 项目页 */
.project-order-card {
  color: #fff;
  background: linear-gradient(150deg, #0a2a4a, #134078 70%, #1a6fb5 150%);
  border: none;
}

.project-order-card .muted {
  color: #ffffffb3;
}

.project-order-card .badge {
  background: #ffffff24;
  color: #fff;
  border: 1px solid #ffffff38;
}

/* ---------- 支付 / 收银台 ---------- */
.pay-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  padding: 10px 11px;
  transition: border-color 0.15s, background 0.15s;
}

.pay-method.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pay-method:disabled {
  opacity: 0.72;
  cursor: default;
}

.pay-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.pay-ico.tone-wechat {
  color: #0f7b42;
  background: #e5f6ec;
}

.pay-ico.tone-alipay {
  color: #1265b5;
  background: #e8f2fb;
}

.pay-ico.tone-bank {
  color: var(--navy);
  background: #e8eef6;
}

.pay-method-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pay-method-text strong {
  font-size: 13.5px;
}

.pay-method-text small {
  color: var(--muted);
  font-size: 11px;
}

.pay-method .radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #c5ced8;
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.pay-method.on .radio-dot {
  border-color: var(--accent);
}

.pay-method.on .radio-dot:after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pay-tabs {
  display: flex;
  gap: 6px;
}

.pay-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  padding: 8px 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.pay-tab.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--navy);
  font-weight: 600;
}

.pay-tab:disabled {
  cursor: default;
  opacity: 0.75;
}

.pay-ico-sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}

.pay-tab.on .pay-ico-sm {
  background: var(--navy);
  color: #fff;
}

.pay-hero {
  background: linear-gradient(150deg, #061a30, #0f3a66 70%, #1a6fb5 150%);
  color: #fff;
  border-radius: 16px;
  padding: 16px 16px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.pay-hero .muted {
  color: #ffffffb3;
  font-size: 12px;
}

.pay-amount {
  font-size: 31px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.pay-order {
  color: #ffffffa6;
  font-size: 11px;
}

.qr-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qr-box {
  width: 132px;
  height: 132px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-shrink: 0;
}

.qr-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}

.qr-copy strong {
  line-height: 1.4;
}

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

.bank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.bank-row:last-child {
  border-bottom: none;
}

.bank-row .muted {
  width: 66px;
  flex-shrink: 0;
  font-size: 12px;
}

.bank-row strong {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 12.5px;
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--navy);
  background: #fff;
}

.copy-btn:hover {
  border-color: var(--navy);
}

.pay-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pay-badge.paid {
  color: var(--ok);
  background: var(--ok-soft);
}

.pay-badge.unpaid {
  color: var(--warn);
  background: var(--warn-soft);
}

.pay-badge.pending {
  color: #a06a1a;
  background: #f8f0e4;
}

.pay-badge.refund {
  color: var(--danger);
  background: var(--danger-soft);
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-box-btn {
  padding: 8px;
  cursor: zoom-in;
}

.pay-qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 4px;
}

.pay-qr-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pay-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.pay-qr-preview {
  min-height: 170px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

.pay-qr-preview img {
  display: block;
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
}

.pay-qr-card .btn-row .mini-btn,
.pay-qr-card .btn-row .btn-soft {
  flex: 1;
}

.pay-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fffaf0;
  border: 1px solid #f0d9ae;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
}

.pay-confirm-bar strong {
  display: block;
  font-size: 13px;
  color: var(--warn);
  margin-bottom: 2px;
}

.pay-confirm-bar .muted {
  font-size: 11.5px;
}

.jsapi-settings {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px 16px;
}

.jsapi-settings .switch {
  flex-shrink: 0;
}

.jsapi-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #b7e0c8;
  background: #f0faf4;
  border-radius: 12px;
  padding: 14px;
}

.jsapi-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jsapi-copy strong {
  font-size: 14px;
  color: var(--navy);
}

.jsapi-copy .muted {
  font-size: 11.5px;
}

@media (max-width: 720px) {
  .pay-qr-grid {
    grid-template-columns: 1fr;
  }
  .pay-qr-preview {
    min-height: 140px;
  }
}

.badge.warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.pay-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.pay-summary strong {
  color: var(--text);
  font-weight: 600;
}

.pay-required {
  background: #fffaf0;
  border-color: #f0d9ae;
}

.pay-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px 0 6px;
}

.pay-success-ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 22px;
  font-weight: 700;
}

.pay-success strong {
  color: var(--ok);
}

@media (max-width: 380px) {
  .qr-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .qr-box {
    width: 128px;
    height: 128px;
  }
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-tile {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-tile:active {
  border-color: var(--accent);
}

.project-tile .p-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
}

.project-tile strong {
  font-size: 14px;
  margin-top: auto;
}

.project-tile span.p-desc {
  color: var(--muted);
  font-size: 11.5px;
}

.project-tile .count {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  display: grid;
  place-items: center;
}

.stage-tile {
  cursor: pointer;
}

.stage-tile:active {
  border-color: var(--accent);
}

.stage-tile .stage-icon {
  font-size: 13px;
}

.stage-tile .stage-count {
  background: var(--danger);
}

/* 资料上传 / 文件行 */
.file-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

.file-box .file-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.file-box .file-meta {
  flex: 1;
  min-width: 0;
}

.file-box .file-meta strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-box .file-meta span {
  color: var(--muted);
  font-size: 11px;
}

.upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 64px;
  border: 1px dashed var(--navy-mid);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  margin-top: 8px;
}

.upload-drop small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
}

.upload-drop:active {
  background: #dcebf9;
}

/* 合同 */
.contract-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #33404f;
}

.contract-doc h3 {
  text-align: center;
  color: var(--navy);
  font-size: 16px;
  margin: 0 0 6px;
}

.contract-doc .contract-no {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 12px;
}

.contract-doc p {
  margin: 8px 0;
}

.contract-doc ol {
  padding-left: 18px;
  margin: 8px 0;
}

.contract-doc li {
  margin-bottom: 6px;
}

.contract-doc .contract-sub {
  margin-top: 4px;
  padding-left: 2px;
}

.contract-sign {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.sign-seal {
  display: block;
  width: 104px;
  height: 104px;
  margin: 8px 0 0 auto;
  object-fit: contain;
  transform: rotate(-7deg);
  opacity: 0.92;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #061a3066;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: backdropIn 0.18s ease;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

.modal-card.sm { width: min(420px, 100%); }
.modal-card.lg { width: min(760px, 100%); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #f1f5f9;
}

.modal-body {
  padding: 18px 20px;
  overflow: auto;
  font-size: 13px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.modal-foot .spacer { flex: 1; }

@media (max-width: 560px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-card {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
  .modal-foot {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* Toast 容器 */
#toast-root {
  position: fixed;
  z-index: 300;
  inset: auto 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

#toast-root .toast {
  position: static;
  animation: fadeUp 0.25s ease;
}

body.modal-open #toast-root {
  inset: 18px 0 auto;
}

body.modal-open #toast-root .toast {
  animation: fadeDown 0.25s ease;
  box-shadow: 0 10px 30px #061a3040;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* 后台登录 */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(900px 420px at 50% -10%, #12395f 0%, transparent 60%),
    linear-gradient(160deg, #061a30, #0a2a4a);
}

.login-stage {
  width: min(460px, 100%);
}

.login-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: min(880px, 100%);
}

.login-guide {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: 0 20px 50px #061a3014;
}

.login-guide h3 {
  margin: 0;
  color: var(--navy);
  font-size: 17px;
}

.demo-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.demo-account-row:last-of-type {
  border-bottom: none;
}

.login-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

@media (max-width: 980px) {
  .login-guide {
    display: none;
  }
}

.login-panel {
  border: 1px solid #ffffff1f;
  box-shadow: 0 30px 80px #0000004d;
}

.login-form .field input {
  background: #fbfcfe;
}

.login-form .hint-mini {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
}

.login-back {
  margin-top: 14px;
  text-align: center;
}

.login-back button {
  color: #ffffffa6;
  font-size: 12px;
}

.login-back button:hover {
  color: #fff;
}

/* 后台框架 */
.admin-wrap {
  width: min(1280px, 100%);
  min-height: 640px;
  height: calc(100vh - 133px);
  max-height: 920px;
}

.admin-main {
  min-height: 0;
}

.admin-content {
  flex: 1;
  min-height: 0;
}

.admin-header h2 {
  line-height: 1.25;
}

.admin-header .admin-header-left {
  min-width: 0;
}

.admin-mobile-nav {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.admin-mobile-nav::-webkit-scrollbar { display: none; }

.admin-mobile-nav button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
}

.admin-mobile-nav button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-section-title h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* 工作台左栏宽度有限，快捷操作改为 2 列避免标题折行 */
@media (min-width: 721px) {
  .admin-grid-2 .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1180px) {
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .admin-grid-2,
  .admin-grid-3 { grid-template-columns: 1fr; }
  .admin-wrap {
    height: auto;
    min-height: calc(100dvh - 120px);
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .admin-main { min-height: calc(100dvh - 120px); }
  .admin-header { padding: 14px 16px; }
  .admin-content { padding: 16px 14px 28px; }
  .admin-mobile-nav { display: flex; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .action-grid { grid-template-columns: 1fr 1fr; }
  .order-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .admin-wrap {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .admin-side { display: none; }
  .admin-mobile-nav { display: flex; }
}

/* 客户管理表格（移动端横向滚动） */
.table-wrap {
  overflow-x: auto;
}

.table {
  min-width: 720px;
}

.customer-upload-panel .file-box {
  margin-top: 6px;
}

.cust-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 轮播编辑 */
.banner-edit {
  grid-template-columns: 34px 150px 1fr;
}

.banner-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-thumb {
  position: relative;
}

.banner-thumb .banner-thumb-empty {
  font-size: 11px;
  color: #ffffff8c;
  padding: 0 8px;
  text-align: center;
}

.banner-upload input[type="file"] {
  display: none;
}

@media (max-width: 720px) {
  .banner-edit {
    grid-template-columns: 28px 1fr;
  }
  .banner-thumb-wrap {
    grid-column: 2;
  }
  .banner-fields {
    grid-column: 1 / -1;
  }
}

/* 审核 / 驳回 */
.reject-panel .chip {
  font-size: 12px;
  padding: 6px 10px;
}

.reject-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  margin-top: 8px;
  resize: vertical;
}

/* 登录页移动端 */
@media (max-width: 560px) {
  .login-page {
    padding: 20px 14px;
    align-items: start;
    padding-top: 48px;
  }
}

/* 打印合同 */
@media print {
  body * { visibility: hidden; }
  .contract-doc, .contract-doc * { visibility: visible; }
  .contract-doc {
    position: absolute;
    inset: 0;
    border: none;
    padding: 24px;
  }
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 细节修正 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

::selection {
  background: #1a6fb533;
}

/* 小屏字号微调 */
@media (max-width: 380px) {
  .brand-block h2 { font-size: 25px; }
  .service-tile { min-height: 100px; }
  .project-grid { gap: 8px; }
}
