/* 娜娜莉小窝 · 后台样式 */
:root {
  --paper: #fff7fb;
  --paper-2: #ffeff7;
  --card: #ffffff;
  --ink: #3b2b3f;
  --muted: #8b7a90;
  --faint: #b3a4b8;
  --line: #f2d7e5;
  --line-strong: #e8bdd2;
  --accent: #e0528c;
  --accent-soft: #ffe3ef;
  --accent-2: #9b8cff;
  --ok: #3f7d4e;
  --ok-soft: #e9f3ec;
  --warn: #a9701c;
  --warn-soft: #f8eede;
  --bad: #e04b60;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --side: 232px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- 框架 ---------- */
.a-shell { display: flex; min-height: 100vh; }

.a-side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px 16px;
  background: #fffdfa;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 20;
}

.a-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.a-brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font: 600 17px/1 var(--sans);
  letter-spacing: 0.02em;
}
.a-brand-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.a-brand-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-brand-txt i { font-style: normal; font-size: 11.5px; color: var(--faint); letter-spacing: 0.06em; }

.a-nav-group { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 4px; }
.a-nav-title {
  padding: 0 10px 6px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
}
.a-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #4a423a;
  font-size: 13.5px;
  transition: background .16s, color .16s;
}
.a-nav-item .ico { color: var(--faint); flex: none; }
.a-nav-item:hover { background: var(--paper-2); color: var(--ink); }
.a-nav-item.is-on { background: var(--ink); color: #fff; }
.a-nav-item.is-on .ico { color: #fff; }

.a-side-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.a-user { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); }
.a-user:hover { background: var(--paper-2); }
.a-avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600; font-size: 13px;
}
.a-avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.a-user-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.a-user-txt b { font-size: 13px; }
.a-user-txt i { font-style: normal; font-size: 11px; color: var(--faint); }
.a-logout button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: 0; background: none;
  border-radius: var(--radius-sm);
  color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer;
}
.a-logout button:hover { background: var(--accent-soft); color: var(--accent); }

.a-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--side);
  padding: 0 32px 64px;
}
.a-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 26px 0 18px;
  background: linear-gradient(var(--paper) 72%, rgba(251, 249, 245, 0));
}
.a-top h1 { font-size: 22px; }
.a-top p { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.a-top-l { min-width: 0; }
.a-top-r { display: flex; gap: 8px; }
.a-head-tools { display: flex; gap: 8px; }
.a-body { display: flex; flex-direction: column; gap: 18px; }

.a-flash {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--ok-soft); color: #2f6a3d;
  border: 1px solid #cfe4d5;
}
.a-flash--bad { background: var(--accent-soft); color: var(--bad); border-color: #edd3ce; }

/* ---------- 通用块 ---------- */
.a-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.a-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.a-card-head h2 { font-size: 14.5px; }
.a-card-head a { font-size: 12.5px; color: var(--muted); }

.a-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.a-two--side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.a-stack { display: flex; flex-direction: column; gap: 12px; }
.a-muted { color: var(--faint); font-size: 12px; }
.a-sub { color: var(--faint); font-size: 11.5px; font-family: var(--mono); }
.a-empty { color: var(--faint); font-size: 13px; padding: 22px 0; text-align: center; }
.a-count {
  display: inline-block; margin-left: 4px; padding: 1px 7px;
  border-radius: 20px; background: var(--paper-2);
  color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.a-hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.a-hint code { background: var(--paper-2); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 11.5px; }
.a-sub-h { font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 18px 0 8px; }

/* ---------- 统计 ---------- */
.a-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.a-stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.a-stat span { font-size: 12px; color: var(--muted); }
.a-stat b { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.a-stat i { font-style: normal; font-size: 11.5px; color: var(--faint); }
.a-stat i a { color: var(--accent); }

.a-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.a-chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.a-chart-bar { width: 100%; min-height: 3px; background: var(--ink); border-radius: 3px 3px 0 0; opacity: .82; }
.a-chart-col em { font-style: normal; font-size: 9.5px; color: var(--faint); white-space: nowrap; }

.a-rank li, .a-audit li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.a-rank li:last-child, .a-audit li:last-child { border-bottom: 0; }
.a-rank a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-rank b { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.a-audit span { color: var(--faint); font-size: 11.5px; flex: none; }
.a-audit b { font-weight: 500; flex: none; }
.a-audit i { font-style: normal; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.a-line { display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.a-line:last-child { border-bottom: 0; }
.a-line p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.a-line b { font-size: 13px; }
.a-line span { color: var(--faint); font-size: 11.5px; margin-left: 8px; }

/* ---------- 表格 ---------- */
.a-table-wrap { overflow-x: auto; margin: 0 -4px; }
.a-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.a-table th {
  text-align: left; font-weight: 500; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 0 10px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.a-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table .right { text-align: right; }
.a-strong { font-weight: 600; }
.a-table td .a-strong:hover { color: var(--accent); }
.a-row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.a-row-actions form { display: inline; }

/* ---------- 按钮 / 标签 ---------- */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.a-btn:hover { background: #322c26; color: #fff; }
.a-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.a-btn.ghost:hover { background: var(--paper-2); color: var(--ink); }
.a-btn.danger { background: transparent; color: var(--bad); border-color: #e8cbc7; }
.a-btn.danger:hover { background: var(--accent-soft); }
.a-btn.small { padding: 5px 10px; font-size: 12px; }
.a-btn.block { width: 100%; }
.a-btn.file { position: relative; overflow: hidden; }
.a-btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.a-tag {
  display: inline-block; padding: 1px 7px;
  border-radius: 20px; border: 1px solid var(--line-strong);
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.a-tag.on { background: var(--ok-soft); border-color: #cfe4d5; color: var(--ok); }
.a-tag.wait { background: var(--warn-soft); border-color: #eddfc4; color: var(--warn); }

.a-tabs { display: flex; gap: 2px; background: var(--paper-2); padding: 3px; border-radius: 8px; }
.a-tabs a { padding: 4px 10px; font-size: 12px; color: var(--muted); border-radius: 6px; }
.a-tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(26, 23, 20, .06); }

/* ---------- 表单 ---------- */
.a-form { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; padding: 0; background: none; border: 0; }
.a-form-main { display: flex; flex-direction: column; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.a-form-side { display: flex; flex-direction: column; gap: 14px; }
.a-side-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.a-side-block h3 { font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.a-block { display: flex; flex-direction: column; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.a-block:last-child { border-bottom: 0; padding-bottom: 0; }
.a-block h3, fieldset legend { font-size: 13px; font-weight: 600; margin: 0; }
.a-block h3 em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--faint); margin-left: 6px; }

.a-field { display: flex; flex-direction: column; gap: 5px; }
.a-field > span { font-size: 12px; color: var(--muted); }
.a-field > span em { font-style: normal; color: var(--faint); margin-left: 6px; font-size: 11px; }
.a-field input[type=text], .a-field input[type=password], .a-field input[type=number], .a-field input[type=file], .a-field select, .a-field textarea,
.a-inline-form input, .a-inline-form textarea, .a-social-row input, .a-social-row select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdfb;
  color: var(--ink);
  font: inherit; font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s;
}
.a-field textarea, .a-inline-form textarea { resize: vertical; line-height: 1.6; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus,
.a-inline-form input:focus, .a-inline-form textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 23, 20, .07);
}
.a-field textarea.a-code { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.a-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #4a423a; cursor: pointer; }
.a-check input { width: 15px; height: 15px; accent-color: var(--ink); }
.a-fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.a-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.a-inline { display: inline-flex; align-items: center; gap: 6px; }
.a-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.a-inline-form input[type=text] { flex: 1; min-width: 140px; }
.a-inline-form textarea { flex: 1 1 100%; }
.a-social-rows { display: flex; flex-direction: column; gap: 8px; }
.a-social-row { display: grid; grid-template-columns: 1fr 1.6fr 110px; gap: 8px; }

/* ---------- 留言条目 ---------- */
.a-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.a-item:last-child { border-bottom: 0; }
.a-item header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.a-item-who { display: flex; gap: 9px; align-items: center; }
.a-item-who b { font-size: 13px; }
.a-item-who .a-muted { display: block; font-size: 11px; }
.a-item-body { font-size: 13.5px; color: #332d27; background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; }
.a-reply { border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; }
.a-reply b { font-size: 11.5px; color: var(--accent); }
.a-reply p { font-size: 13px; color: #3c352f; margin-top: 3px; }
.a-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.a-item-actions form { display: inline; }
.a-details { border-top: 1px dashed var(--line); padding-top: 8px; }
.a-details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.a-details summary::-webkit-details-marker { display: none; }
.a-details summary::before { content: "+ "; color: var(--faint); }
.a-details[open] summary::before { content: "− "; }
.a-details .a-inline-form { margin-top: 8px; }

.a-banlist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.a-banlist li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--paper); border-radius: var(--radius-sm); font-size: 12.5px; }
.a-banlist li > b { font-family: var(--mono); font-weight: 600; }
.a-banlist li form { margin-left: auto; }

/* ---------- 作品 / 分区 ---------- */
.a-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.a-work { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; display: flex; flex-direction: column; gap: 6px; }
.a-work header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a-work p { font-size: 12.5px; color: var(--muted); }
.a-work-meta { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11px; }
.a-work .a-row-actions { justify-content: flex-start; }

.a-sec-list { display: flex; flex-direction: column; gap: 10px; }
.a-sec { display: flex; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.a-sec-l { display: flex; gap: 11px; }
.a-sec-ico {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; background: var(--paper-2); color: var(--ink);
}
.a-sec-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.a-sec b { font-size: 13.5px; }

/* ---------- 媒体 ---------- */
.a-upload { display: flex; align-items: center; }
.a-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.a-media-item { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.a-media-box {
  aspect-ratio: 4 / 3; border-radius: var(--radius-sm);
  background: var(--paper-2); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.a-media-box img { width: 100%; height: 100%; object-fit: cover; }
.a-media-icon { color: var(--faint); }
.a-media-item figcaption { display: flex; flex-direction: column; line-height: 1.35; }
.a-media-item figcaption b { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-media-actions { display: flex; gap: 6px; }
.a-media-actions form { display: flex; }

.a-kv { display: flex; flex-direction: column; gap: 8px; }
.a-kv li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.a-kv li span { color: var(--muted); }
.a-kv li:last-child { border-bottom: 0; }

/* ---------- 登录 ---------- */
.a-login-page { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(120% 80% at 20% 0%, #fdfbf7, var(--paper) 45%, var(--paper-2)); padding: 24px; }
.a-login { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; box-shadow: 0 24px 60px -32px rgba(26, 23, 20, .28); }
.a-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.a-login-brand div { display: flex; flex-direction: column; line-height: 1.3; }
.a-login-brand b { font-size: 15px; }
.a-login-brand i { font-style: normal; font-size: 11.5px; color: var(--faint); letter-spacing: .06em; }
.a-login-form { display: flex; flex-direction: column; gap: 13px; }
.a-login .a-field input { font-size: 16px; }
.a-error { color: var(--bad); font-size: 12.5px; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.a-login-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .a-form { grid-template-columns: minmax(0, 1fr); }
  .a-form-side { flex-direction: row; flex-wrap: wrap; }
  .a-side-block { flex: 1 1 240px; }
  .a-two--side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --side: 0px; }
  .a-shell { display: block; }
  .a-side {
    position: static; width: auto; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px; padding: 12px 16px;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .a-brand { padding: 0 10px 0 0; }
  .a-nav-group { flex-direction: row; flex-wrap: wrap; padding: 0; gap: 4px; }
  .a-nav-title { display: none; }
  .a-nav-item { padding: 6px 10px; font-size: 12.5px; }
  .a-nav-item .ico { display: none; }
  .a-side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 6px; padding: 0; border: 0; }
  .a-user-txt, .a-logout span { display: none; }
  .a-user, .a-logout button { padding: 6px; }
  .a-main { margin-left: 0; padding: 0 16px 56px; }
  .a-top { padding: 18px 0 12px; align-items: center; }
  .a-top h1 { font-size: 19px; }
  .a-top p { display: none; }
  .a-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-two { grid-template-columns: minmax(0, 1fr); }
  .a-card { padding: 15px 14px; }
  .a-form-main { padding: 15px 14px; }
  .a-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .a-social-row { grid-template-columns: minmax(0, 1fr); }
  .a-chart { height: 120px; }
}

@media (max-width: 640px) {
  .a-table thead { display: none; }
  .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; width: 100%; }
  .a-table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px; background: #fffdfb; }
  .a-table td { border: 0; padding: 5px 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: right; }
  .a-table td::before { content: attr(data-label); color: var(--faint); font-size: 11px; flex: none; text-align: left; }
  .a-table td.right { text-align: right; }
  .a-row-actions { justify-content: flex-end; }
  .a-media { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .a-sec { flex-direction: column; }
  .a-sec-r { align-items: flex-start; text-align: left; }
}

/* ---------- 资源上传 ---------- */
.a-uploader { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 6px; }
.a-uploader .a-field input[type="file"] { padding: 10px; background: #fff; border: 1.5px dashed var(--line-strong); border-radius: 10px; }
.a-progress { display: flex; align-items: center; gap: 12px; }
.a-progress-bar { flex: 1; height: 8px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.a-progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9dc2, #a892ff); transition: width .2s ease; }
.a-progress-txt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.a-result { border: 1px solid var(--line); background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.a-result b { font-size: 13px; }
.a-copy-row { display: flex; gap: 8px; }
.a-copy-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; }
