:root {
  --bg: #f5f8fb;
  --panel: #ffffff;
  --text: #10202f;
  --muted: #6c7a89;
  --line: #e8eef5;
  --primary: #1677ff;
  --primary-2: #16b6a1;
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --shadow: 0 16px 40px rgba(16, 32, 47, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #dff9f4 0, transparent 38%), radial-gradient(circle at 80% 0%, #dcecff 0, transparent 32%), linear-gradient(160deg, #f6fbff 0%, #eef7f4 100%); }
.login-card { width: min(430px, 100%); background: rgba(255,255,255,.9); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; padding: 34px; box-shadow: var(--shadow); }
.logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 28px; box-shadow: 0 12px 28px rgba(22, 119, 255, .26); }
.logo h1 { margin: 0; font-size: 24px; }
.logo p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 12px; padding: 12px 14px; outline: none; transition: .2s; }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(22,119,255,.55); box-shadow: 0 0 0 4px rgba(22,119,255,.1); }
.textarea { min-height: 140px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 14px; border-radius: 12px; color: #fff; background: var(--primary); white-space: nowrap; transition: .18s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(22,119,255,.2); }
.btn.block { width: 100%; min-height: 46px; }
.btn.secondary { background: #eef5ff; color: var(--primary); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.warning { background: var(--warning); }
.btn.success { background: var(--success); }
.btn.small { min-height: 30px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.login-tips { margin: 18px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; background: #f7fafc; border: 1px solid var(--line); padding: 12px; border-radius: 14px; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px; background: #0e1d2e; color: #dbeafe; overflow: auto; }
.side-logo { display: flex; gap: 12px; align-items: center; padding: 10px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-logo .logo-icon { width: 42px; height: 42px; border-radius: 14px; font-size: 22px; }
.side-logo h2 { margin: 0; font-size: 18px; color: #fff; }
.side-logo p { margin: 2px 0 0; font-size: 12px; color: #9db0c5; }
.nav-section { margin: 18px 0 10px; color: #7990a8; font-size: 12px; padding: 0 8px; }
.nav-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #dbeafe; background: transparent; padding: 11px 12px; border-radius: 12px; margin: 3px 0; text-align: left; }
.nav-btn span:first-child { display: flex; align-items: center; gap: 10px; }
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-count { font-size: 11px; color: #97a6b7; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 70px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px; background: rgba(245,248,251,.84); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(232,238,245,.75); }
.topbar h1 { margin: 0; font-size: 22px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.admin-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.content { padding: 24px 26px 40px; width: 100%; max-width: 1680px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(16,32,47,.04); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 18px; overflow: hidden; position: relative; }
.metric::after { content: ''; position: absolute; width: 92px; height: 92px; border-radius: 999px; background: linear-gradient(135deg, rgba(22,119,255,.18), rgba(22,182,161,.1)); right: -24px; bottom: -34px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panel { padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.mini-list { display: grid; gap: 10px; }
.mini-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-item:last-child { border-bottom: 0; }
.mini-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { color: var(--muted); font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { min-width: 280px; }
.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { background: #f8fbfe; color: #627086; font-weight: 700; position: sticky; top: 0; z-index: 1; }
tr:hover td { background: #fbfdff; }
.cell-main { max-width: 340px; }
.cell-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { margin-top: 4px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 12px; background: #eef4fa; border: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #eef5ff; color: var(--primary); font-size: 12px; font-weight: 650; }
.badge.green { background: #ecfdf3; color: #039855; }
.badge.orange { background: #fff7ed; color: #dc6803; }
.badge.red { background: #fff1f3; color: #d92d20; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px; color: var(--muted); font-size: 13px; }
.pager-buttons { display: flex; align-items: center; gap: 8px; }
.modal-mask { position: fixed; inset: 0; background: rgba(12, 24, 39, .48); z-index: 80; display: none; align-items: stretch; justify-content: flex-end; }
.modal-mask.show { display: flex; }
.drawer { width: min(760px, 100%); height: 100%; background: #fff; box-shadow: -24px 0 60px rgba(16,32,47,.2); display: flex; flex-direction: column; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { padding: 20px 22px; overflow: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.json-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.upload-box { border: 1px dashed #b8c7d8; border-radius: 14px; padding: 14px; background: #fbfdff; }
.upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.upload-item img { width: 100%; height: 76px; object-fit: cover; display: block; }
.upload-item input { width: 100%; border: 0; border-top: 1px solid var(--line); font-size: 11px; padding: 6px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: rgba(16,32,47,.92); color: #fff; padding: 12px 16px; border-radius: 999px; z-index: 120; opacity: 0; transition: .2s; max-width: 92vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { padding: 42px; text-align: center; color: var(--muted); }
.system-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.system-actions .card { padding: 18px; }
.system-actions h3 { margin: 0 0 8px; }
.system-actions p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.mobile-menu { display: none; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; top: 0; z-index: 60; width: 260px; transition: .2s; }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-flex; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .topbar h1 { font-size: 18px; }
  .dashboard-grid, .form-grid, .system-actions { grid-template-columns: 1fr; }
  .search { min-width: 100%; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar .btn, .toolbar .input, .toolbar .select { flex: 1; }
}
