/* ==========================================================
   豆沙关古镇 · 智慧文旅平台
   设计系统：古道关隘（砖红 / 朱提金 / 宣纸米）
   ========================================================== */
:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --surface: #ffffff;
  --surface-2: #fbf8f2;

  --ink: #241d18;
  --ink-2: #443830;
  --muted: #8b8078;
  --muted-2: #a79c92;

  --line: #e9e1d3;
  --line-soft: #f1ebdf;

  --brand: #8c3a2b;
  --brand-d: #6b281c;
  --brand-l: #b25a41;
  --brand-soft: #f7eae4;
  --gold: #b8913f;
  --gold-l: #d9bd7c;
  --gold-soft: #f8f1e0;

  --green: #2f7d5e;
  --green-soft: #e7f3ed;
  --amber: #b9761c;
  --amber-soft: #fbf0dd;
  --red: #b83c2e;
  --red-soft: #fbeae7;
  --blue: #2f6690;
  --blue-soft: #e9f1f8;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(72, 52, 30, .06);
  --shadow-sm: 0 2px 6px rgba(72, 52, 30, .06), 0 1px 2px rgba(72, 52, 30, .04);
  --shadow-md: 0 10px 28px -14px rgba(72, 52, 30, .28), 0 2px 6px rgba(72, 52, 30, .05);
  --shadow-lg: 0 26px 60px -24px rgba(50, 34, 18, .34);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-l); }
button { font-family: inherit; }
::selection { background: rgba(140, 58, 43, .16); }

/* ---------------- 布局：侧边栏 + 主区 ---------------- */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background:
    radial-gradient(520px 220px at 12% -8%, rgba(200, 155, 60, .22), transparent 62%),
    radial-gradient(420px 260px at 100% 108%, rgba(140, 58, 43, .38), transparent 60%),
    linear-gradient(172deg, #2a211b 0%, #201a15 52%, #191410 100%);
  color: #ece2d2;
  padding: 22px 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid rgba(0, 0, 0, .4);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand-mark {
  position: relative;
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  background: linear-gradient(150deg, #b25a41 0%, #8c3a2b 55%, #6b281c 100%);
  color: #f6e7c8; font-weight: 800; font-size: 20px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 0 0 1.5px rgba(232, 202, 142, .55),
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 6px 16px -8px rgba(0, 0, 0, .8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.brand-txt .n { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: #fdf6e8; }
.brand-txt .s { font-size: 11px; color: #a0937f; letter-spacing: .1em; margin-top: 1px; }

.side-group { font-size: 10.5px; letter-spacing: .16em; color: #7d7263; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  font-size: 13.5px; color: #c9bcaa; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .16s, color .16s;
  position: relative;
}
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #f4ecdd; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(200, 155, 60, .2), rgba(200, 155, 60, .06));
  color: #fff7e6; font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #e6c98a, #b8913f);
}
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11px; color: #7a6f61; line-height: 1.7; border-top: 1px solid rgba(255, 255, 255, .07); }

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

.topline {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 26px;
  background: rgba(246, 242, 234, .88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topline h1 { font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.topline .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-link {
  font-size: 12.5px; color: var(--ink-2); padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: .16s;
}
.top-link:hover { border-color: var(--brand); color: var(--brand); }

.content { padding: 22px 26px 48px; display: flex; flex-direction: column; gap: 16px; max-width: 1560px; width: 100%; }

/* ---------------- 面板 ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.panel-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-l), var(--gold));
}
.panel-desc { font-size: 12px; color: var(--muted); font-weight: 400; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -26px; top: -26px; width: 84px; height: 84px;
  border-radius: 50%; background: radial-gradient(circle, rgba(184, 145, 63, .14), transparent 68%);
}
.kpi .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k .ico {
  width: 22px; height: 22px; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px;
  background: var(--brand-soft); color: var(--brand);
}
.kpi .v { font-size: 25px; font-weight: 750; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .f { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.kpi.gold .k .ico { background: var(--gold-soft); color: var(--gold); }
.kpi.gold .v { color: var(--brand); }
.kpi.green .k .ico { background: var(--green-soft); color: var(--green); }
.kpi.green .v { color: var(--green); }
.kpi.blue .k .ico { background: var(--blue-soft); color: var(--blue); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); text-align: left; white-space: nowrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
table.data tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fcfaf5; }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .mono { font-family: var(--font-num); font-size: 12px; color: var(--ink-2); }
table.data .strong { font-weight: 700; font-variant-numeric: tabular-nums; }
table.data .money { font-weight: 650; font-variant-numeric: tabular-nums; }
table.data .money.pos { color: var(--green); }
table.data .t-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 9px;
  padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--ink-2); border-color: var(--line);
  transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #d8cdb9; background: #fdfbf7; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(160deg, var(--brand-l), var(--brand) 62%, var(--brand-d));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px -10px rgba(107, 40, 28, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.primary:hover { background: linear-gradient(160deg, #bd6349, #96402f 62%, #752d20); color: #fff; }
.btn.gold {
  background: linear-gradient(160deg, #dcc27f, var(--gold) 70%);
  color: #3d2c07; border-color: transparent;
  box-shadow: 0 6px 16px -10px rgba(143, 109, 34, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn.gold:hover { background: linear-gradient(160deg, #e3cd91, #c39b47 70%); }
.btn.green { background: var(--green); color: #fff; border-color: transparent; }
.btn.green:hover { background: #276a4f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #f0cfc9; background: var(--red-soft); }
.btn.danger:hover { background: #f8ded9; border-color: #e8b8b0; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.field .unit { position: relative; display: flex; align-items: center; }
.field .unit input { padding-right: 44px; }
.field .unit .u {
  position: absolute; right: 12px; font-size: 12px; color: var(--muted); pointer-events: none;
}
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  background: var(--surface); color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.65; }
input:hover, select:hover, textarea:hover { border-color: #dbd0bc; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(140, 58, 43, .1);
}
input::placeholder, textarea::placeholder { color: #b9afa3; }
select {
  appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238b8078' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { min-width: 130px; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i {
  width: 40px; height: 22px; border-radius: 999px; background: #ded4c4;
  position: relative; transition: .2s; flex: none;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transition: .2s;
}
.switch input:checked + i { background: linear-gradient(90deg, #4f9c78, var(--green)); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch span { font-size: 13px; }

/* ---------------- 标签 / 徽标 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #f1ece2; color: #7d7263; white-space: nowrap;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.err { background: var(--red-soft); color: var(--red); }
.tag.info { background: var(--blue-soft); color: var(--blue); }
.tag.gold { background: var(--gold-soft); color: #8a6a17; }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.7;
  background: var(--gold-soft); border: 1px solid #ecdcb8; color: #7a5c14;
}
.notice .i { font-size: 14px; line-height: 1.4; }
.notice.warn { background: var(--amber-soft); border-color: #f0dcb8; color: #7d5411; }
.notice.info { background: var(--blue-soft); border-color: #d3e2f0; color: #245070; }
.notice.ok { background: var(--green-soft, #e7f5ee); border-color: #cfe6da; color: var(--green, #2f7d5b); }

/* ---------------- 分段标签页 ---------------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px;
  background: #efe8db; border: 1px solid var(--line);
}
.tabs .tab {
  border: none; background: none; cursor: pointer;
  padding: 7px 14px; font-size: 13px; color: var(--ink-2);
  border-radius: 8px; transition: .16s; white-space: nowrap;
}
.tabs .tab:hover { background: rgba(255, 255, 255, .6); }
.tabs .tab.active {
  background: var(--surface); color: var(--brand); font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); font-size: 13px; }
.empty .ico { font-size: 26px; opacity: .5; display: block; margin-bottom: 8px; }

/* ---------------- 弹层 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28, 20, 14, .5);
  display: none; align-items: center; justify-content: center;
  z-index: 90; padding: 16px; backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 420px; padding: 22px;
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal .m-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.modal .m-body { display: flex; flex-direction: column; gap: 12px; }
.modal .m-foot { display: flex; gap: 9px; margin-top: 18px; }
.modal .m-foot .btn { flex: 1; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(10px);
  background: rgba(32, 24, 18, .94); color: #fff5e6;
  padding: 11px 20px; border-radius: 999px; font-size: 13px;
  display: none; z-index: 120; box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .2s, transform .2s; max-width: 86vw; text-align: center;
}
.toast.show { display: block; opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 通用小件 ---------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-num); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.divider { height: 1px; background: var(--line-soft); margin: 4px 0; }
.scroll-y { overflow-y: auto; }

/* 二维码 */
.qr {
  width: 148px; height: 148px; margin: 14px auto; border-radius: 12px;
  border: 7px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
  background:
    repeating-conic-gradient(#2b231c 0% 25%, #fff 0% 50%) 0 0/15px 15px;
}
.verify-code {
  font-family: var(--font-num); font-size: 27px; letter-spacing: .22em;
  font-weight: 700; color: var(--brand); text-align: center;
  padding: 12px; border-radius: 12px; background: var(--brand-soft);
  border: 1px dashed #e3c2b8;
}

/* ---------------- 页脚 / 备案 ---------------- */
.page-foot {
  margin-top: 10px; padding: 18px 4px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted-2); border-top: 1px solid var(--line-soft);
}
.page-foot .pf-l b { color: var(--ink-2); font-weight: 600; }
.page-foot .pf-r { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-foot a { color: var(--muted); }
.page-foot a:hover { color: var(--brand); }
.pf-icp { display: inline-flex; align-items: center; gap: 5px; }
.pf-icp::before { content: "©"; opacity: .6; }

/* 身份标识（区分平台运营方 / 景区管理方） */
.identity {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}
.identity b { color: var(--ink-2); }
.identity.platform { background: var(--brand-soft); border-color: #ecd4cc; color: var(--brand); }
.identity.platform b { color: var(--brand-d); }
.identity.scenic { background: var(--green-soft); border-color: #cfe6da; color: var(--green); }
.identity.scenic b { color: #24624a; }

/* 迷你占比条（经营页渠道构成） */
.bar2 { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin: 1px 0 10px; }
.bar2 i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-l), var(--gold)); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 6px; overflow-x: auto;
  }
  .brand { padding: 0 10px 0 2px; }
  .brand-txt .s, .side-group, .side-foot { display: none; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; }
  .nav-item.active::before { display: none; }
  .topline { padding: 12px 16px; }
  .content { padding: 16px 14px 40px; }
  .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .topline h1 { font-size: 16px; }
  .kpi .v { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 18px; border-radius: 18px; }
}
