/* ============================================================
   密邮·邮务后台 —— 设计系统 v2「见字如面」
   邮政意象:火漆印 / 邮票 / 邮戳 / 信纸横线
   米白暖纸 + 密邮紫粉渐变 + 氛围光 + 衬线大字
   ============================================================ */

:root {
  --paper: #f7f3eb;
  --paper-line: rgba(124, 92, 191, 0.05);
  --card: #ffffff;
  --ink: #332a4d;
  --ink-2: #6e6787;
  --ink-3: #a89fbd;
  --line: #ece5da;
  --purple: #7c5cbf;
  --purple-deep: #5b3fa3;
  --purple-soft: #f1ebfb;
  --pink: #e77fa8;
  --gold: #c9a86a;
  --green: #3e9b6e;
  --red: #d05454;
  --orange: #d98a3d;
  --grad: linear-gradient(135deg, #8f6cf0 0%, #e77fc6 100%);
  --grad-deep: linear-gradient(135deg, #7c5cbf 0%, #5b3fa3 100%);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(51, 42, 77, 0.04), 0 10px 30px -10px rgba(91, 63, 163, 0.14);
  --shadow-hover: 0 2px 6px rgba(51, 42, 77, 0.06), 0 20px 44px -12px rgba(91, 63, 163, 0.26);
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 88% -8%, rgba(143, 108, 240, 0.09), transparent 62%),
    radial-gradient(900px 420px at -6% 108%, rgba(231, 127, 198, 0.07), transparent 60%),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px),
    var(--paper);
  min-height: 100vh;
  line-height: 1.65;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-deep); }

::selection { background: rgba(143, 108, 240, 0.24); }

/* 页面内容错落入场 */
.content > * { animation: rise-in 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.content > *:nth-child(2) { animation-delay: 0.05s; }
.content > *:nth-child(3) { animation-delay: 0.1s; }
.content > *:nth-child(4) { animation-delay: 0.15s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 布局骨架 ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background:
    radial-gradient(340px 200px at 100% 0%, rgba(231, 127, 198, 0.16), transparent 70%),
    linear-gradient(172deg, #3d2c66 0%, #2e2354 52%, #251c48 100%);
  color: #cfc6e8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* 侧栏底部的大信封水印 */
.sidebar::after {
  content: "✉";
  position: absolute;
  bottom: 46px; right: -26px;
  font-size: 150px;
  color: rgba(255, 255, 255, 0.035);
  transform: rotate(-14deg);
  pointer-events: none;
}

.brand { padding: 30px 24px 24px; }

.brand-mark { display: flex; align-items: center; gap: 13px; }

/* 火漆印 logo */
.brand-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 0 0 5px rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(143, 108, 240, 0.5);
}

.brand-name {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: #fff; letter-spacing: 6px; line-height: 1.2;
}
.brand-sub { font-size: 0.68rem; color: #a89ecf; letter-spacing: 4px; margin-top: 4px; }

.brand-divider {
  margin: 22px 24px 0;
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.nav { padding: 18px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }

.nav-caption { font-size: 0.66rem; letter-spacing: 3px; color: #8478ab; padding: 0 14px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: #bfb5dd; font-size: 0.92rem;
  transition: all 0.18s;
  border: 1px solid transparent;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; transform: translateX(2px); }

.nav-item.active {
  background: linear-gradient(95deg, rgba(143, 108, 240, 0.9), rgba(143, 108, 240, 0.5));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px -4px rgba(143, 108, 240, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.nav-item .nav-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.07);
}
.nav-item.active .nav-icon { background: rgba(255, 255, 255, 0.18); }

.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #f093b0, #e0559c);
  color: #fff; font-size: 0.68rem; line-height: 1;
  padding: 4px 8px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(224, 85, 156, 0.5);
}

.sidebar-foot {
  padding: 18px 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.74rem; color: #8d81b5; line-height: 1.9;
  position: relative; z-index: 1;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px 36px 20px;
}

.page-title {
  font-family: var(--serif); font-size: 1.85rem; font-weight: 600;
  letter-spacing: 3px; line-height: 1.3;
}
.page-title small {
  display: block; font-family: var(--sans); font-size: 0.78rem;
  color: var(--ink-3); letter-spacing: 1px; margin-top: 5px; font-weight: 400;
}

.admin-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 18px 6px 6px;
  box-shadow: var(--shadow); font-size: 0.85rem; color: var(--ink-2);
}

.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-family: var(--serif);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}

.content { padding: 6px 36px 56px; max-width: 1280px; width: 100%; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}

.card-hover:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #ddd0f0; }

.card-title {
  font-family: var(--serif); font-size: 1.06rem; font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}

.card-title::before {
  content: ""; width: 5px; height: 17px; border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 2px 6px rgba(143, 108, 240, 0.4);
}

/* ---------- 看板问候横幅 ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(500px 260px at 88% -30%, rgba(255, 255, 255, 0.22), transparent 65%),
    linear-gradient(118deg, #6d4fae 0%, #8f6cf0 46%, #d97cc0 100%);
  color: #fff;
  padding: 30px 36px;
  margin-bottom: 20px;
  box-shadow: 0 18px 44px -14px rgba(109, 79, 174, 0.55);
}

.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(100deg, transparent 40%, #000 100%);
  pointer-events: none;
}

.hero-title {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 600;
  letter-spacing: 4px; margin-bottom: 6px;
}
.hero-sub { font-size: 0.85rem; opacity: 0.85; letter-spacing: 1px; }
.hero-date { font-size: 0.74rem; opacity: 0.7; letter-spacing: 2px; margin-top: 12px; font-family: ui-monospace, monospace; }

/* 右侧火漆印 */
.hero-seal {
  position: absolute; right: 40px; top: 50%;
  transform: translateY(-50%) rotate(10deg);
  width: 108px; height: 108px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.35), rgba(255,255,255,0.06) 60%);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--serif); letter-spacing: 3px;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.08);
}
.hero-seal b { font-size: 1.3rem; font-weight: 600; }
.hero-seal span { font-size: 0.62rem; opacity: 0.8; letter-spacing: 2px; margin-top: 4px; }

/* ---------- 统计卡片(邮票风) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}

.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

/* 底部渐变发丝线 */
.stat-card::after {
  content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--grad); opacity: 0.55;
}

/* 右上角邮票章 */
.stat-stamp {
  position: absolute; top: 16px; right: 16px;
  width: 42px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  background: linear-gradient(150deg, #f6f0ff, #fbeef5);
  border-radius: 6px;
  transform: rotate(6deg);
  box-shadow: 0 3px 8px rgba(143, 108, 240, 0.18);
  /* 邮票齿孔边 */
  -webkit-mask: radial-gradient(circle 3px, transparent 96%, #000) -3px -3px / 12px 12px;
  mask: radial-gradient(circle 3px, transparent 96%, #000) -3px -3px / 12px 12px;
  border: 1px dashed rgba(143, 108, 240, 0.4);
}

.stat-label { font-size: 0.78rem; color: var(--ink-2); letter-spacing: 1px; }
.stat-value {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 600;
  line-height: 1.05; color: var(--ink); letter-spacing: 1px;
}
.stat-value .unit { font-size: 0.8rem; color: var(--ink-3); margin-left: 4px; font-family: var(--sans); }
.stat-foot { font-size: 0.73rem; color: var(--ink-3); }
.stat-value.accent-p { color: var(--purple); }
.stat-value.accent-g { color: var(--green); }
.stat-value.accent-r { color: var(--red); }

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

table.data th {
  text-align: left; font-weight: 500; color: var(--ink-3);
  font-size: 0.72rem; letter-spacing: 2px;
  padding: 10px 14px; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}

table.data td { padding: 14px; border-bottom: 1px solid #f4efe6; vertical-align: middle; }

table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: linear-gradient(90deg, #faf6ff, #fff7fb); }

.cell-title { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 0.72rem; color: var(--ink-3); margin-top: 3px; font-family: ui-monospace, monospace; letter-spacing: 0.5px; }

/* ---------- 徽标 ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.73rem; padding: 3px 11px; border-radius: 999px;
  white-space: nowrap; line-height: 1.6; letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-posted  { background: #e9f5ef; color: var(--green); border-color: #d6ecdf; }
.badge-draft   { background: #f2efe9; color: var(--ink-2); border-color: #e8e2d8; }
.badge-deleted { background: #fdf1e3; color: var(--orange); border-color: #f5e3cb; }
.badge-purged  { background: #ececf0; color: var(--ink-3); border-color: #e0e0e6; }
.badge-taken   { background: #fbeaea; color: var(--red); border-color: #f3d5d5; }
.badge-purple  { background: var(--purple-soft); color: var(--purple); border-color: #e4d9f6; }
.badge-pink    { background: #fceaf2; color: var(--pink); border-color: #f6d8e6; }
.badge-gold    { background: #f8f1e3; color: var(--gold); border-color: #efe2c8; }
.badge-grey    { background: #f2efe9; color: var(--ink-2); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; padding: 9px 18px;
  border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; font-family: var(--sans);
  transition: all 0.18s; white-space: nowrap; letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--grad-deep);
  color: #fff;
  box-shadow: 0 4px 14px -3px rgba(124, 92, 191, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(124, 92, 191, 0.6); }
.btn-primary:active { transform: none; }

.btn-danger { background: #fbeaea; color: var(--red); border-color: #f2d2d2; }
.btn-danger:hover { background: var(--red); color: #fff; box-shadow: 0 6px 16px -4px rgba(208, 84, 84, 0.5); }

.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { color: var(--purple); border-color: #cdb8ec; background: #fbf8ff; }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 9px; }

/* ---------- 表单 ---------- */

.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.input, .select {
  font-family: var(--sans); font-size: 0.88rem; color: var(--ink);
  background: #fdfcf9; border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 14px;
  outline: none; transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}

.input:focus, .select:focus {
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(143, 108, 240, 0.13);
}

.input::placeholder { color: var(--ink-3); }

label.form-label { font-size: 0.82rem; color: var(--ink-2); display: block; margin-bottom: 5px; }

/* ---------- 时间线 ---------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #cdb8ec, #f0e6d8);
  border-radius: 1px;
}

.tl-item { position: relative; padding: 7px 0 7px 14px; font-size: 0.85rem; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--purple);
  box-shadow: 0 0 0 3px rgba(143, 108, 240, 0.12);
}
.tl-item.admin-event::before { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(231, 127, 168, 0.15); }
.tl-time { color: var(--ink-3); font-size: 0.73rem; font-family: ui-monospace, monospace; margin-right: 10px; letter-spacing: 0.5px; }
.tl-event { font-weight: 500; }
.tl-extra { color: var(--ink-2); font-size: 0.78rem; margin: 2px 0 0; }

/* ---------- 闪讯 ---------- */

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 13px; margin-bottom: 20px;
  font-size: 0.88rem; border: 1px solid;
  animation: flash-in 0.3s ease;
  box-shadow: var(--shadow);
}

.flash-success { background: #eef7f2; border-color: #cde8d9; color: #267350; }
.flash-error { background: #fdeeee; border-color: #f3d0d0; color: #a83a3a; }

@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 分页 ---------- */

.pagination { display: flex; gap: 6px; list-style: none; margin-top: 20px; flex-wrap: wrap; }
.pagination li a, .pagination li span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); font-size: 0.84rem;
  transition: all 0.15s;
}
.pagination li a:hover { border-color: #cdb8ec; color: var(--purple); }
.pagination li.active span {
  background: var(--grad-deep);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 10px -2px rgba(124, 92, 191, 0.5);
}
.pagination li.disabled span { opacity: 0.4; }

/* ---------- 登录页(左右分屏 · 骑车送信场景) ---------- */

.login-split { display: flex; min-height: 100vh; }

/* 左:动画场景 */
.login-scene {
  flex: 1; position: relative; overflow: hidden;
  min-height: 100vh;
}

.login-scene svg.scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

.scene-brand {
  position: absolute; top: 44px; left: 48px; z-index: 2;
}
.scene-brand h1 {
  font-family: var(--serif); font-size: 2.6rem; font-weight: 600;
  letter-spacing: 16px; color: #4a3572;
}
.scene-brand p { font-size: 0.78rem; letter-spacing: 5px; color: #8a72b5; margin-top: 8px; }

.scene-quote {
  position: absolute; bottom: 40px; left: 48px; z-index: 2;
  font-family: var(--serif); font-size: 0.95rem; letter-spacing: 3px;
  color: #7a5f9e;
}
.scene-quote small { display: block; font-family: var(--sans); font-size: 0.66rem; letter-spacing: 2px; color: #a08cc0; margin-top: 6px; }

/* 右:登录面板 */
.login-panel {
  width: 470px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px),
    var(--paper);
  border-left: 1px solid var(--line);
  position: relative;
}

.login-card {
  width: 100%; max-width: 360px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px -18px rgba(91, 63, 163, 0.28);
  padding: 50px 34px 32px;
  position: relative;
  animation: rise-in 0.6s 0.1s both;
}

.login-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--grad);
}

/* 顶部骑缝火漆印 */
.login-seal {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%) rotate(-8deg);
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--grad);
  border: 3px solid var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 23px;
  box-shadow: 0 10px 26px -6px rgba(143, 108, 240, 0.6), inset 0 0 0 4px rgba(255, 255, 255, 0.22);
}

.login-title { font-family: var(--serif); font-size: 1.25rem; letter-spacing: 4px; text-align: center; margin-bottom: 4px; }
.login-sub { color: var(--ink-3); font-size: 0.68rem; margin-bottom: 26px; letter-spacing: 2px; text-align: center; }

.login-card .input { width: 100%; padding: 12px 16px; margin-bottom: 14px; background: #fdfcf9; }

.login-error {
  background: #fdeeee; color: #a83a3a; border: 1px solid #f3d0d0;
  border-radius: 10px; padding: 9px 14px; font-size: 0.82rem; margin-bottom: 14px;
}

.login-foot { text-align: center; margin-top: 28px; font-size: 0.68rem; letter-spacing: 3px; color: var(--ink-3); }

/* 窄屏:场景变顶部横幅 */
@media (max-width: 900px) {
  .login-split { flex-direction: column; }
  .login-scene { min-height: 250px; max-height: 250px; flex: none; }
  .scene-brand { top: 22px; left: 24px; }
  .scene-brand h1 { font-size: 1.7rem; letter-spacing: 10px; }
  .scene-brand p { font-size: 0.66rem; letter-spacing: 3px; }
  .scene-quote { display: none; }
  .login-panel { width: 100%; border-left: none; padding: 44px 24px; flex: 1; }
}

/* ---------- 两栏/网格 ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-31 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.grid-13 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; align-items: start; }

@media (max-width: 980px) {
  .grid-2, .grid-31, .grid-13 { grid-template-columns: 1fr; }
  .hero-seal { display: none; }
}

/* ---------- 名额进度条 ---------- */

.quota-bar { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.quota-track { flex: 1; height: 7px; border-radius: 4px; background: #f0ebe1; overflow: hidden; }
.quota-fill { height: 100%; border-radius: 4px; background: var(--grad); }
.quota-fill.full { background: linear-gradient(90deg, #d05454, #e97fa8); }
.quota-text { font-size: 0.76rem; color: var(--ink-2); white-space: nowrap; font-family: ui-monospace, monospace; }

/* ---------- 信件详情 ---------- */

.letter-paper {
  position: relative;
  background:
    repeating-linear-gradient(to bottom, transparent 0 33px, rgba(124, 92, 191, 0.08) 33px 34px),
    linear-gradient(180deg, #fffdf8, #fffcf5);
  border: 1px solid #ece2cf; border-radius: 14px;
  padding: 30px 34px; min-height: 200px;
  font-size: 0.96rem; line-height: 34px;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px -6px rgba(201, 168, 106, 0.25);
}

/* 信纸左上角邮戳 */
.letter-postmark {
  position: absolute; top: 14px; right: 18px;
  width: 66px; height: 66px; border-radius: 50%;
  border: 1.5px solid rgba(201, 168, 106, 0.55);
  outline: 1px dashed rgba(201, 168, 106, 0.4); outline-offset: 3px;
  color: var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.56rem; text-align: center; line-height: 1.5;
  transform: rotate(14deg);
  pointer-events: none;
  background: rgba(255, 253, 248, 0.7);
}

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.meta-item {
  background: linear-gradient(160deg, #fcf9f3, #faf7f0);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  transition: border-color 0.15s;
}
.meta-item:hover { border-color: #ddd0f0; }
.meta-key { font-size: 0.7rem; color: var(--ink-3); letter-spacing: 1px; }
.meta-val { font-size: 0.92rem; font-weight: 500; margin-top: 3px; word-break: break-all; }

/* ---------- 弹窗 ---------- */

.modal-mask {
  position: fixed; inset: 0; background: rgba(37, 28, 72, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-box {
  width: 430px; max-width: calc(100vw - 40px);
  background: var(--card); border-radius: 20px; padding: 30px;
  box-shadow: 0 30px 80px -14px rgba(37, 28, 72, 0.5);
  animation: flash-in 0.22s ease;
  border-top: 4px solid;
  border-image: linear-gradient(90deg, #8f6cf0, #e77fc6) 1;
}

.modal-title { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 1px; margin-bottom: 10px; }
.modal-body { color: var(--ink-2); font-size: 0.88rem; margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 杂项 ---------- */

.empty-state { text-align: center; color: var(--ink-3); padding: 44px 0; font-size: 0.88rem; letter-spacing: 1px; }
.muted { color: var(--ink-3); font-size: 0.78rem; }
.mono { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.8rem; }
.mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
  font-size: 0.76rem; font-weight: 600;
  box-shadow: inset 0 0 0 1px #e4d9f6;
}

.rank-badge.top1 { background: linear-gradient(135deg, #f6d789, #e0a83c); color: #fff; box-shadow: 0 3px 8px rgba(224, 168, 60, 0.4); }
.rank-badge.top2 { background: linear-gradient(135deg, #d7d9e3, #a9adc0); color: #fff; }
.rank-badge.top3 { background: linear-gradient(135deg, #e8b48c, #c98652); color: #fff; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 0 10px; }
  .sidebar::after { display: none; }
  .brand { padding: 12px 10px; }
  .brand-name { font-size: 1.1rem; letter-spacing: 3px; }
  .brand-sub, .brand-divider, .nav-caption { display: none; }
  .nav { flex-direction: row; padding: 0; overflow-x: auto; }
  .nav-item .nav-icon { display: none; }
  .sidebar-foot { display: none; }
  .content { padding: 6px 16px 44px; }
  .topbar { padding: 20px 16px 12px; }
  .page-title { font-size: 1.5rem; }
}

/* ---------- 自定义确认弹框(替代原生 confirm,统一邮务视觉) ---------- */

body.cfm-lock { overflow: hidden; }

.cfm-mask {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(37, 28, 72, 0.48);
  backdrop-filter: blur(6px);
  animation: cfm-fade 0.18s ease both;
}
.cfm-mask[hidden] { display: none; }

.cfm-box {
  --cfm-a: #7c5cbf;
  --cfm-g: linear-gradient(135deg, #8f6cf0, #e77fc6);
  width: 400px; max-width: calc(100vw - 48px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 30px 26px;
  text-align: center;
  position: relative; overflow: hidden;
  box-shadow: 0 30px 80px -16px rgba(37, 28, 72, 0.5), inset 0 1px 0 #fff;
  animation: cfm-pop 0.24s cubic-bezier(0.22, 0.9, 0.3, 1.15) both;
}
/* 顶部 tone 发丝线 + 角部邮戳点纹 */
.cfm-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--cfm-g);
}
.cfm-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(124, 92, 191, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(220px 140px at 50% 0%, #000, transparent 75%);
}

/* 火漆印图标章 */
.cfm-seal {
  width: 68px; height: 68px; margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--cfm-g);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.9),
    0 0 0 6px var(--cfm-a),
    0 10px 24px -6px var(--cfm-a);
  position: relative; z-index: 1;
}
.cfm-seal::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
}
.cfm-seal-in { color: #fff; font-size: 26px; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.25); }

.cfm-title {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600;
  letter-spacing: 2px; color: var(--ink);
  position: relative; z-index: 1;
}
.cfm-body {
  margin: 10px auto 22px; max-width: 300px;
  color: var(--ink-2); font-size: 0.88rem; line-height: 1.75;
  position: relative; z-index: 1;
}
.cfm-actions { display: flex; justify-content: center; gap: 12px; position: relative; z-index: 1; }
.cfm-actions .btn { min-width: 108px; justify-content: center; }
.cfm-ok { color: #fff; border-color: transparent; }
.cfm-ok-primary { background: var(--grad-deep); box-shadow: 0 4px 14px -3px rgba(124, 92, 191, 0.55); }
.cfm-ok-primary:hover { filter: brightness(1.1); color: #fff; }
.cfm-ok-danger { background: linear-gradient(135deg, #e08080, #d05454); box-shadow: 0 4px 14px -3px rgba(208, 84, 84, 0.55); }
.cfm-ok-danger:hover { filter: brightness(1.08); color: #fff; }
.cfm-ok-warning { background: linear-gradient(135deg, #e8b48c, #d98a3d); box-shadow: 0 4px 14px -3px rgba(217, 138, 61, 0.55); }
.cfm-ok-warning:hover { filter: brightness(1.08); color: #fff; }
.cfm-cancel[hidden] { display: none; }
.cfm-box .btn:focus-visible { outline: 2px solid var(--cfm-a); outline-offset: 2px; }

/* 空选提示轻晃 */
.cfm-nudge { animation: cfm-nudge 0.4s ease; }
@keyframes cfm-nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes cfm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfm-pop { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cfm-mask, .cfm-box, .cfm-nudge { animation: none; }
}

/* ---------- 品牌 logo(邮票齿孔透明 PNG) ---------- */

.brand-logo {
  width: 46px; height: 46px; flex-shrink: 0;
  filter: drop-shadow(0 6px 16px rgba(143, 108, 240, 0.45));
}

/* 登录卡骑缝章位:透明齿孔轮廓直接压在卡缘 */
.login-logo {
  position: absolute; top: -34px; left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  width: 68px; height: 68px;
  filter: drop-shadow(0 10px 22px rgba(143, 108, 240, 0.4));
}

/* ---------- 顶栏右侧:改密入口 + 身份 chip ---------- */

.topbar-right { display: flex; align-items: center; gap: 12px; }

.chip-pwd {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 18px; font-size: 0.8rem; color: var(--ink-2);
  cursor: pointer; box-shadow: var(--shadow);
  transition: all 0.18s; letter-spacing: 1px;
}
.chip-pwd:hover { color: var(--purple); border-color: #d4c6f0; transform: translateY(-1px); }
.chip-pwd:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ---------- 修改密码弹框(复用 cfm 邮务视觉) ---------- */

.pwd-form { margin: 16px auto 0; max-width: 300px; text-align: left; position: relative; z-index: 1; }
.pwd-field { margin-bottom: 12px; }
.pwd-label { display: block; font-size: 0.7rem; letter-spacing: 2px; color: var(--ink-3); margin-bottom: 6px; }
.pwd-input { width: 100%; margin-bottom: 0; background: #fdfcf9; }
.pwd-hint { font-size: 0.68rem; color: var(--ink-3); letter-spacing: 1px; margin: -4px 0 12px; }
.pwd-error {
  background: #fdeeee; color: #a83a3a; border: 1px solid #f3d0d0;
  border-radius: 10px; padding: 8px 12px; font-size: 0.78rem; margin-bottom: 12px;
}
.pwd-error[hidden] { display: none; }
.pwd-form .cfm-actions { margin-top: 18px; }

@media (max-width: 860px) {
  .topbar-right { gap: 8px; }
  .chip-pwd { padding: 7px 12px; font-size: 0.72rem; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .admin-chip span { display: none; }
  .admin-chip { padding: 6px; }
}
