/* ============================================================
   墨名堂「一缕蚕丝」中式古典美学样式
   配色：墨黑/黛青/月白/朱砂/鎏金
   ============================================================ */
:root {
  --ink: #2B2B2B;        /* 墨黑 */
  --ink-soft: #4A4A4A;
  --qing: #4A5D6B;       /* 黛青 */
  --qing-deep: #35464F;
  --moon: #F5F3EE;       /* 月白 */
  --moon-2: #EDE9E0;
  --zhu: #B03A2E;        /* 朱砂 */
  --zhu-deep: #8E2B22;
  --gold: #C9A86A;       /* 鎏金 */
  --gold-soft: #E5D5B4;
  --line: #D8D2C6;       /* 细线 */
  --paper: #FBF9F4;
}

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

body {
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  background: var(--moon);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--qing); text-decoration: none; }
a:hover { color: var(--zhu); }

/* ---------- 顶部 ---------- */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 2rem;
  display: flex; align-items: baseline; gap: 2rem;
  flex-wrap: wrap;
}
.brand { font-size: 1.35rem; letter-spacing: 0.2em; color: var(--ink); font-weight: 700; }
.brand small { font-size: 0.75rem; color: var(--gold); letter-spacing: 0.4em; margin-left: 0.5rem; }
.topbar nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.topbar nav a { padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.topbar nav a.active, .topbar nav a:hover { border-color: var(--zhu); color: var(--zhu); }
.topbar .right { margin-left: auto; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- 主容器 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-title {
  font-size: 1.3rem; letter-spacing: 0.25em; color: var(--ink);
  padding-bottom: 0.6rem; margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--zhu);
  position: relative;
}
.page-title::after {
  content: "◆"; color: var(--gold); font-size: 0.7rem;
  position: absolute; right: 0; bottom: -0.45rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 3px rgba(43,43,43,0.04);
}
.card-title { font-size: 1rem; letter-spacing: 0.15em; color: var(--qing-deep); margin-bottom: 0.8rem; }

/* 回纹装饰角 */
.card { position: relative; }
.card::before, .card::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--gold); opacity: 0.55;
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---------- 丝线数字 ---------- */
.balance { display: flex; gap: 2rem; flex-wrap: wrap; }
.balance-item { text-align: center; }
.balance-item .num {
  font-size: 2rem; color: var(--zhu); font-weight: 700;
  letter-spacing: 0.05em;
}
.balance-item .num small { font-size: 1rem; color: var(--gold); }
.balance-item .label { font-size: 0.8rem; color: var(--ink-soft); letter-spacing: 0.2em; margin-top: 0.2rem; }

/* ---------- 印章式按钮 ---------- */
.btn {
  display: inline-block; padding: 0.45rem 1.3rem;
  border: 1px solid var(--zhu); color: var(--zhu);
  background: transparent; font-family: inherit; font-size: 0.9rem;
  letter-spacing: 0.15em; cursor: pointer; border-radius: 2px;
  transition: all 0.25s;
}
.btn:hover { background: var(--zhu); color: #fff; }
.btn-primary { background: var(--zhu); color: #fff; }
.btn-primary:hover { background: var(--zhu-deep); }
.btn-ghost { border-color: var(--qing); color: var(--qing); }
.btn-ghost:hover { background: var(--qing); color: #fff; }
.btn-danger { border-color: #8E2B22; color: #8E2B22; }
.btn-danger:hover { background: #8E2B22; color: #fff; }
.btn-sm { padding: 0.25rem 0.8rem; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.35rem; letter-spacing: 0.1em; }
.input, select, textarea {
  width: 100%; padding: 0.55rem 0.8rem;
  border: 1px solid var(--line); border-radius: 2px;
  background: #fff; font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--zhu); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; padding: 0.6rem 0.8rem; color: var(--ink-soft);
  border-bottom: 2px solid var(--gold); letter-spacing: 0.1em; font-weight: 600;
  white-space: nowrap;
}
.table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); }
.table tr:hover td { background: var(--moon-2); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 0.15rem 0.7rem; font-size: 0.78rem;
  border: 1px solid var(--gold); color: var(--qing-deep);
  border-radius: 999px; letter-spacing: 0.1em;
}
.badge-tier { background: var(--gold-soft); color: var(--ink); border-color: var(--gold); }
.badge-zhu { background: var(--zhu); color: #fff; border-color: var(--zhu); }
.badge-mute { border-color: var(--line); color: var(--ink-soft); }

/* ---------- 提示 ---------- */
.flash { max-width: 1080px; margin: 1rem auto 0; padding: 0 1.5rem; }
.flash div { padding: 0.6rem 1rem; margin-bottom: 0.4rem; font-size: 0.9rem; border-radius: 2px; }
.flash .ok { background: #F0F5EF; color: #4A6B4A; border: 1px solid #BCD3BC; }
.flash .error { background: #FBEFEE; color: #8E2B22; border: 1px solid #E5C6C2; }
.flash .warn { background: #FBF5E8; color: #8A6D2F; border: 1px solid #E8D5A8; }

/* ---------- 等级徽章 ---------- */
.tier-card { display: inline-block; padding: 0.5rem 1.2rem; text-align: center;
  border: 1px solid var(--line); background: var(--paper); margin: 0.3rem; }
.tier-card .name { font-size: 1.1rem; letter-spacing: 0.2em; }
.tier-card .org { font-size: 0.75rem; color: var(--gold); letter-spacing: 0.3em; }
.tier-card.current { border-color: var(--zhu); box-shadow: 0 0 0 1px var(--zhu); }
.tier-card.current .name { color: var(--zhu); }

/* 进度条 */
.progress { height: 6px; background: var(--moon-2); border-radius: 3px; overflow: hidden; margin: 0.6rem 0; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--zhu)); }

/* ---------- 布局辅助 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.muted { color: var(--ink-soft); font-size: 0.85rem; }
.center { text-align: center; }
.mt-1 { margin-top: 0.6rem; } .mt-2 { margin-top: 1.2rem; }
.flex { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* 竖排点缀 */
.vertical {
  writing-mode: vertical-rl; letter-spacing: 0.5em; color: var(--gold);
  font-size: 0.7rem; opacity: 0.7;
}

/* 登录/注册页 */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, var(--moon) 0%, var(--moon-2) 100%); }
.auth-card { width: 400px; max-width: 92vw; background: var(--paper);
  border: 1px solid var(--line); padding: 2.5rem 2.2rem; position: relative; }
.auth-card::before, .auth-card::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 1px solid var(--gold); opacity: 0.7;
}
.auth-card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.auth-card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.auth-logo { text-align: center; margin-bottom: 1.2rem; }
.auth-logo .t { font-size: 1.6rem; letter-spacing: 0.3em; color: var(--ink); }
.auth-logo .s { font-size: 0.75rem; letter-spacing: 0.5em; color: var(--gold); margin-top: 0.3rem; }

/* 悦喜大陆 · 蚕丛城 世界观叙事 */
.world-brand { position: fixed; top: 1.6rem; left: 0; right: 0; text-align: center;
  z-index: 5; pointer-events: none; }
.world-line { display: inline-block; font-size: 0.7rem; letter-spacing: 0.55em;
  color: var(--gold); opacity: 0.85; padding: 0.3rem 1.2rem;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  opacity: 0.7; }
.world-tagline { text-align: center; font-size: 0.68rem; letter-spacing: 0.18em;
  color: var(--qing-deep); opacity: 0.85; margin: -0.6rem 0 1.4rem;
  line-height: 1.9; }
.auth-logo { margin-bottom: 1.8rem; }

/* 印章 */
.stamp {
  display: inline-block; border: 2px solid var(--zhu); color: var(--zhu);
  padding: 0.3rem 0.9rem; font-size: 0.85rem; letter-spacing: 0.2em;
  transform: rotate(-2deg); border-radius: 2px; opacity: 0.9;
}

/* 后台侧栏 */
.admin-body { display: flex; min-height: 100vh; }
.admin-side { width: 190px; background: var(--qing-deep); color: #EDE9E0; padding: 1.5rem 0; }
.admin-side .logo { padding: 0 1.2rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.2em; font-size: 1.05rem; margin-bottom: 0.8rem; }
.admin-side a { display: block; padding: 0.55rem 1.2rem; color: #C9C4B8; font-size: 0.9rem; }
.admin-side a:hover, .admin-side a.active { background: rgba(255,255,255,0.08); color: #fff; border-left: 3px solid var(--gold); }
.admin-main { flex: 1; padding: 1.8rem 2rem; }
.admin-top { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; margin-bottom: 1.5rem; }

/* ===== 蚕丛城 · 2.8D 城邦地图（首页） ===== */
.city-hud .balance { margin-bottom: 0.4rem; }
.city-frame { padding: 0.6rem 0.4rem; background: linear-gradient(180deg, #eef2f4, #dfe6e2);
  border-radius: 12px; }
.city-svg { width: 100%; height: auto; display: block; }
.city-svg .bldg { transition: opacity .25s, filter .25s; }
.city-svg .bldg:hover { filter: brightness(1.08); }
.city-svg .bldg.locked { opacity: .62; }
.city-svg .bldg.locked:hover { opacity: .85; }
.city-svg .bldg.soon { opacity: .8; }
.city-links { margin-top: 0.8rem; }
.city-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.5rem; }
.city-link-grid a { display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.9rem; background: #faf7f1; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 0.86rem; text-decoration: none; }
.city-link-grid a:hover { border-color: var(--gold); background: #f7f2e6; }
.city-link-grid .badge { font-size: 0.68rem; }
@media (max-width: 640px) {
  .city-frame { overflow-x: auto; }
  .city-svg { min-width: 640px; }
}

/* ===== 登录页 · 拨云见日动效 ===== */
.cloud-stage { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.cloud { position: absolute; background: radial-gradient(ellipse at center,
  rgba(255,255,255,.92), rgba(255,255,255,0)); filter: blur(14px); border-radius: 50%; }
.cloud-1 { width: 900px; height: 260px; left: -200px; top: -60px; animation: cloud-drift 13s ease-in-out infinite; }
.cloud-2 { width: 760px; height: 220px; right: -160px; top: 40px; animation: cloud-drift 17s ease-in-out infinite reverse; }
.cloud-3 { width: 620px; height: 200px; left: 12%; bottom: -70px; animation: cloud-drift 21s ease-in-out infinite; }
.cloud-4 { width: 480px; height: 160px; right: 6%; bottom: -40px; animation: cloud-drift 15s ease-in-out infinite reverse; }
@keyframes cloud-drift {
  0%,100% { transform: translateX(0) scale(1); opacity: .55; }
  50% { transform: translateX(46px) scale(1.08); opacity: .75; }
}
.sunbeam { position: absolute; top: -12%; left: 50%; transform: translateX(-50%) rotate(0deg);
  width: 320px; height: 130%; background: linear-gradient(180deg,
    rgba(255,236,190,.55), rgba(255,236,190,0) 68%); clip-path: polygon(42% 0, 58% 0, 88% 100%, 12% 100%);
  animation: beam 6s ease-in-out infinite; }
@keyframes beam { 0%,100% { opacity: .5; } 50% { opacity: .85; } }
.city-silhouette { position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(180deg, rgba(74,93,107,0) 0%, rgba(74,93,107,.18) 30%, rgba(43,43,43,.38) 100%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%); }
.auth-stage { position: relative; z-index: 1;
  animation: rise-in .9s cubic-bezier(.22,.9,.35,1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
.auth-card-reveal { animation: fade-in 1.1s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== 墨名堂·巡查使司 · 工作台 ===== */
.sisi-banner { position: relative; border-radius: 10px; overflow: hidden;
  margin-bottom: 1rem; border: 1px solid var(--line); height: 220px;
  box-shadow: 0 6px 20px rgba(43,43,43,.16); animation: rise-in .8s ease both; }
.sisi-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%;
  display: block; }
.sisi-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(43,43,43,.55) 0%, rgba(43,43,43,.18) 46%, rgba(43,43,43,0) 78%); }
.sisi-title { position: absolute; left: 1.6rem; top: 50%; transform: translateY(-50%);
  color: #f5f3ee; max-width: 60%; }
.sisi-title h1 { margin: 0 0 .25rem; font-size: 1.5rem; letter-spacing: .14em;
  color: #f5f3ee; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.sisi-sub { margin: 0; font-size: .82rem; color: #c9a86a; letter-spacing: .1em; }
.sisi-sub span { color: #f5f3ee; }

.si-card { margin-bottom: 1rem; }
.si-card.si-todo { padding: 0.6rem 0.8rem; }
.si-head { font-size: .85rem; color: var(--qing-deep); letter-spacing: .14em;
  border-bottom: 1px dashed var(--line); padding-bottom: .5rem; margin-bottom: .5rem; }
.si-todos { display: flex; flex-direction: column; gap: 2px; }
.si-todo-row { display: grid; grid-template-columns: 22px 1fr auto; gap: .4rem;
  align-items: center; padding: .52rem .6rem; border-radius: 6px; color: var(--ink);
  font-size: .85rem; text-decoration: none; transition: background .18s; }
.si-todo-row:hover { background: #faf3e2; }
.si-todo-ico { font-size: 1rem; text-align: center; }
.si-todo-name { color: var(--ink); letter-spacing: .04em; }
.si-todo-n { font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--zhu); min-width: 1.6rem; text-align: right; }

.si-num { font-size: 1.8rem; color: var(--zhu); font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.1; }
.muted { color: #8a8f95; font-size: .76rem; margin-top: .15rem; }

/* ===== 飞入交错 ===== */
.sisi-stagger > .si-card.si-rise {
  opacity: 0; transform: translateY(14px);
  animation: rise-kf .55s cubic-bezier(.22,.9,.35,1) both;
}
.sisi-stagger > .si-rise:nth-child(1) { animation-delay: .15s; }
.sisi-stagger > .si-rise:nth-child(2) { animation-delay: .20s; }
.sisi-stagger > .si-rise:nth-child(3) { animation-delay: .25s; }
.sisi-stagger > .si-rise:nth-child(4) { animation-delay: .30s; }
.sisi-stagger > .si-rise:nth-child(5) { animation-delay: .35s; }
.sisi-stagger > .si-rise:nth-child(6) { animation-delay: .40s; }
.sisi-stagger > .si-rise:nth-child(7) { animation-delay: .45s; }
@keyframes rise-kf { to { opacity: 1; transform: translateY(0); } }

/* ===== 后台侧栏横向滚动防御 ===== */
.admin-body { min-height: 100vh; }
@media (max-width: 720px) {
  .sisi-banner { height: 160px; }
  .sisi-title h1 { font-size: 1.15rem; }
  .sisi-title { max-width: 70%; }
}

/* ===== 登录页 · 计划欢迎文案 ===== */
.auth-welcome { text-align: center; margin: -1rem 0 1.1rem; }
.auth-welcome .auth-plan { margin: 0 0 .45rem; font-size: 1.12rem; letter-spacing: .14em;
  color: var(--qing-deep); font-weight: 600; }
.auth-welcome .auth-welcome-text { margin: 0 auto; max-width: 330px;
  font-size: .78rem; line-height: 1.95; color: var(--ink); opacity: .85;
  letter-spacing: .03em; }

/* ===== 长效积分专属页 ===== */
.long-balance-card { text-align: center; padding: 1.4rem 1rem; }
.long-balance-label { font-size: .82rem; color: var(--qing-deep); letter-spacing: .14em; }
.long-balance-num { font-size: 2.6rem; color: var(--gold); font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.2; margin: .2rem 0; }
.gray-num { color: #9a9aa0; }   /* 待确认缕数灰色展示 */

/* ===== 绑定特别申明 ===== */
.bind-notice { font-size: .82rem; line-height: 2; color: var(--qing-deep);
  background: #f6f1e4; border: 1px dashed var(--gold); border-radius: 8px;
  padding: .7rem 1rem; margin-top: .7rem; letter-spacing: .02em; }

/* ===== ICP 备案号页脚 ===== */
.icp-record { color: var(--ink-soft, #8a8a90); text-decoration: none; letter-spacing: .05em; }
.icp-record:hover { color: var(--gold); text-decoration: underline; }
