:root {
  --bg: #070a14; --panel: #0f1526; --panel2: #131b30; --line: rgba(120,160,255,.14);
  --line2: rgba(120,160,255,.28); --txt: #e8eefc; --dim: #93a3c4; --mute: #5f6f90;
  --cyan: #2de2ff; --purple: #8b5cff; --grad: linear-gradient(120deg,#2de2ff,#8b5cff);
  --green: #38e8a0; --red: #ff6b8b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; background: var(--bg); color: var(--txt); overflow: hidden; }
input, textarea, select, button { font-family: inherit; }
.btn-primary { background: var(--grad); color: #04111f; border: none; padding: 10px 20px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(45,226,255,.4); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--dim); padding: 9px 16px; border-radius: 10px; cursor: pointer; transition: .2s; font-size: 13px; }
.btn-ghost:hover { color: var(--cyan); border-color: var(--cyan); }

/* 登录 */
.login-mask { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(800px 500px at 50% 30%, rgba(139,92,255,.18), transparent), var(--bg); }
.login-box { width: 380px; max-width: 90vw; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 38px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.lm-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; font-weight: 800; color: #04111f; background: var(--grad); }
.lm-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-logo b { font-size: 18px; } .login-logo i { font-style: normal; color: var(--mute); font-size: 12px; align-self: flex-end; padding-bottom: 2px; }
.login-box h2 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--dim); font-size: 13px; margin-bottom: 22px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); font-size: 14px; }
.login-box input:focus { outline: none; border-color: var(--cyan); }
.login-box .btn-primary { margin-top: 6px; padding: 12px; font-size: 15px; }
.login-tip { text-align: center; font-size: 13px; min-height: 16px; color: var(--red); }
.login-hint { text-align: center; font-size: 11.5px; color: var(--mute); margin-top: 16px; }

/* 框架 */
.admin { display: flex; height: 100vh; }
.sidebar { width: 230px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.side-logo b { font-size: 16px; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--dim); font-size: 14px; cursor: pointer; transition: .15s; }
.side-nav a:hover { background: var(--panel2); color: var(--txt); }
.side-nav a.active { background: var(--grad); color: #04111f; font-weight: 700; }
.side-nav .ic { width: 18px; text-align: center; }
.side-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot .btn-ghost { width: 100%; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(15,21,38,.6); backdrop-filter: blur(8px); }
.topbar h1 { font-size: 20px; }
.content { flex: 1; overflow-y: auto; padding: 26px 28px; }

/* 仪表盘 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.stat-card .n { font-size: 34px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .l { color: var(--dim); font-size: 13px; margin-top: 4px; }
.dash-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 20px; }
.dash-card h3 { font-size: 16px; margin-bottom: 12px; }
.dash-card p { color: var(--dim); font-size: 14px; line-height: 1.9; }
.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 表格 */
.tbl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tbl-head h2 { font-size: 18px; }
.toolbar { display: flex; gap: 10px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
th, td { text-align: left; padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
th { color: var(--mute); font-weight: 600; background: var(--panel2); font-size: 12.5px; letter-spacing: .5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel2); }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(45,226,255,.12); color: var(--cyan); border: 1px solid rgba(45,226,255,.25); }
.row-actions { display: flex; gap: 8px; }
.col-thumb { width: 70px; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); display: block; }
.thumb-empty { display: grid; place-items: center; color: var(--mute); font-size: 20px; background: var(--panel2); border-style: dashed; }
.mini { padding: 5px 12px; font-size: 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; transition: .15s; }
.mini:hover { color: var(--cyan); border-color: var(--cyan); }
.mini.danger:hover { color: var(--red); border-color: var(--red); }
.empty { text-align: center; color: var(--mute); padding: 40px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; z-index: 90; background: rgba(3,5,12,.7); display: grid; place-items: center; backdrop-filter: blur(4px); }
.modal { width: 640px; max-width: 94vw; max-height: 88vh; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-head button { background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }

/* 表单 */
.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: 12.5px; color: var(--dim); }
.field input, .field textarea, .field select { padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); font-size: 14px; width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--cyan); }
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.field .hint { font-size: 11px; color: var(--mute); }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.img-field { display: flex; flex-direction: column; gap: 8px; }
.img-prev { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.img-actions { display: flex; gap: 8px; align-items: center; }
.img-actions input[type=file] { font-size: 12px; color: var(--dim); max-width: 220px; }
.social-logo-field .img-actions { gap: 6px; flex-wrap: wrap; }
.social-logo-field .img-actions .mini { padding: 8px 14px; }

/* 统计行编辑 */
.stat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 8px; align-items: center; }
.stat-row input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); }
.stat-row .del { background: none; border: 1px solid var(--line); color: var(--red); border-radius: 8px; padding: 8px 10px; cursor: pointer; }

/* Hero 业务域卡片编辑器 */
.hd-row { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.hd-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; align-items: end; }
.hd-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.hd-grid label.hd-full { grid-column: 1 / -1; }
.hd-grid label.hd-switch { flex-direction: row; align-items: center; gap: 6px; color: var(--txt); }
.hd-grid input[type=text], .hd-grid input:not([type]) { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--txt); }
.hd-grid .hint { font-size: 11px; color: var(--dim); font-weight: 400; }
.hd-grid .hd-del { background: none; border: 1px solid var(--line); color: var(--red); border-radius: 8px; padding: 8px 12px; cursor: pointer; align-self: end; }
@media (max-width: 900px) { .hd-grid { grid-template-columns: 1fr 1fr; } }

/* toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel2); border: 1px solid var(--line2); color: var(--txt); padding: 12px 22px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--green); } .toast.err { border-color: var(--red); }

@media (max-width: 820px) {
  .sidebar { width: 64px; } .side-logo b, .side-nav a span.txt, .side-foot .btn-ghost { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}

/* 数据看板 */
.trend { width: 100%; height: auto; display: block; margin-top: 6px; }
.trend .t-grid { stroke: rgba(255,255,255,.07); }
.trend .t-line-pv { fill: none; stroke: var(--cyan); stroke-width: 2; }
.trend .t-line-uv { fill: none; stroke: var(--purple); stroke-width: 2; }
.trend .t-ax { fill: var(--mute); font-size: 10px; text-anchor: middle; }
.trend .t-lg { fill: var(--dim); font-size: 11px; }
.trend .t-lg-pv { fill: var(--cyan); }
.trend .t-lg-uv { fill: var(--purple); }
.ref-list { list-style: none; padding: 0; margin: 0; }
.ref-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ref-list li:last-child { border-bottom: none; }
.ref-list li span { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-list li b { color: var(--cyan); font-weight: 700; }
.ref-list li.empty { justify-content: center; border: none; }
.dev-bar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; margin-top: 12px; background: rgba(255,255,255,.05); }
.dev-seg { display: flex; align-items: center; justify-content: center; color: #04111f; font-weight: 700; font-size: 13px; white-space: nowrap; }
.dev-seg.mobile { background: var(--cyan); }
.dev-seg.desktop { background: var(--purple); color: #fff; }
.range-btns { display: flex; gap: 8px; }
.range-btns .rng.on { color: var(--cyan); border-color: var(--cyan); }
.an-loading { color: var(--mute); padding: 30px; }
