/* S.K AV PRO 管理后台 —— 深色主题 v1 */
:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --card: #151924;
  --line: #232a3a;
  --txt: #e8eaf0;
  --muted: #8b93a7;
  --gold: #d4a94e;
  --gold-2: #b8892f;
  --ok: #3fb97c;
  --warn: #e0a33e;
  --err: #e05555;
  --info: #4e9ad4;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--txt); line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: #eac06a; }
code { background: #1c2230; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #14100a; font-weight: 800; font-size: 15px; letter-spacing: .5px;
}
.brand-text { font-weight: 600; font-size: 14px; color: var(--txt); }
.menu { padding: 14px 10px; flex: 1; }
.menu a {
  display: block; padding: 10px 14px; margin-bottom: 4px; border-radius: 8px;
  color: var(--muted); font-size: 14px; transition: all .15s;
}
.menu a:hover { background: #1a2030; color: var(--txt); }
.menu a.on { background: linear-gradient(90deg, rgba(212,169,78,.16), rgba(212,169,78,.05)); color: var(--gold); }
.menu-sep { margin: 16px 14px 6px; font-size: 11px; color: #5a6378; letter-spacing: 2px; }
.sidebar-foot { padding: 16px 18px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot .who { color: var(--txt); margin-bottom: 6px; }
.sidebar-foot .logout { color: var(--muted); font-size: 12px; }
.sidebar-foot .logout:hover { color: var(--err); }
.main { flex: 1; padding: 28px 32px; max-width: calc(100% - 220px); }

/* ===== 标题 ===== */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.page-head .page-title { margin-bottom: 0; }
.page-actions { display: flex; gap: 10px; }

/* ===== 卡片 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--txt); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== 统计 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: block; color: var(--txt);
}
a.stat:hover { border-color: var(--gold-2); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--gold); }
.stat-warn .stat-num { color: var(--warn); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ===== 表格 ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.tbl-hover tbody tr:hover { background: #1a2030; }
.row-off { opacity: .45; }
.t-right { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 24px 0 !important; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #1c2230; }
.thumb-lg { width: 90px; height: 90px; display: block; margin-top: 8px; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; background: #242b3d; color: var(--muted); }
.tag-ok { background: rgba(63,185,124,.15); color: var(--ok); }
.tag-warn { background: rgba(224,163,62,.15); color: var(--warn); }
.tag-info { background: rgba(78,154,212,.15); color: var(--info); }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #1c2230; color: var(--txt); font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--gold-2); color: var(--gold); }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); border: none; color: #14100a; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); color: #14100a; }
.btn-danger { color: var(--err); border-color: rgba(224,85,85,.4); }
.btn-danger:hover { background: rgba(224,85,85,.12); color: var(--err); border-color: var(--err); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.inline { display: inline; }

/* ===== 表单 ===== */
.form-card { max-width: 900px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 14px; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; margin-top: 4px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--txt); font-size: 13.5px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-2); }
textarea { resize: vertical; }
.chk { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--txt); }
.chk input { width: auto; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type=search] { width: 260px; margin-top: 0; }
.filter-bar select { width: auto; margin-top: 0; }

/* ===== 导入 / 内联编辑 ===== */
.import-box { margin-bottom: 16px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; }
.import-box summary { cursor: pointer; color: var(--gold); font-size: 13.5px; }
.import-form { margin-top: 12px; }
.import-form input[type=file] { margin: 10px 0; color: var(--muted); }
.inline-edit { display: inline-block; position: relative; }
.inline-edit summary { list-style: none; }
.inline-edit summary::-webkit-details-marker { display: none; }
.edit-pop {
  position: absolute; right: 0; top: 34px; z-index: 30; width: 240px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}

/* ===== 闪存消息 ===== */
.flash { padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.flash-ok { background: rgba(63,185,124,.12); border: 1px solid rgba(63,185,124,.4); color: var(--ok); }
.flash-err { background: rgba(224,85,85,.12); border: 1px solid rgba(224,85,85,.4); color: var(--err); }

/* ===== 分页 ===== */
.pager { margin-top: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager a.on { background: var(--gold); color: #14100a; border-color: var(--gold); }

/* ===== 时间线 ===== */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { border-left: 3px solid var(--gold-2); padding: 4px 0 4px 14px; }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; font-size: 12.5px; }
.tl-body { font-size: 13.5px; }

/* ===== 键值表 ===== */
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--txt); }

/* ===== 登录页 ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(ellipse at 30% 20%, #151a28 0%, var(--bg) 60%); }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 36px 32px; }
.login-brand { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; letter-spacing: 4px; }
.login-card label { margin-bottom: 14px; }
.login-card .btn-block { margin-top: 10px; padding: 11px; }

/* ===== 移动端 ===== */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .menu { display: flex; flex-wrap: wrap; gap: 4px; }
  .menu a { margin-bottom: 0; }
  .sidebar-foot { display: flex; justify-content: space-between; align-items: center; }
  .main { max-width: 100%; padding: 18px; }
  .tbl { display: block; overflow-x: auto; }
}
