/* ==========================================================
   时序隙庭 · 后台管理界面样式（延续前台磨砂玻璃风格）
   ========================================================== */
:root {
  --bg1: #efe8fb; --bg2: #e4e7fa; --bg3: #f6ebf8;
  --glass: rgba(255, 255, 255, 0.62);
  --glass2: rgba(255, 255, 255, 0.82);
  --brd: rgba(255, 255, 255, 0.8);
  --ink: #261d42; --ink2: #453a6b; --ink3: #6d6291;
  --a1: #7b5cf0; --a2: #b06ef0;
  --soft: rgba(123, 92, 240, 0.12);
  --danger: #d6467a; --ok: #2f9e6b; --warn: #c98a1f;
  --r: 16px; --sh: 0 10px 30px rgba(96, 76, 158, 0.14);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 12% 6%, var(--bg2) 0%, transparent 58%),
    radial-gradient(110% 80% at 88% 10%, var(--bg3) 0%, transparent 62%),
    linear-gradient(168deg, var(--bg1), var(--bg2) 52%, var(--bg3));
  background-attachment: fixed;
  line-height: 1.7;
}
a { color: var(--a1); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; }
img { max-width: 100%; display: block; }
code { background: rgba(123, 92, 240, 0.12); padding: 1px 6px; border-radius: 5px; font-size: 0.88em; }

/* 布局 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--brd);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.topbar .logo { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .84rem; color: var(--ink3); }
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(14px, 3vw, 28px); }
.card {
  background: var(--glass); border: 1px solid var(--brd); border-radius: var(--r);
  box-shadow: var(--sh), inset 0 1px 0 rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  padding: clamp(16px, 2.5vw, 26px);
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.card .sub { color: var(--ink3); font-size: .88rem; margin-bottom: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.hidden { display: none !important; }

/* 标签页 */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs button {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--brd);
  background: rgba(255, 255, 255, .55); cursor: pointer; font-size: .9rem; color: var(--ink2);
  transition: all .2s;
}
.tabs button:hover { background: #fff; }
.tabs button.on { background: linear-gradient(120deg, var(--a1), var(--a2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(123, 92, 240, .3); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--brd);
  background: rgba(255, 255, 255, .72); color: var(--ink);
  font-size: .9rem; transition: all .18s;
}
.btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(96, 76, 158, .16); }
.btn.primary { background: linear-gradient(120deg, var(--a1), var(--a2)); color: #fff; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(214, 70, 122, .35); background: rgba(214, 70, 122, .08); }
.btn.small { padding: 4px 11px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: .84rem; color: var(--ink2); }
.field .hint { font-size: .76rem; color: var(--ink3); }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(112, 88, 176, .2); background: rgba(255, 255, 255, .8);
  outline: none; font-size: .92rem; transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(123, 92, 240, .6); box-shadow: 0 0 0 3px rgba(123, 92, 240, .12);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.65; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; min-height: 260px; }
input[type=file] { font-size: .82rem; }
input[type=color] { width: 100%; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid rgba(112, 88, 176, .2); background: #fff; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.check input { width: 16px; height: 16px; }

/* 表格 / 列表 */
table.list { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.list th, table.list td { padding: 9px 10px; text-align: left; border-bottom: 1px solid rgba(112, 88, 176, .12); vertical-align: top; }
table.list th { color: var(--ink3); font-weight: 600; font-size: .8rem; }
table.list tr:hover td { background: rgba(255, 255, 255, .5); }
.thumb-s { width: 54px; height: 68px; border-radius: 8px; object-fit: cover; background: #eee; }
.muted { color: var(--ink3); font-size: .82rem; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .74rem; background: var(--soft); color: var(--a1); }
.pill.ok { background: rgba(47, 158, 107, .12); color: var(--ok); }
.pill.warn { background: rgba(201, 138, 31, .14); color: var(--warn); }
.pill.bad { background: rgba(214, 70, 122, .12); color: var(--danger); }

/* 空状态 / 提示 */
.empty { padding: 26px; text-align: center; color: var(--ink3); font-size: .9rem; border: 1px dashed rgba(112, 88, 176, .3); border-radius: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px);
  padding: 10px 22px; border-radius: 999px; background: rgba(255, 255, 255, .95);
  border: 1px solid var(--brd); box-shadow: 0 12px 30px rgba(96, 76, 158, .22);
  font-size: .9rem; opacity: 0; pointer-events: none; transition: all .28s; z-index: 100;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { color: var(--danger); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(400px, 100%); }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card p.sub { margin-bottom: 20px; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: flex-start; justify-content: center; padding: 4vh 16px;
  background: rgba(38, 28, 68, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  overflow-y: auto;
}
.modal.on { display: flex; }
.modal-card {
  width: min(860px, 100%); background: rgba(255, 255, 255, .94);
  border-radius: 20px; border: 1px solid #fff; box-shadow: 0 24px 60px rgba(38, 28, 68, .3);
  padding: 22px; position: relative;
}
.modal-card h3 { font-size: 1.15rem; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.modal-card .close { cursor: pointer; border: 0; background: none; font-size: 1.3rem; color: var(--ink3); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* 图片位 */
.img-pick { display: flex; gap: 10px; align-items: center; }
.img-pick .preview {
  width: 92px; height: 92px; border-radius: 10px; object-fit: cover;
  background: repeating-linear-gradient(135deg, #e8e2f7 0 8px, #f4f0fc 8px 16px);
  border: 1px solid rgba(112, 88, 176, .18);
}
.img-pick .preview.wide { width: 160px; height: 92px; }

/* 分区编辑器 */
.sec-item { border: 1px solid rgba(112, 88, 176, .18); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: rgba(255, 255, 255, .6); }
.sec-item .sec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sec-item .sec-head input { flex: 1; }
.sec-item .sec-head select { width: 130px; }
.color-swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .1); }

@media (max-width: 640px) {
  table.list { display: block; overflow-x: auto; white-space: nowrap; }
  .modal-card { padding: 16px; }
}
