:root { --brand: #ff5000; --brand-soft: #fff3eb; --side: #141a26; --bg: #f3f5f8; --line: #e8eaef; --text: #1f2430; --muted: #8a93a6; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
input, select, textarea, button { font: inherit; color: inherit; }
code { background: #f1f2f5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.money { color: #e5383b; font-weight: 600; white-space: nowrap; }
.money.big { font-size: 20px; }
.mono { font-family: Consolas, Menlo, monospace; word-break: break-all; }
.text-warn { color: #d46b08; font-weight: 600; }

/* 布局 */
.side { position: fixed; left: 0; top: 0; bottom: 0; width: 210px; background: var(--side); color: #c9cfdb; overflow-y: auto; z-index: 20; }
.side-logo { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 20px; color: #fff; font-weight: 600; font-size: 16px; }
.side-logo:hover { text-decoration: none; }
.side-logo span, .login-logo span { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: #aeb6c6; border-left: 3px solid transparent; }
.side nav a:hover { color: #fff; background: rgba(255, 255, 255, .04); text-decoration: none; }
.side nav a.on { color: #fff; background: rgba(255, 80, 0, .14); border-left-color: var(--brand); }
.side nav em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; }
.body { margin-left: 210px; min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 17px; }
.top-r { margin-left: auto; display: flex; gap: 18px; }
.top-r a { color: #555; }
.menu-btn { display: none; border: 0; background: none; font-size: 20px; cursor: pointer; }
.content { padding: 20px 24px 60px; }

/* 组件 */
.card { background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--line); }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-hd h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid2.wide-left { grid-template-columns: 1.7fr 1fr; }
.grid2.wide-right { grid-template-columns: 280px 1fr; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px #d5d9e2; }
.btn-ghost:hover { color: var(--brand); }
.btn-danger { background: #e5383b; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.link { border: 0; background: none; color: #2563eb; cursor: pointer; padding: 0; font-size: 13px; }
.link.danger, a.danger { color: #e5383b; }
.alert { padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.alert-error { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #f1f2f5; color: #555; white-space: nowrap; }
.tag-warn { background: #fff4e5; color: #d46b08; }
.tag-info { background: #e6f4ff; color: #0958d9; }
.tag-primary { background: #f0e8ff; color: #6e3fd6; }
.tag-ok { background: #e8f7ee; color: #12a150; }
.tag-mute { background: #f0f0f0; color: #999; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px; background: #f8f9fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
.table tr:hover td { background: #fcfcfd; }
.table .empty, .empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.ops { white-space: nowrap; }
.ops > a, .ops > form { display: inline-block; margin-right: 10px; font-size: 13px; }
.thumb { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; }
.thumb img, .thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; background: #f4f4f5; }
.ph span { font-size: 20px; font-weight: 500; color: #a3a3a3; }
.cover-p { color: #a3a3a3; }
.cover-p svg { width: 40%; height: auto; }
.cover-v { container-type: inline-size; }
.v { width: 84%; aspect-ratio: 1.586; border-radius: 6cqw; background: linear-gradient(160deg, color-mix(in srgb, var(--vc) 82%, #fff), var(--vc)); overflow: hidden; }
.v > * { display: none; }
.kv { width: 100%; border-collapse: collapse; }
.kv th { width: 100px; text-align: left; color: var(--muted); font-weight: 400; padding: 8px 0; vertical-align: top; }
.kv td { padding: 8px 0; }
.pre { margin: 0; padding: 10px; background: #fffbe6; border-radius: 6px; white-space: pre-wrap; word-break: break-all; font-family: Consolas, monospace; font-size: 13px; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.pager a, .pager b, .pager .dots { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); color: #555; }
.pager b { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 筛选 */
.yht-acc { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.yht-acc > div:not(.yht-acc-act) { display: flex; flex-direction: column; gap: 4px; }
.yht-acc .muted { font-size: 12px; }
.yht-acc b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.yht-acc .ok { color: #12a150; }
.yht-acc .bad { color: #dc2626; }
.yht-acc-act { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.steps-txt { margin: 0 0 4px; padding-left: 20px; color: #4a5263; }
.steps-txt li { margin: 4px 0; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 4px 12px; border-radius: 999px; color: #555; background: #f3f4f7; font-size: 13px; }
.pills a.on { background: var(--brand); color: #fff; }
.pills a:hover { text-decoration: none; }
.search-f { display: flex; gap: 8px; }
.search-f input, .search-f select { height: 30px; padding: 0 10px; border: 1px solid #d5d9e2; border-radius: 6px; }
.search-f input { width: 220px; }

/* 表单 */
.form .field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: #4a5263; font-size: 13px; }
.field input:not([type=checkbox]):not([type=file]):not([type=color]), .field select, .field textarea, .login-box input { width: 100%; padding: 8px 12px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; outline: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .login-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input:disabled { background: #f5f6f8; }
.field textarea { resize: vertical; font-family: inherit; }
.field input[type=color] { width: 60px; height: 36px; border: 1px solid #d5d9e2; border-radius: 8px; padding: 2px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-field img { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fafafa repeating-conic-gradient(#f0f0f0 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.img-field > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.img-field input[type=file] { font-size: 12px; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); }

/* 控制台 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; color: var(--text); }
.stat:hover { text-decoration: none; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 26px; margin: 4px 0; font-family: "DIN Alternate", Arial, sans-serif; }
.stat small { color: var(--muted); }
.stat.warn { border-color: #ffd7b5; background: linear-gradient(135deg, #fff, #fff7f0); }
.stat.warn b { color: var(--brand); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 20px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar i { width: 60%; max-width: 40px; background: linear-gradient(180deg, #ff8a3d, var(--brand)); border-radius: 6px 6px 0 0; }
.bar span { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bar em { position: absolute; top: 0; font-style: normal; font-size: 11px; color: var(--muted); }
.simple { list-style: none; margin: 0; padding: 0; }
.simple li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f1f4; }
.simple.sel li { padding: 9px 10px; border-radius: 8px; border: 0; }
.simple.sel li.on { background: var(--brand-soft); }
.simple.sel li.on a { color: var(--brand); font-weight: 600; }

/* 轮播 / 模板 */
.banner-list { display: flex; flex-direction: column; gap: 14px; }
.banner-pv { height: 110px; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 0 24px; color: #fff; }
.banner-pv img { width: 100%; height: 100%; object-fit: cover; margin: 0 -24px; width: calc(100% + 48px); }
.banner-pv b { font-size: 20px; }
.banner-meta { display: flex; justify-content: space-between; margin-top: 6px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tpl { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.tpl.on { border-color: var(--brand); }
.tpl-pv { height: 150px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 50%, #000)); }
.tpl-pv img { width: 100%; height: 100%; object-fit: cover; }
.tpl-pv span { color: #fff; font-size: 34px; font-weight: 700; letter-spacing: 4px; }
.tpl-info { padding: 14px 16px; }
.tpl-info p { margin: 6px 0; }

/* 登录 */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #2a3550, var(--side) 60%); }
.login-box { width: 360px; max-width: calc(100% - 32px); background: #fff; border-radius: 14px; padding: 34px 30px; display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.login-logo { display: flex; justify-content: center; }
.login-logo span { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; font-weight: 700; }
.login-box h2 { font-size: 20px; }
.login-box p { margin: 0 0 8px; }
.login-box input { height: 42px; }
.login-box .btn { height: 42px; margin-top: 4px; }
.back { font-size: 13px; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .body { margin-left: 0; }
  .menu-btn { display: block; }
  .grid2, .grid2.wide-left, .grid2.wide-right { grid-template-columns: minmax(0, 1fr); }
  .grid2 > * { min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .top-r a:first-child { display: none; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .search-f input { width: 140px; }
  /* 兜底：卡片里过宽的表格在卡片内横向滑动，不撑破页面 */
  .card { overflow-x: auto; }
  .table th, .table td { white-space: nowrap; }
  .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea, .search-f input, .search-f select { font-size: 16px; }
  .top h1 { font-size: 16px; }
  .yht-acc { gap: 16px 24px; }
  .yht-acc-act { margin-left: 0; width: 100%; }
}
