/* ============================================================
   styles.css  —  杂志/出版物风 共享样式
   暖色亮调 + 衬线字体 + 深棕强调
   ============================================================ */

:root {
  /* ---- 颜色：暖色亮调 ---- */
  --bg:        #faf6ed;   /* 米白纸张感 */
  --surface:   #ffffff;   /* 纯白面板 */
  --surface-2: #f4ede0;   /* 极浅米色（hover/二级面） */
  --border:    #e8e0d0;   /* 暖灰细线 */
  --border-2:  #d8cfbb;   /* 稍深（input 下划线） */

  --text-1:    #1c1814;   /* 主文字 深棕黑 */
  --text-2:    #6b6258;   /* 次文字 */
  --text-3:    #9a928a;   /* 辅助灰 */

  --accent:    #8a6a3a;   /* 深棕（亮底要深色才显眼） */
  --accent-d:  #6b4f25;
  --success:   #16a34a;   /* 鲜艳绿（亮底专用） */
  --danger:    #dc2626;   /* 鲜艳红 */

  /* ---- 字体 ---- */
  --serif:     'Times New Roman', 'Songti SC', 'STSong', 'Songti TC', 'Source Han Serif SC', serif;
  --sans:      'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font:      var(--sans);
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;

  /* ---- 尺寸 ---- */
  --radius: 4px;
  --max-w: 1200px;
  --pad-x: 48px;
  --shadow:   0 4px 16px rgba(28, 24, 20, 0.06), 0 1px 3px rgba(28, 24, 20, 0.04);
  --shadow-l: 0 8px 32px rgba(28, 24, 20, 0.10), 0 2px 6px rgba(28, 24, 20, 0.05);
}

/* ---- 重置 ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  color: var(--text-1);
  background: var(--bg);
  font-feature-settings: 'liga', 'kern';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: opacity 0.3s ease;
  height: 100vh; overflow: hidden;
}
body.leaving { opacity: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ---- 通用页面结构 ---- */
.page { height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }

/* 顶栏 */
.page-hd {
  padding: 28px var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-cn { font-family: var(--serif); font-size: 18px; color: var(--text-1); letter-spacing: 4px; }
.brand-en { font-family: var(--serif); font-size: 10px; color: var(--text-3); letter-spacing: 3px; text-transform: uppercase; font-style: italic; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 6px 12px; font-family: var(--serif); font-size: 13px;
  color: var(--text-2); letter-spacing: 1.5px; border-radius: var(--radius);
  transition: color 0.15s;
}
.nav a:hover { color: var(--text-1); }
.nav a.on { color: var(--accent); }
.nav a.on::after {
  content: ''; display: block; height: 1px; background: var(--accent);
  margin-top: 4px;
}

/* 主体 — 内容多时可内部滚动，滚动条预占空间不左移 */
.page-bd {
  max-width: var(--max-w); width: 100%; margin: 0 auto;
  padding: 60px var(--pad-x) 80px;
  overflow: auto; scrollbar-gutter: stable; min-height: 0;
}

/* 页脚 */
.page-ft {
  padding: 24px var(--pad-x);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
  font-family: var(--serif); font-size: 11px; color: var(--text-3); letter-spacing: 1.5px;
}

/* ---- 标题族 ---- */
.eyebrow { font-family: var(--serif); font-size: 13px; color: var(--text-3); letter-spacing: 4px; text-transform: uppercase; font-style: italic; font-weight: 500; }
.title-display { font-family: var(--serif); font-size: 48px; line-height: 1.1; font-weight: 500; color: var(--text-1); letter-spacing: -0.5px; }
.title-display em { font-style: italic; color: var(--accent); font-weight: 500; }
.title-section { font-family: var(--serif); font-size: 22px; color: var(--text-1); letter-spacing: 2px; font-weight: 500; }
.title-section em { font-style: italic; color: var(--accent); font-weight: 500; }
.rule { width: 48px; height: 1px; background: var(--text-3); margin: 16px 0; }

/* ---- 通用 panel：白底 + 软阴影 + 无边框 ---- */
.panel {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.panel-hd {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-family: var(--serif); font-size: 18px; color: var(--text-1); letter-spacing: 1.5px; font-weight: 500; }
.panel-meta { font-family: var(--serif); font-size: 12px; color: var(--text-3); letter-spacing: 2px; font-style: italic; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; font-family: var(--serif); font-size: 14px; letter-spacing: 1.5px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(28, 24, 20, 0.04);
  transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(138, 106, 58, 0.25); }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { color: var(--text-1); }

/* ---- 表单字段 ---- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--serif); font-size: 12px; color: var(--text-2); letter-spacing: 2px; text-transform: uppercase; font-weight: 500; }

.input, .select {
  padding: 8px 0; font-size: 16px; color: var(--text-1);
  background: transparent; border: none;
  border-bottom: 1px solid var(--border-2);
  border-radius: 0; outline: none;
  transition: border-color 0.2s;
  min-width: 160px;
}
.input::placeholder, .select::placeholder { color: var(--text-3); font-style: italic; }
.input:focus, .select:focus { border-bottom-color: var(--accent); }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a928a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 4px center; padding-right: 32px;
}
.select option { background: var(--surface); color: var(--text-1); }

/* ---- 表格 ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 14px 16px; text-align: left; font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.tbl th {
  font-family: var(--serif); font-weight: 500; color: var(--text-3); font-size: 12px;
  text-transform: uppercase; letter-spacing: 2px;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--serif); }

/* ---- 消息条 ---- */
.msg { display: none; align-items: center; gap: 8px; font-family: var(--serif); font-size: 13px; color: var(--text-2); letter-spacing: 1px; }
.msg.on { display: inline-flex; }
.msg.ok { color: var(--success); }
.msg.err { color: var(--danger); }

/* ---- 用户信息/退出 (杂志风身份卡) ---- */
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(28, 24, 20, 0.04);
  font-family: var(--serif);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.user-info:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(138, 106, 58, 0.12); }

.user-avatar {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
  flex-shrink: 0;
}

.user-text {
  display: flex; flex-direction: column;
  line-height: 1.15;
}
.user-role {
  font-size: 9px; color: var(--text-3);
  letter-spacing: 2px; text-transform: uppercase;
  font-weight: 500;
}
.user-name {
  font-size: 13px; color: var(--text-1);
  font-weight: 500; letter-spacing: 0.5px;
}

.user-divider {
  width: 1px; height: 16px;
  background: var(--border-2);
  margin: 0 4px;
}

.user-logout {
  font-size: 12px; color: var(--text-3);
  cursor: pointer; letter-spacing: 1.5px;
  padding: 0 4px;
  transition: color 0.15s;
}
.user-logout:hover { color: var(--danger); }

/* ---- 工具 ---- */
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.between { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.empty { padding: 48px 0; text-align: center; color: var(--text-3); font-size: 14px; font-family: var(--serif); font-style: italic; }

/* ---- 入场动画 ---- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---- 滚动条（杂志风细线条） ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
