:root {
  --ink: #1d1811;
  --ink-soft: #4f473e;
  --ivory: #f4f0e8;
  --paper: #fffdf8;
  --gold: #b88a3b;
  --gold-dark: #93661f;
  --line: #e3dbcf;
  --muted: #7a7167;
  --success: #2f7c59;
  --danger: #a74338;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--ivory);
}
.hidden { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--ivory); }
button,select,input,textarea { font: inherit; }
button,a { -webkit-tap-highlight-color: transparent; }
.admin-header { height: 74px; padding: 0 38px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--ink); border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.admin-brand span:last-child { display: grid; gap: 3px; }
.admin-brand strong { font-family: Georgia,"Songti SC",serif; font-size: 18px; letter-spacing: .08em; }
.admin-brand small { color: #cbbda9; font-size: 11px; }
.admin-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: #d9ac5e; font-size: 23px; }
.admin-header nav { display: flex; align-items: stretch; gap: 26px; height: 100%; }
.admin-header nav a,.admin-header nav button { padding: 0 4px; display: flex; align-items: center; border: 0; color: #e7ded2; background: transparent; text-decoration: none; font-size: 14px; cursor: pointer; }
.admin-header nav .active { color: #e4bd73; box-shadow: inset 0 -3px #c9963f; }
.admin-shell { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 210px minmax(0,1fr); }
.admin-sidebar { padding: 22px 0; background: #18140f; }
.admin-sidebar button { width: 100%; min-height: 58px; padding: 0 26px; border: 0; border-left: 4px solid transparent; color: #ded4c8; background: transparent; text-align: left; cursor: pointer; font-size: 15px; }
.admin-sidebar button:hover { background: rgba(255,255,255,.045); }
.admin-sidebar button.active { border-left-color: var(--gold); color: #e7bd70; background: rgba(184,138,59,.12); }
.admin-main { width: min(1320px,100%); padding: 34px 32px 64px; }
.admin-heading { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.admin-heading h1 { margin: 0; font: 700 34px/1.2 Georgia,"Songti SC",serif; }
.admin-heading p { margin: 7px 0 0; color: var(--muted); }
.metric-rail { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 8px 22px rgba(38,29,17,.055); }
.metric-rail div { min-height: 104px; padding: 20px 26px; display: grid; align-content: center; gap: 7px; border-right: 1px solid var(--line); }
.metric-rail div:last-child { border-right: 0; }
.metric-rail span { color: var(--muted); font-size: 13px; }
.metric-rail strong { color: var(--gold-dark); font: 500 32px/1 Georgia,serif; }
.admin-panel { margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 8px 22px rgba(38,29,17,.05); }
.panel-heading { margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2 { margin: 0; font: 700 20px/1.3 Georgia,"Songti SC",serif; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th,.admin-table td { min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { color: #5d5348; background: #f8f4ed; font-weight: 700; white-space: nowrap; }
.admin-table td { color: var(--ink-soft); }
.admin-table strong { color: var(--ink); }
.status { color: var(--gold-dark); font-weight: 700; }
.status.active,.status.published,.status.approved,.status.ready { color: var(--success); }
.row-actions { display: flex; gap: 8px; white-space: nowrap; }
.primary,.secondary,.danger,.row-actions button { min-height: 34px; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.primary { border: 1px solid var(--gold); color: #fff; background: var(--gold); }
.secondary,.row-actions button { border: 1px solid #d8cebf; color: var(--ink); background: #fff; }
.row-actions .approve { border-color: #c79b53; color: var(--gold-dark); }
.danger,.row-actions .reject { border: 1px solid #dcc6c2; color: var(--danger); background: #fff; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.approval-dialog { width: min(460px,calc(100vw - 28px)); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.approval-dialog::backdrop { background: rgba(20,16,11,.52); }
.approval-dialog form { padding: 24px; }
.dialog-heading { margin-bottom: 22px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font: 700 24px Georgia,"Songti SC",serif; }
.dialog-heading p { margin: 6px 0 18px; color: var(--muted); }
.dialog-heading button { align-self: start; border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.approval-dialog label { margin-bottom: 15px; display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.approval-dialog select { min-height: 43px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.dialog-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.error { padding: 18px; border-left: 4px solid var(--danger); background: #fff5f3; }
.knowledge-help { margin-bottom: 18px; padding: 15px 18px; display: grid; gap: 6px; border: 1px solid #dec89f; border-left: 4px solid var(--gold); border-radius: 10px; background: #fffaf0; }
.knowledge-help strong { color: var(--gold-dark); }
.knowledge-help span { color: var(--ink-soft); line-height: 1.7; }
.knowledge-detail-dialog { width: min(900px,calc(100vw - 28px)); max-height: min(84vh,900px); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.knowledge-detail-dialog::backdrop { background: rgba(20,16,11,.52); }
.knowledge-detail-shell { padding: 24px; }
.knowledge-detail-content { max-height: 62vh; overflow: auto; color: var(--ink-soft); line-height: 1.8; }
.knowledge-detail-content h1,.knowledge-detail-content h2,.knowledge-detail-content h3 { color: var(--ink); }
.knowledge-detail-content table { width: 100%; border-collapse: collapse; }
.knowledge-detail-content th,.knowledge-detail-content td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
@media (max-width: 900px) {
  .admin-header { padding: 0 18px; }
  .admin-brand strong { font-size: 15px; }
  .admin-header nav { gap: 12px; }
  .admin-shell { min-width: 0; grid-template-columns: minmax(0,1fr); }
  .admin-sidebar { width: 100%; min-width: 0; padding: 8px; display: flex; overflow-x: auto; }
  .admin-sidebar button { width: auto; min-width: max-content; min-height: 44px; padding: 0 14px; border-left: 0; border-bottom: 3px solid transparent; }
  .admin-sidebar button.active { border-bottom-color: var(--gold); }
  .admin-main { padding: 24px 14px 50px; }
  .metric-rail { grid-template-columns: 1fr 1fr; }
  .metric-rail div:nth-child(2) { border-right: 0; }
  .metric-rail div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .admin-header { height: auto; min-height: 88px; align-items: flex-start; flex-wrap: wrap; padding-block: 14px; }
  .admin-header nav { width: 100%; height: auto; justify-content: flex-end; gap: 10px; }
  .admin-header nav a:first-child { display: none; }
  .metric-rail { grid-template-columns: 1fr; }
  .metric-rail div { min-height: 80px; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-rail div:last-child { border-bottom: 0; }
}
