/* ==========================================================================
   盒不扩散条约 · Box Non-Proliferation Treaty
   暗色：机密档案（深墨蓝 + 烫金）／ 亮色：象牙纸档案（米白 + 铜金）
   ========================================================================== */

/* ------------------------------ 主题变量 ------------------------------ */

:root,
[data-theme='dark'] {
  color-scheme: dark;

  --bg: #05080f;
  --bg-glow-1: rgba(201, 162, 39, 0.09);
  --bg-glow-2: rgba(110, 168, 224, 0.06);

  --panel: #0b1220;
  --panel-2: #111b2e;
  --panel-3: #16223a;
  --panel-flat: #0a1120;

  --line: rgba(201, 162, 39, 0.22);
  --line-2: rgba(201, 162, 39, 0.42);
  --line-soft: rgba(201, 162, 39, 0.1);

  --gold: #c9a227;
  --gold-2: #e8c868;
  --seal: #c0392b;

  --ok: #5fd0a8;
  --warn: #e0b95f;
  --info: #6ea8e0;
  --danger: #e0705f;

  --paper: #f2e8d5;
  --text: #e6e2d8;
  --body-soft: #b9b3a6;
  --body-soft-2: #cfcabc;
  --muted: #8c97ab;
  --faint: #5f6a7d;

  --input-bg: #060b15;
  --btn-ink: #1b1405;
  --warm-text: #e8a196;
  --err-text: #f0a89c;

  --cert-a: #0e1728;
  --cert-b: #080d18;
  --checker-a: #0a1120;
  --checker-b: #0c1524;
  --stage: rgba(255, 255, 255, 0.015);
  --grain: 0.5;
  --topbar-bg: rgba(5, 8, 15, 0.88);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #f4efe3;
  --bg-glow-1: rgba(166, 124, 26, 0.1);
  --bg-glow-2: rgba(70, 110, 160, 0.06);

  --panel: #fffdf7;
  --panel-2: #fbf6ea;
  --panel-3: #f3ebda;
  --panel-flat: #fdfaf2;

  --line: rgba(140, 110, 40, 0.26);
  --line-2: rgba(140, 110, 40, 0.5);
  --line-soft: rgba(140, 110, 40, 0.14);

  --gold: #a9821c;
  --gold-2: #8a6510;
  --seal: #a82f26;

  --ok: #1c7a5a;
  --warn: #8a6410;
  --info: #2f6293;
  --danger: #b8402f;

  --paper: #17140d;
  --text: #241f17;
  --body-soft: #4c453a;
  --body-soft-2: #3a342b;
  --muted: #7a7263;
  --faint: #a49a88;

  --input-bg: #ffffff;
  --btn-ink: #2a2005;
  --warm-text: #8f2f22;
  --err-text: #8f2f22;

  --cert-a: #fbf6ea;
  --cert-b: #f2e9d6;
  --checker-a: #ece3d2;
  --checker-b: #f3ecdd;
  --stage: rgba(120, 95, 30, 0.05);
  --grain: 0.35;
  --topbar-bg: rgba(246, 241, 230, 0.9);
  --shadow: 0 26px 60px -34px rgba(60, 46, 20, 0.6);
}

:root {
  --radius: 4px;
  --serif: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --wrap: 1120px;
}

/* ------------------------------ 基础 ------------------------------ */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 500px at 92% 8%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.papergrain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

a {
  color: var(--gold-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5em;
  color: var(--paper);
  overflow-wrap: break-word;
}
p {
  margin: 0 0 0.9em;
}
img,
canvas,
svg {
  max-width: 100%;
}

.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12.5px;
}
.center {
  text-align: center;
}
.code {
  font-family: var(--mono);
  color: var(--gold-2);
  letter-spacing: 0.06em;
  font-size: 13px;
}
.code.big {
  font-size: 15px;
}
.ghost {
  color: var(--muted);
  font-style: italic;
}
.hint {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
}
.dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.6;
  margin: 0 8px;
  vertical-align: middle;
}

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-left));
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand-badge {
  flex: none;
}
.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-txt b {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--paper);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.brand-txt em {
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--gold);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  min-width: 0;
}
.navlink {
  padding: 6px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: 0.18s;
}
.navlink:hover {
  color: var(--paper);
  background: var(--stage);
  text-decoration: none;
}
.navlink.on {
  color: var(--gold-2);
  background: rgba(150, 115, 30, 0.12);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 0;
}

/* 下拉菜单：绝对定位浮层，不参与导航栏布局，避免把导航挤变形 */
.menu {
  position: relative;
}
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  max-width: min(84vw, 320px);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  z-index: 60;
}
.menu-panel[hidden] {
  display: none;
}
.menu-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 6px 10px 8px;
  font-family: var(--mono);
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
}
.menu-item:hover {
  background: var(--stage);
  color: var(--paper);
  text-decoration: none;
}
.menu-item.on {
  color: var(--gold-2);
  font-weight: 600;
}
.menu-item.danger {
  color: var(--danger);
}
.menu-item .tick {
  color: var(--gold);
  font-size: 12px;
  flex: none;
}

.iconbtn {
  width: 32px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-2);
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s;
  line-height: 1;
  flex: none;
  padding: 0;
}
.iconbtn svg {
  display: block;
}
.iconbtn:hover {
  border-color: var(--gold);
  background: var(--stage);
}
[data-theme='dark'] .ico-moon {
  display: none;
}
[data-theme='light'] .ico-sun {
  display: none;
}

.userzone {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.usermenu-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  max-width: 200px;
  min-width: 0;
}
.usermenu-btn:hover {
  border-color: var(--gold);
}
.usermenu-btn .un {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 116px;
}
.usermenu-btn .chev {
  opacity: 0.6;
  flex: none;
}
.avatar-sm {
  font-size: 16px;
  line-height: 1;
  flex: none;
}
.avatar-md {
  font-size: 26px;
  line-height: 1;
  flex: none;
}
.user-card {
  display: flex;
  gap: 12px;
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.user-card-body b {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--paper);
  overflow-wrap: anywhere;
}
.user-card-body span {
  font-size: 12px;
  color: var(--muted);
}
.user-card-body .uc-motto {
  color: var(--gold-2);
  font-family: var(--serif);
}

/* ------------------------------ 通用块 ------------------------------ */

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 22px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
fieldset.card {
  padding: 24px 26px;
  min-width: 0;
}
fieldset.card > legend {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold-2);
  padding: 0 10px;
  letter-spacing: 0.06em;
}
.sect-h {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sect-h .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 1px 9px;
}
.sect-note {
  color: var(--muted);
  font-size: 13.5px;
  margin: -6px 0 14px;
}
.sub-h {
  font-size: 15px;
  color: var(--gold-2);
  margin: 22px 0 10px;
}
.more {
  font-size: 13px;
  font-weight: 400;
  font-family: var(--sans);
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--btn-ink);
  border: 1px solid var(--gold-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: 0.18s;
  white-space: nowrap;
  max-width: 100%;
  text-decoration: none;
}
.btn:hover {
  filter: brightness(1.06);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn.ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line-2);
}
.btn.ghost:hover {
  background: rgba(150, 115, 30, 0.12);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  opacity: 0.9;
}
.btn.danger:hover {
  background: rgba(184, 64, 47, 0.1);
}
.btn.lg {
  padding: 12px 24px;
  font-size: 15px;
}
.btn.sm {
  padding: 5px 12px;
  font-size: 13px;
}
.btn.wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.chip {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--gold-2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tone-ok {
  color: var(--ok);
  border-color: currentColor;
  opacity: 0.95;
}
.tone-info {
  color: var(--info);
  border-color: currentColor;
  opacity: 0.95;
}
.tone-warn {
  color: var(--warn);
  border-color: currentColor;
  opacity: 0.95;
}
.tone-danger {
  color: var(--danger);
  border-color: currentColor;
  opacity: 0.95;
}
.tone-muted {
  color: var(--muted);
  border-color: currentColor;
}

.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--stage);
}
.empty.big {
  padding: 70px 24px;
}

.err {
  background: rgba(168, 47, 38, 0.12);
  border: 1px solid rgba(184, 64, 47, 0.45);
  color: var(--err-text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin: 12px 0;
}

/* ------------------------------ 徽章 ------------------------------ */

.badge {
  display: block;
}
.badge circle,
.badge ellipse,
.badge path,
.badge line {
  vector-effect: non-scaling-stroke;
}

/* ------------------------------ 首页 ------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  padding: 24px 0 48px;
}
.stamp-line {
  margin-bottom: 18px;
}
.tag {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--seal);
  border: 1.5px solid var(--seal);
  border-radius: 3px;
  padding: 4px 12px;
  transform: rotate(-1.4deg);
  font-family: var(--mono);
}
.hero h1 {
  font-size: clamp(30px, 5.4vw, 56px);
  letter-spacing: 0.05em;
  margin: 0 0 18px;
}
.hero-sub {
  font-size: 17px;
  color: var(--body-soft-2);
  line-height: 1.85;
}
.hero-sub b {
  color: var(--gold-2);
}
.hero-note {
  color: var(--muted);
  font-size: 14px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 28px;
}
.stats {
  display: flex;
  gap: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.stats div {
  display: flex;
  flex-direction: column;
  min-width: 62px;
}
.stats b {
  font-family: var(--serif);
  font-size: 25px;
  color: var(--gold-2);
}
.stats span {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.cert {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: linear-gradient(160deg, var(--cert-a), var(--cert-b));
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(150, 115, 30, 0.05);
}
.cert::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  pointer-events: none;
}
.cert-inner {
  padding: 28px 18px;
  text-align: center;
  position: relative;
}
.cert-badge {
  margin: 0 auto 14px;
}
.cert-en {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.cert-title {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--paper);
  margin-bottom: 8px;
}
.cert-names {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--gold-2);
  margin: 12px 0;
}
.cert-names i {
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  margin: 0 8px;
}
.cert-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  margin: 18px 0 12px;
}
.cert-meta {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.cert-seal {
  margin: 20px auto 2px;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  border: 3px double var(--seal);
  color: var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.1em;
  transform: rotate(-11deg);
  opacity: 0.85;
  box-shadow: inset 0 0 0 4px rgba(168, 47, 38, 0.12);
  text-align: center;
  padding: 6px;
}
.cert.small .cert-seal {
  width: 76px;
  height: 76px;
  font-size: 13px;
}
.cert.small .cert-names {
  font-size: 15px;
}
.cert.small .cert-title {
  font-size: 16px;
}

.steps {
  margin: 26px 0 46px;
}
.steplist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
  counter-reset: step;
}
.steplist li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--stage);
  min-width: 0;
}
.steplist i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 20px;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}
.steplist b {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--paper);
  display: block;
  margin-bottom: 6px;
}
.steplist p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

.clause-peek,
.wall-peek {
  margin-bottom: 42px;
}
.peek-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}
.peek {
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 16px 18px;
  border-radius: 2px;
  background: var(--stage);
  min-width: 0;
}
.peek-no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--seal);
  letter-spacing: 0.1em;
}
.peek h4 {
  font-size: 15.5px;
  margin: 6px 0 8px;
  color: var(--gold-2);
}
.peek p {
  font-size: 13.5px;
  color: var(--body-soft);
  margin: 0;
}

/* ------------------------------ 卡片网格 ------------------------------ */

.tgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}
.tcard {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: 0.2s;
  color: inherit;
  min-width: 0;
}
.tcard:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -22px rgba(150, 115, 30, 0.7);
  text-decoration: none;
}
.tcard-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tcard h3 {
  font-size: 17px;
  margin: 0 0 12px;
}
.tcard-names {
  font-family: var(--serif);
  color: var(--gold-2);
  font-size: 15px;
  margin-bottom: 10px;
}
.tcard-names em {
  font-style: normal;
}
.tcard-names i {
  font-style: normal;
  color: var(--muted);
  margin: 0 7px;
  font-size: 12px;
}
.tcard-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.tcard-foot {
  font-size: 12px;
  color: var(--gold);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ------------------------------ 页头 / 档案 ------------------------------ */

.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pagehead > div {
  min-width: 0;
}
.pagehead h2 {
  font-size: clamp(22px, 3.6vw, 30px);
  margin: 0 0 4px;
}
.profile {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1.5px solid var(--line-2);
  background: var(--panel-3);
  flex: none;
}
.motto {
  font-family: var(--serif);
  color: var(--gold-2);
  font-size: 15px;
  margin: 4px 0 0;
}
.mini-stats {
  display: flex;
  gap: 36px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.mini-stats div {
  display: flex;
  flex-direction: column;
}
.mini-stats b {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--gold-2);
}
.mini-stats span {
  font-size: 12.5px;
  color: var(--muted);
}
.invites {
  margin-bottom: 28px;
}

/* ------------------------------ 登录注册 ------------------------------ */

.auth {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  gap: 32px;
  align-items: start;
  padding-top: 8px;
}
.auth-aside {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: linear-gradient(180deg, rgba(150, 115, 30, 0.06), transparent);
  min-width: 0;
}
.auth-aside h2 {
  font-size: clamp(21px, 3vw, 25px);
  margin: 14px 0 18px;
}
.aside-list {
  padding-left: 18px;
  color: var(--body-soft);
  font-size: 14px;
}
.aside-list li {
  margin-bottom: 12px;
}
.aside-badge {
  margin: 18px auto 0;
  opacity: 0.9;
}
.auth-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--panel);
  min-width: 0;
}
.auth-form h3 {
  font-size: 21px;
  margin-bottom: 20px;
}

.field {
  display: block;
  margin-bottom: 16px;
  min-width: 0;
}
.field > span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.fieldnote {
  display: block;
  font-size: 12px;
  margin-top: 5px;
  color: var(--muted);
  min-height: 16px;
}
.fieldnote.good {
  color: var(--ok);
}
.fieldnote.bad {
  color: var(--danger);
}

input[type='text'],
input[type='password'],
input[type='number'],
input:not([type]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 13px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14.5px;
  transition: 0.18s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(150, 115, 30, 0.16);
}
textarea {
  resize: vertical;
  line-height: 1.7;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-size: 20px;
  cursor: pointer;
  transition: 0.18s;
}
.av:hover {
  border-color: var(--line-2);
}
.av.on {
  border-color: var(--gold);
  background: rgba(150, 115, 30, 0.14);
  box-shadow: 0 0 0 3px rgba(150, 115, 30, 0.12);
}
.switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 16px 0 0;
}
.row2,
.row3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 16px;
}

/* ------------------------------ 条款 ------------------------------ */

.clause-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clause {
  border: 1px solid var(--line);
  border-left: 3px solid rgba(150, 115, 30, 0.4);
  border-radius: 2px;
  padding: 13px 16px;
  background: var(--stage);
  cursor: default;
  transition: 0.18s;
  display: block;
  margin: 0;
  min-width: 0;
}
.clause.on {
  border-left-color: var(--gold);
  background: rgba(150, 115, 30, 0.06);
}
.clause.pick {
  cursor: pointer;
}
.clause.pick:hover {
  border-color: var(--line-2);
}
.clause.pick:has(input:checked) {
  border-left-color: var(--gold);
  background: rgba(150, 115, 30, 0.06);
}
.clause.pick:has(input:not(:checked)) {
  opacity: 0.6;
  border-left-color: rgba(140, 151, 171, 0.3);
}
.clause.reserve {
  border-left-color: var(--warn);
  opacity: 0.8;
}
.clause-h {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.clause-h b {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold-2);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.clause-h .lock {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.clause p {
  font-size: 13.5px;
  color: var(--body-soft);
  margin: 0;
  line-height: 1.8;
}
.clause p.clause-p2 {
  margin-top: 8px;
  color: var(--muted);
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  flex: none;
  margin-top: 3px;
}
.params {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.params label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.params input {
  width: 110px;
  max-width: 45vw;
  padding: 5px 9px;
}

.penalty-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.penalty {
  border: 1px solid rgba(168, 47, 38, 0.32);
  border-left: 3px solid var(--seal);
  border-radius: 2px;
  padding: 12px 16px;
  background: rgba(168, 47, 38, 0.055);
  min-width: 0;
}
.penalty .clause-h b {
  color: var(--warm-text);
}
.penalty p {
  font-size: 13.5px;
  color: var(--body-soft);
  margin: 0;
}
.p-params {
  color: var(--gold-2);
}
.preamble {
  font-family: var(--serif);
  color: var(--body-soft-2);
  font-size: 15px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.pledge {
  margin: 22px 0 10px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(150, 115, 30, 0.06);
  font-family: var(--serif);
  color: var(--gold-2);
  font-size: 15.5px;
  border-radius: 2px;
}
.notice {
  border-color: var(--line-2);
}
.notice p {
  color: var(--body-soft);
}

/* ------------------------------ 条约详情 ------------------------------ */

.treaty-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.th-left {
  flex: 1 1 320px;
  min-width: 0;
}
.th-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.t-title {
  font-size: clamp(22px, 4vw, 32px);
  margin: 0 0 10px;
}
.finger {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 12px;
  flex-wrap: wrap;
}
.finger code {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 12.5px;
}
.th-right {
  flex: none;
}
.seal-big {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  border: 3px double var(--seal);
  color: var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.1em;
  transform: rotate(-10deg);
  opacity: 0.85;
  box-shadow: inset 0 0 0 5px rgba(168, 47, 38, 0.12);
  text-align: center;
  padding: 8px;
}
.seal-big.small {
  width: 90px;
  height: 90px;
  font-size: 14px;
}
.seal-big.active {
  color: var(--ok);
  border-color: var(--ok);
  box-shadow: inset 0 0 0 5px rgba(28, 122, 90, 0.12);
}
.seal-big.recruiting {
  color: var(--info);
  border-color: var(--info);
  box-shadow: inset 0 0 0 5px rgba(47, 98, 147, 0.12);
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: 12px;
}
.party {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  background: var(--stage);
  min-width: 0;
}
.party.signed {
  border-color: rgba(28, 122, 90, 0.4);
  background: rgba(28, 122, 90, 0.06);
}
.party.pending {
  border-style: dashed;
}
.party.exited {
  opacity: 0.5;
}
.s-av {
  font-size: 23px;
}
.party b {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold-2);
  overflow-wrap: anywhere;
}
.s-role {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.s-state {
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ev {
  display: flex;
  gap: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ev:last-child {
  border-bottom: none;
}
.ev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  flex: none;
  opacity: 0.75;
}
.ev-charge .ev-dot,
.ev-exit .ev-dot,
.ev-ended .ev-dot {
  background: var(--seal);
}
.ev-sealed .ev-dot,
.ev-signed .ev-dot {
  background: var(--ok);
}
.ev-body {
  min-width: 0;
}
.ev-txt {
  font-size: 14px;
  color: var(--body-soft-2);
}
.ev-detail {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}
.ev-time {
  font-size: 11.5px;
  color: var(--faint);
  font-family: var(--mono);
  margin-top: 3px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.checkin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.charge-item .action-row {
  margin-top: 12px;
}
.sharebox {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.sharetext {
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ------------------------------ 起草页 ------------------------------ */

.draft {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}
.draft-main {
  min-width: 0;
}
.draft-side {
  position: sticky;
  top: 78px;
}
.preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}
.preview-label {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--mono);
}
.preview-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.preview-list li {
  padding: 5px 0;
  border-bottom: 1px dashed var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.preview-list b {
  color: var(--gold-2);
  font-weight: 600;
  text-align: right;
}

/* ------------------------------ 签署仪式 ------------------------------ */

.sign-head {
  text-align: center;
  margin-bottom: 26px;
}
.sign-head h1 {
  font-size: clamp(24px, 4.4vw, 34px);
  margin: 16px 0 8px;
}
.sign-tip {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 15px;
  margin-top: 14px;
}

/* ------------------------------ 卡片工坊 ------------------------------ */

.workshop {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.ws-side {
  min-width: 0;
}
.ws-side .card {
  padding: 18px 20px;
}
.ws-side h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--gold-2);
}
.kind-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kind {
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--stage);
  color: var(--text);
  font-family: var(--serif);
  font-size: 14.5px;
  transition: 0.18s;
}
.kind:hover {
  border-color: var(--line-2);
}
.kind.on {
  border-color: var(--gold);
  background: rgba(150, 115, 30, 0.1);
  color: var(--gold-2);
  box-shadow: inset 3px 0 0 var(--gold);
}
.kv {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.kv span {
  color: var(--muted);
  flex: none;
}
.kv b {
  color: var(--gold-2);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ws-main {
  min-width: 0;
}
.canvas-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: repeating-conic-gradient(from 0deg, var(--checker-a) 0% 25%, var(--checker-b) 0% 50%) 50% / 22px 22px;
  display: flex;
  justify-content: center;
}
#card-canvas {
  width: 100%;
  max-width: 460px;
  height: auto;
  box-shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.7);
  border-radius: 2px;
}
.canvas-hint {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
  background: var(--panel);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.ws-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.copyrow {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}
.copyrow input {
  font-family: var(--mono);
  font-size: 12.5px;
  min-width: 0;
}
.copyrow .btn {
  flex: none;
}

/* ------------------------------ 分享落地页 ------------------------------ */

.share-land {
  text-align: center;
  max-width: 620px;
  margin: 16px auto 50px;
}
.share-land h1 {
  font-size: clamp(24px, 4.6vw, 36px);
  margin: 18px 0 14px;
}
.share-names {
  font-family: var(--serif);
  font-size: clamp(17px, 3vw, 22px);
  color: var(--gold-2);
  margin-bottom: 14px;
}
.share-names .x {
  font-style: normal;
  color: var(--muted);
  margin: 0 10px;
  font-size: 14px;
}
.share-img {
  width: 100%;
  max-width: 460px;
  margin: 22px auto;
  display: block;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

/* ------------------------------ 页脚 ------------------------------ */

.foot {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 24px 56px;
  text-align: center;
}
.foot-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  margin-bottom: 20px;
}
.foot p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.foot b {
  color: var(--gold-2);
}
/* 首页底部的联系方式 */
.home-contact {
  margin: 30px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}
.home-contact a {
  color: var(--gold-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.18s;
}
.home-contact a:hover {
  border-bottom-color: var(--gold-2);
}

/* ------------------------------ 提示条 / 弹层 ------------------------------ */

.toastbar {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(0);
  z-index: 999;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  max-width: min(88vw, 520px);
  text-align: center;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  background: var(--panel-2);
  color: var(--paper);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.toastbar[data-kind='ok'] {
  border-color: rgba(28, 122, 90, 0.6);
}
.toastbar[data-kind='error'] {
  border-color: rgba(184, 64, 47, 0.6);
  color: var(--err-text);
}

.modalbg {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 10, 16, 0.7);
  backdrop-filter: blur(6px);
}
.modalbox {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.modalbox h3 {
  font-size: 18px;
  margin: 0 0 6px;
}
.mdesc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.mfield {
  display: block;
  margin-bottom: 14px;
  min-width: 0;
}
.mlabel {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.mfoot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ------------------------------ 分段控件 / 设置 ------------------------------ */

.segs {
  display: flex;
  gap: 6px;
}
.seg {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stage);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: 0.18s;
}
.seg:hover {
  border-color: var(--line-2);
}
.seg.on {
  border-color: var(--gold);
  background: rgba(150, 115, 30, 0.12);
  color: var(--gold-2);
  font-weight: 600;
}
.cap-n {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}
/* 作者样式里的 display 会盖过 hidden 属性，这里显式让位 */
.cap-n[hidden],
.cap-num[hidden] {
  display: none;
}
.cap-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cap-n input[type='number'] {
  width: 92px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.inline-check input {
  margin: 0;
  accent-color: var(--gold);
  flex: none;
}
.cap-note {
  margin: 6px 0 14px;
}
.setblock {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--stage);
  margin-bottom: 14px;
}
.setblock-h {
  font-size: 13px;
  color: var(--gold-2);
  font-family: var(--serif);
  margin-bottom: 6px;
}
.switchline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}
.switchline + .switchline {
  border-top: 1px dashed var(--line-soft);
}
.switchline > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.switchline b {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.switchline em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.scope-hidden {
  display: none !important;
}
.scope-legend {
  margin-top: 14px;
}

/* ------------------------------ 加入申请 ------------------------------ */

.join-card .join-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.join-card .sect-h {
  margin-bottom: 4px;
}
.apply-item {
  margin-bottom: 12px;
}
.apply-item .action-row {
  margin-top: 12px;
}
.voted-note {
  color: var(--gold-2);
  margin: 10px 0 0;
  font-size: 13px;
}
.notice-card .notice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1080px) {
  .draft,
  .workshop {
    grid-template-columns: minmax(0, 1fr);
  }
  .draft-side {
    position: static;
  }
  .preview {
    max-width: 420px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding-bottom: 36px;
  }
  .hero-right {
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 14px;
  }
  .brand {
    order: 1;
  }
  .tools {
    order: 2;
    margin-left: auto;
  }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .navlink {
    padding: 6px 10px;
  }
  .wrap {
    padding: 22px 14px 56px;
  }
  .card,
  fieldset.card {
    padding: 18px 16px;
  }
  .auth-aside,
  .auth-form {
    padding: 20px 16px;
  }
  .treaty-head {
    gap: 16px;
  }
  .seal-big {
    width: 96px;
    height: 96px;
    font-size: 14px;
  }
  .stats {
    gap: 20px;
  }
  .stats b {
    font-size: 21px;
  }
  .hero-cta .btn {
    flex: 1 1 auto;
  }
  .foot {
    padding: 22px 14px 44px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14.5px;
  }
  .brand-txt b {
    font-size: 14.5px;
    max-width: 40vw;
  }
  .brand-txt em {
    display: none;
  }
  .usermenu-btn .un,
  .usermenu-btn .chev {
    display: none;
  }
  .usermenu-btn {
    padding: 5px 7px;
  }
  .btn.lg {
    padding: 11px 16px;
    font-size: 14.5px;
    white-space: normal;
  }
  .btn {
    white-space: normal;
  }
  .action-row .btn,
  .hero-cta .btn {
    flex: 1 1 100%;
  }
  .canvas-wrap {
    padding: 10px;
  }
  .canvas-hint {
    bottom: 12px;
    right: 12px;
  }
  .preview {
    max-width: none;
  }
  .stats div {
    min-width: 54px;
  }
}

@media (max-width: 380px) {
  .langbtn {
    padding: 5px 7px;
    font-size: 12px;
  }
  .iconbtn {
    width: 30px;
  }
  .avatar {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  .seal-big {
    width: 84px;
    height: 84px;
    font-size: 12px;
  }
}

/* 横屏矮窗口：避免 sticky 侧栏顶到内容 */
@media (max-height: 520px) and (min-width: 1081px) {
  .draft-side {
    position: static;
  }
}

@media print {
  .topbar,
  .foot,
  .papergrain,
  .action-row,
  .ws-actions {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
