:root {
  --bg: #f3f6fb;
  --card: #fff;
  --ink: #1f2a37;
  --muted: #8b95a5;
  --line: #e6ebf2;
  --orange: #2f7cf6;
  --orange-deep: #1d6fe8;
  --side: #1d6fe8;
  --side-text: #fff;
  --danger: #e85d57;
  --ok: #2f9d6a;
  --shadow: 0 8px 24px rgba(31, 78, 140, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { display: flex; min-height: 100vh; background: var(--bg); }
.side {
  width: 76px;
  background: linear-gradient(180deg, #2b82f0, #1b68e0);
  color: #fff;
  padding: 10px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.rail-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  font-weight: 700; margin-bottom: 8px;
}
.nav { display: flex; flex-direction: column; gap: 2px; width: 100%; overflow: auto; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 6px; border-radius: 10px;
  color: rgba(255,255,255,0.88); font-size: 12px;
}
.nav a.on, .nav a:hover { background: rgba(255,255,255,0.16); color: #fff; }
.nav svg, .side-foot svg {
  width: 18px; height: 18px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.side-foot { margin-top: auto; width: 100%; }
.side-foot button {
  width: 100%; background: transparent; color: rgba(255,255,255,0.9);
  border: 0; border-radius: 10px; padding: 8px 0; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.side-foot button:hover { background: rgba(255,255,255,0.16); }

.main { flex: 1; padding: 0 18px 40px; min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px; margin: 0 -18px 16px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.top-title { min-width: 120px; }
.top h1 { margin: 0; font-size: 16px; font-weight: 650; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 12px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder { flex: 1; max-width: 460px; }
.finder input {
  width: 100%; background: #f3f5f8; border: 0; border-radius: 18px;
  padding: 8px 16px;
}
.top-user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #4b5563; font-size: 13px; }
.top-user span, .mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: #2f7cf6; color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.mark { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
.flash { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: #e8f7ef; color: #1d7a4d; }
.flash.err { background: #ffefee; color: #b42318; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.04em; }
.kpi em { font-style: normal; color: var(--orange-deep); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 14px; margin-top: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; }
td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.shop-cell { display: flex; gap: 10px; align-items: center; }
.shop-cell img, .thumb {
  width: 42px; height: 42px; border-radius: 12px; object-fit: cover; background: #f3e6d4;
}
.muted { color: var(--muted); }
.price { color: #e24b32; font-weight: 650; }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; background: #f6efe6;
}
.tag-unpaid { background: #fff1d6; color: #a15c00; }
.tag-unused { background: #e7f3ff; color: #1d5f99; }
.tag-review { background: #f3e8ff; color: #6d3ea8; }
.tag-done { background: #e7f7ee; color: #1d7a4d; }
.tag-cancelled, .tag-refunded { background: #f4f4f4; color: #777; }
.tag-on { background: #e7f7ee; color: #1d7a4d; }
.tag-off { background: #ffefee; color: #b42318; }

a.btn.on, button.btn.on { box-shadow: inset 0 0 0 2px #2a221b; }
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 9px 14px;
  background: var(--orange); color: #fff; font-weight: 600;
}
.btn.ghost, button.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.btn.danger, button.danger { background: #fff; color: var(--danger); border: 1px solid #ffd5d3; }
.btn.small, button.small { padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.toolbar input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: #f0c27a;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a {
  padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px;
}
.chips a.on { background: #2a221b; color: #fff; border-color: #2a221b; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: #6f6458; }
.field textarea { min-height: 88px; resize: vertical; }
.field input[type="file"] { padding: 8px 0; background: transparent; border: 0; }
.field .thumb { width: 72px; height: 72px; margin-bottom: 8px; }
.banner-preview { width: 280px; height: 110px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 8px; }
.banner-list { display: flex; flex-direction: column; gap: 16px; }
.banner-row { display: grid; grid-template-columns: 280px 1fr 1fr; gap: 12px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.banner-row .banner-preview { grid-row: span 2; margin: 0; }
.banner-row .row-actions { grid-column: 2 / -1; }
.banner-add { margin-top: 16px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 48px; gap: 8px; align-items: center; font-size: 13px; }
.track { height: 8px; background: #f3e7d8; border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; width: 100%; transform-origin: left center; background: linear-gradient(90deg, #ffc56a, #ff9e2a); border-radius: 99px; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.18), transparent 26%),
    linear-gradient(160deg, #1b4fa8, #2f7cf6 55%, #67b0ff);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(16, 54, 120, 0.2);
}
.login-card h1 { margin: 12px 0 4px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.login-card button { margin-top: 6px; padding: 12px; border: 0; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 700; }
.hint { margin-top: 14px; font-size: 12px; color: var(--muted); }

.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 14px; align-items: start; }
.mini { font-size: 12px; color: var(--muted); }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }

.workbench { background: var(--bg); }
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.billboard {
  min-height: 196px; border-radius: 8px; color: #fff; padding: 28px 32px;
  background:
    radial-gradient(circle at 78% 40%, rgba(255,255,255,0.2), transparent 26%),
    linear-gradient(100deg, #0d4cad 0%, #1d74e8 48%, #49a6ff 100%);
  display: flex; align-items: center;
  box-shadow: var(--shadow);
}
.billboard h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: 0.04em; }
.billboard p { margin: 0; opacity: 0.9; }
.bill-stats { display: flex; gap: 22px; margin-top: 22px; font-size: 13px; }
.bill-stats b { display: block; font-size: 22px; margin-bottom: 2px; }
.notice-panel {
  background: #fff; border-radius: 8px; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 12px 14px 8px; min-width: 0;
}
.notice-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.notice-hd b { font-size: 15px; }
.notice-hd a { color: var(--orange); font-size: 13px; }
.notice-panel ul { list-style: none; margin: 0; padding: 0; max-height: 168px; overflow: auto; }
.notice-panel li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px dashed #eef2f6; font-size: 13px; }
.notice-panel li a { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-panel time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.panel { margin: 16px 0 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 18px 8px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: #334155; text-align: center; }
.ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.c-blue { background: #3b82f6; } .c-amber { background: #f59e0b; } .c-teal { background: #14b8a6; }
.c-indigo { background: #6366f1; } .c-red { background: #ef4444; } .c-violet { background: #8b5cf6; }
.c-sky { background: #0ea5e9; } .c-green { background: #22c55e; } .c-orange { background: #f97316; }
.c-slate { background: #64748b; }
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cat-tab { border: 0; background: transparent; color: #64748b; padding: 6px 10px; border-radius: 6px; }
.cat-tab.on { background: #e8f1ff; color: #1d6fe8; font-weight: 650; }
.workbench .main, .main.workbench { padding-bottom: 28px; }

@media (max-width: 1100px) {
  .hero, .app-grid { grid-template-columns: 1fr 1fr; }
  .app-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 980px) {
  .kpis, .grid-2, .form-grid, .split, .banner-row, .hero { grid-template-columns: 1fr; }
  .banner-row .banner-preview, .banner-row .row-actions { grid-row: auto; grid-column: auto; }
  .top p { display: none; }
}
