/* ============================================================
   数据后台 · 深色数据舱风格（与分享页同一套视觉语言）
   ============================================================ */

:root {
  --bg: #39414f;
  --panel: #495261;
  --panel-2: #5f6b7e;
  --line: #636d80;
  --line-soft: #65718a;
  --text: #eef2f8;
  --text-2: #cfd6e2;
  --text-3: #a3adbf;
  --mint: #35e0a1;
  --blue: #4d9bff;
  --danger: #ff5c5c;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(760px 380px at 6% -10%, rgba(53, 224, 161, .08), transparent 60%),
    radial-gradient(700px 340px at 100% 0%, rgba(77, 155, 255, .08), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.admin { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }

/* ----------------------------- 侧边栏 ----------------------------- */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #333b48;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 14px; border-bottom: 1px solid #4b5568; }
.side-brand img { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.side-brand b { display: block; font-size: 13.5px; letter-spacing: .8px; }
.side-brand span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 3px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-3);
  cursor: pointer;
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: #5f6b7e; color: var(--text-2); }
.nav-item.is-active {
  color: var(--mint);
  background: rgba(53, 224, 161, .08);
  box-shadow: inset 2px 0 0 var(--mint);
}
.nav-item .ico { width: 15px; text-align: center; font-size: 12px; opacity: .9; }

.side-foot { margin-top: auto; }
.side-foot a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .5px;
  color: var(--text-3);
  text-decoration: none;
  background: #47505f;
  border: 1px solid var(--line);
  text-align: center;
  transition: all .14s ease;
}
.side-foot a:hover { border-color: rgba(53, 224, 161, .45); color: var(--mint); }

/* ----------------------------- 主区域 ----------------------------- */

.main { padding: 22px 26px 60px; min-width: 0; }

.main-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.main-head h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.main-head .desc { font-family: var(--mono); font-size: 10.5px; letter-spacing: .4px; color: var(--text-3); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel) 0%, #47505f 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .4px;
  color: var(--mint);
  background: rgba(53, 224, 161, .1);
  border: 1px solid rgba(53, 224, 161, .2);
  border-radius: 4px;
  padding: 2px 6px;
}

.hint { font-size: 11.5px; color: var(--text-3); }

/* ----------------------------- 表单 ----------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px 16px;
}

.field label {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: .3px;
  margin-bottom: 6px;
}
.field .unit { font-family: var(--mono); color: #a8b2c3; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #404857;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea { height: auto; padding: 10px; line-height: 1.7; resize: vertical; font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(53, 224, 161, .55);
  box-shadow: 0 0 0 2px rgba(53, 224, 161, .1);
}

.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

button {
  height: 34px;
  padding: 0 15px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #404857;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .14s ease;
}
button:hover { border-color: #6d7a93; color: var(--text); }

button.primary {
  border: 1px solid rgba(53, 224, 161, .5);
  color: #04120c;
  background: linear-gradient(100deg, #35e0a1, #22c1c3);
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 6px 18px rgba(53, 224, 161, .16);
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(53, 224, 161, .26); }

button.tiny { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 4px; }
button.danger { color: #ff8080; border-color: rgba(255, 92, 92, .25); background: rgba(255, 92, 92, .06); }
button.danger:hover { border-color: rgba(255, 92, 92, .5); color: #ff9b9b; }

/* ----------------------------- 表格 ----------------------------- */

.table-wrap { overflow-x: auto; border-radius: 6px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }

thead th {
  text-align: left;
  padding: 8px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  background: #404857;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td { padding: 7px 9px; border-bottom: 1px solid #515a6a; vertical-align: middle; }
tbody tr:hover { background: #5f6b7e; }

td input, td select { height: 30px; font-size: 12px; }
td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--mint);
  font-weight: 600;
}

.pf-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 0 0 6px currentColor;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar select { width: auto; min-width: 120px; }

.toolbar > input,
.toolbar > select,
.toolbar > button { flex: none; }
.toolbar input[type="number"] { width: 120px; }
.toolbar input[type="date"] { width: 165px; }
.toolbar input[type="text"],
.toolbar input[type="search"] { width: auto; }

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.pager .spacer { flex: 1; }

/* ----------------------------- 其他 ----------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 14px);
  padding: 9px 16px;
  border-radius: 6px;
  background: #515a6a;
  border: 1px solid #677184;
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #2a1414; border-color: rgba(255, 92, 92, .45); color: #ffb3b3; }

.tipbar {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 5px;
  background: rgba(53, 224, 161, .04);
  border: 1px solid rgba(53, 224, 161, .14);
  border-left: 2px solid rgba(53, 224, 161, .55);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.tipbar b { font-family: var(--mono); color: var(--mint); }

.swatch {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  vertical-align: middle;
  margin-right: 8px;
  border: 1px solid var(--line);
  background: #404857;
}

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-brand { padding: 0 10px 0 0; border-bottom: 0; border-right: 1px solid var(--line-soft); }
  .nav { flex-direction: row; }
  .nav-item { white-space: nowrap; }
  .nav-item.is-active { box-shadow: inset 0 -2px 0 var(--mint); }
  .side-foot { margin: 0 0 0 auto; }
  .main { padding: 16px 14px 50px; }
}


/* ----------------------------- 弹窗 ----------------------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 15, 21, .62);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(580px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #39414f;
  border: 1px solid #6b768c;
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .5);
  animation: modalIn .18s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: .5px; }

.modal-close {
  border: 0;
  background: none;
  color: #a9b3c4;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: #fff; }

.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body textarea { min-height: 168px; }

.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.modal-foot .hint { margin-right: auto; font-family: var(--mono); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: none; }
}


.tiny-link {
  font-size: 12px;
  color: var(--mint);
  text-decoration: none;
}
.tiny-link:hover { text-decoration: underline; }
