/* ==================== 变量（宣纸暖调） ==================== */
:root {
  /* 主题色 */
  --accent: #c23a2b;
  --accent-light: #e8d5d2;
  --bg-paper: #f5eed6;
  --bg-section: #efe6cc;
  --bg-card: #faf5e8;
  --border-ink: rgba(44, 44, 44, 0.12);
  --text-ink: #2c2c2c;
  --text-secondary: #5a5345;
  --text-muted: #8a8378;
  --shadow-paper: 0 2px 12px rgba(44, 44, 44, 0.08);
  --shadow-card: 2px 3px 8px rgba(44, 44, 44, 0.1);
  --radius-small: 4px;
  --radius: 6px;
  --radius-large: 8px;
  --transition-fast: .2s;
  --transition: .35s;
  --transition-slow: .6s;
  --status-color: #909090;
  --font-kai: 'LXGW WenKai', 'Noto Serif SC', 'KaiTi', '楷体', serif;
  --font-song: 'Noto Serif SC', 'SimSun', '宋体', serif;
  --font: 'LXGW WenKai', -apple-system, BlinkMacSystemFont, 'Noto Sans SC', sans-serif;
  --sidebar-w: 220px;
}

.theme-dark {
  --bg-paper: #1a1a18;
  --bg-section: #22211e;
  --bg-card: #2a2924;
  --border-ink: rgba(200, 190, 170, 0.12);
  --text-ink: #d4cfc4;
  --text-secondary: #a09a8c;
  --text-muted: #706b60;
  --shadow-paper: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-card: 2px 3px 8px rgba(0, 0, 0, 0.25);
}

/* ==================== 状态颜色 ==================== */
.server-online { --status-color: #59b66d; }
.server-offline { --status-color: #909090; }
.server-maintenance { --status-color: #d0a246; }

/* ==================== 基础 ==================== */
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg-paper);
  color: var(--text-ink);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  display: flex;
}

::selection { background: var(--accent); color: #fff; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}
body.theme-dark::before { display: none; }

/* ==================== 主题色过渡（限定范围，避免全局卡顿） ==================== */
body,
.ink-sidebar,
.ink-main,
.chapter,
.paper-card,
.server-instance,
.letter-paper,
.theme-toggle-btn,
.mobile-tabs {
  transition: background-color 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              border-color 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 隐藏数据容器 / 蜜罐字段 */
.sr-only-data {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}

.server-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-family: var(--font-kai);
  letter-spacing: 0.08em;
}

.chart-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-kai);
}

.ink-heading {
  margin: 0 0 10px 4px;
  font-size: 13px;
  font-family: var(--font-kai);
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.scenery-widget__title {
  margin: 22px 0 10px 4px;
  font-size: 13px;
}

.letter-paper--spaced {
  margin-top: 24px;
}

.letter-row--actions {
  border-bottom: none;
  justify-content: flex-end;
  padding-top: 14px;
}

/* ==================== 工具类 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-kai);
  font-size: 14px;
  padding: 6px 18px;
  border-radius: var(--radius-small);
  letter-spacing: 0.1em;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.96); }

.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.paper-card:hover { box-shadow: var(--shadow-card); }

.toast {
  position: fixed;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-section);
  color: var(--text-ink);
  border: 1px solid var(--accent);
  padding: 8px 22px;
  border-radius: var(--radius-small);
  z-index: 99999;
  font-size: 13px;
  box-shadow: var(--shadow-paper);
  letter-spacing: 1px;
  font-family: var(--font-kai);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--bg-section);
  border: 1px solid var(--border-ink);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-ink);
  box-shadow: var(--shadow-paper);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.5s ease;
}
.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(45deg);
  background: var(--bg-paper);
}
.theme-toggle-btn i,
.theme-toggle-btn [data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* ==================== 左侧书签栏 ==================== */
.ink-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-section);
  border-right: 1px solid var(--border-ink);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 28px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-ink);
}

.sidebar-logo {
  font-family: var(--font-kai);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-ink);
  letter-spacing: 0.12em;
  display: block;
  line-height: 1.4;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.sidebar-tab {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: none;
  border: none;
  font-family: var(--font-kai);
  font-size: 17px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition), background var(--transition);
}
.sidebar-tab::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height var(--transition);
  border-radius: 0 2px 2px 0;
}
.sidebar-tab:hover {
  color: var(--text-ink);
  background: rgba(194, 58, 43, 0.04);
}
.sidebar-tab.active {
  color: var(--accent);
  font-weight: 700;
  background: rgba(194, 58, 43, 0.06);
}
.sidebar-tab.active::before { height: 60%; }

.sidebar-colophon {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-ink);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.sidebar-colophon .colophon-name {
  font-family: var(--font-kai);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}
.sidebar-colophon .colophon-meta {
  font-family: var(--font-song);
  font-size: 11px;
  margin-bottom: 8px;
}
.sidebar-colophon .colophon-meta span:empty { display: none; }
.sidebar-colophon .colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.sidebar-colophon .colophon-links:empty { display: none; }
.sidebar-colophon .colophon-seal {
  display: inline-flex;
  font-family: var(--font-kai);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-small);
  letter-spacing: 0.08em;
  transition: background var(--transition), color var(--transition);
}
.sidebar-colophon .colophon-seal:hover {
  background: var(--accent);
  color: #fff;
}

/* ==================== 侧边栏题诗印章 ==================== */
.sidebar-inscription {
  margin-top: auto;
  margin-bottom: 40px;
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  opacity: 0.75;
  transition: opacity 0.3s, transform 0.3s;
}
.sidebar-inscription:hover { opacity: 0.95; }

.poetic-line {
  writing-mode: vertical-rl;
  font-size: 21px;
  color: var(--text-muted);
  letter-spacing: 12px;
  font-family: "Kaiti", "STKaiti", "Noto Serif SC", "SimSun", serif;
  line-height: 1.4;
}

.red-seal {
  writing-mode: vertical-rl;
  font-size: 13px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 6px 4px;
  align-self: flex-end;
  line-height: 1;
  font-weight: bold;
  transform: rotate(-3deg);
  box-shadow: 0 1px 4px rgba(194, 58, 43, 0.25);
  margin-bottom: 6px;
  margin-top: 24px;
}

/* ==================== 主内容区 ==================== */
.ink-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==================== 章回面板 ==================== */
.chapter {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
  -webkit-overflow-scrolling: touch;
}
.chapter[hidden] {
  display: none !important;
}
.chapter.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.chapter-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.chapter-title {
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  color: var(--text-ink);
  letter-spacing: 0.3em;
  margin-bottom: 36px;
}
.chapter-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 1px;
}

/* ==================== 服务器切换印章按钮 ==================== */
.server-switch-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.ink-srv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--text-muted);
  padding: 6px 20px;
  border-radius: var(--radius-small);
  font-family: var(--font-kai);
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition);
}
.ink-srv-btn__icon {
  line-height: 1;
  font-style: normal;
}
.ink-srv-btn:hover {
  border-color: var(--accent);
  color: var(--text-ink);
}
.ink-srv-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-paper);
  font-weight: 600;
}

/* ==================== 卷首（Hero + Status 左右分栏） ==================== */
.chapter--prologue { background: var(--bg-paper); }

.prologue-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100%;
  align-items: start;
}

.prologue-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  overflow: hidden;
  min-height: 100vh;
  padding-top: 82px;
}

.prologue-left .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity var(--transition);
  background: var(--bg-paper);
}

.prologue-left .hero-bg.hero-bg--ink {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 640' preserveAspectRatio='xMidYMax slice'%3E%3Cpath fill='%231a1a18' fill-opacity='0.2' d='M0%20308%20C140%20302%20195%20228%20315%20242%20C435%20256%20495%20182%20615%20202%20C735%20222%20795%20172%20915%20192%20C1035%20212%201095%20188%201200%20202%20L1200%20640%20L0%20640%20Z'/%3E%3Cpath fill='%231a1a18' fill-opacity='0.32' d='M0%20348%20C110%20342%20175%20268%20285%20282%20C395%20296%20455%20212%20585%20238%20C715%20264%20775%20208%20895%20232%20C1015%20256%201075%20222%201200%20240%20L1200%20640%20L0%20640%20Z'/%3E%3Cpath fill='%231a1a18' fill-opacity='0.42' d='M0%20405%20C130%20398%20205%20318%20340%20335%20C475%20352%20540%20272%20685%20298%20C830%20324%20890%20278%201030%20305%20C1105%20318%201150%20295%201200%20308%20L1200%20640%20L0%20640%20Z'/%3E%3C/svg%3E")
      center 100% / 125% auto no-repeat,
    radial-gradient(ellipse 100% 55% at 50% 100%, rgba(44, 44, 44, 0.045) 0%, transparent 52%),
    linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-section) 50%, #e4dcc6 100%);
}

.prologue-left .hero-bg.hero-bg--ink::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 58%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 55% at 50% 6%, rgba(255, 255, 255, 0.5) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 100%);
  opacity: 0.85;
}

.theme-dark .prologue-left .hero-bg.hero-bg--ink {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 640' preserveAspectRatio='xMidYMax slice'%3E%3Cpath fill='%23c8c2b4' fill-opacity='0.14' d='M0%20308%20C140%20302%20195%20228%20315%20242%20C435%20256%20495%20182%20615%20202%20C735%20222%20795%20172%20915%20192%20C1035%20212%201095%20188%201200%20202%20L1200%20640%20L0%20640%20Z'/%3E%3Cpath fill='%23c8c2b4' fill-opacity='0.24' d='M0%20348%20C110%20342%20175%20268%20285%20282%20C395%20296%20455%20212%20585%20238%20C715%20264%20775%20208%20895%20232%20C1015%20256%201075%20222%201200%20240%20L1200%20640%20L0%20640%20Z'/%3E%3Cpath fill='%23c8c2b4' fill-opacity='0.36' d='M0%20405%20C130%20398%20205%20318%20340%20335%20C475%20352%20540%20272%20685%20298%20C830%20324%20890%20278%201030%20305%20C1105%20318%201150%20295%201200%20308%20L1200%20640%20L0%20640%20Z'/%3E%3C/svg%3E")
      center 100% / 125% auto no-repeat,
    radial-gradient(ellipse 100% 50% at 50% 100%, rgba(0, 0, 0, 0.25) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-section) 52%, #121210 100%);
}
.theme-dark .prologue-left .hero-bg.hero-bg--ink::before {
  height: 55%;
  background:
    radial-gradient(ellipse 70% 50% at 50% 5%, rgba(255, 255, 255, 0.08) 0%, transparent 48%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  opacity: 1;
}

.prologue-left .hero-bg.hero-bg--plain {
  background: var(--bg-paper) !important;
}
.prologue-left .hero-bg.hero-bg--plain::before { display: none; }

.prologue-left .hero-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* 卷首背景微动 */
.hero-bg--ink {
  transform: scale(1.05) translate3d(0, 0, 0);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

/* 水墨雾气 */
.ink-mist {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--bg-paper) 80%);
  transition: background 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.prologue-content {
  position: relative;
  z-index: 1;
  padding: 40px 32px;
  max-width: 520px;
  transform: none;
  margin: 0;
}

.hero-title {
  font-family: var(--font-kai);
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 700;
  color: var(--text-ink);
  letter-spacing: 0.12em;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hero-motd-wrap { margin-bottom: 32px; }

.hero-motd {
  display: inline-block;
  font-family: var(--font-kai);
  font-size: 15px;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-left: 3px solid var(--accent);
  text-align: left;
  max-width: 400px;
  line-height: 1.8;
}

.hero-address {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.address-value {
  font-family: var(--font-song);
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-ink);
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 6px 18px;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.address-value:hover {
  background: var(--bg-section);
  border-color: var(--border-ink);
  color: var(--accent);
  transform: scale(1.02);
}
.address-value:active { transform: scale(0.98); }

/* 深色背景下文字反白 */
.prologue-left.prologue--dark .hero-title { color: #f5eed6; }
.prologue-left.prologue--dark .hero-motd { color: rgba(245, 238, 214, 0.7); border-left-color: var(--accent); }
.prologue-left.prologue--dark .address-value { color: #f5eed6; }

.prologue-right {
  background: var(--bg-section);
  padding: 40px 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: stretch;
}

.prologue-status-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==================== 下载按钮（印章描边） ==================== */
.hero-download-area {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.download-btn,
.download-btn.stamp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 24px;
  font-size: 14px;
  font-family: var(--font-kai);
  letter-spacing: 0.1em;
  color: var(--accent);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  box-shadow: none;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), box-shadow var(--transition);
}
.download-btn:hover,
.download-btn.stamp-btn:hover {
  background: var(--accent);
  color: #fff;
  opacity: 1;
  box-shadow: var(--shadow-paper);
}
.download-btn:active {
  transform: scale(0.97);
}
.download-btn [data-lucide],
.download-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}
.prologue-left.prologue--dark .download-btn {
  color: #f5eed6;
  border-color: rgba(245, 238, 214, 0.55);
}
.prologue-left.prologue--dark .download-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ==================== 印章式状态 ==================== */
.seal-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--accent);
  padding: 6px 16px;
  font-family: var(--font-kai);
  font-size: 15px;
  color: var(--accent);
  border-radius: var(--radius-small);
  letter-spacing: 0.05em;
}
.seal-online { font-weight: 700; font-size: 18px; }
.seal-divider { opacity: 0.4; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--status-color);
  transition: background var(--transition);
}

/* ==================== 服务器卡片统一样式 ==================== */
.server-instance {
  border: 1px solid var(--border-ink);
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-paper);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.server-instance:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.server-instance .server-card__side {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.server-instance .server-card__side--minecraft { background: var(--accent, #c23a2b); }
.server-instance .server-card__side--terraria { background: #2b70bf; }

.server-instance .server-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.server-instance .server-card__name {
  font-family: var(--font-kai);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-ink);
}

.server-instance .server-card__status {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: var(--radius-small);
  font-family: var(--font-kai);
}
.server-instance .server-card__status--online {
  border-color: var(--accent);
  color: var(--accent);
}

.server-instance .server-card__status-dot {
  background: var(--text-muted);
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.server-instance .server-card__status-dot--online { background: var(--accent); }

.server-instance .server-card__status-divider {
  margin: 0 4px;
  opacity: 0.4;
}

.server-instance .server-card__grid {
  margin: 0;
  padding: 10px;
  background: var(--bg-paper);
  border-radius: var(--radius-small);
  border: 1px solid var(--border-ink);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font-size: 12px;
}

.server-instance .server-card__label { color: var(--text-muted); }
.server-instance .server-card__value { font-weight: 600; color: var(--text-ink); }
.server-instance .server-card__ping--online { color: var(--accent); }
.server-instance .server-card__ping--offline { color: var(--text-ink); }

.server-instance .server-card__addr {
  cursor: pointer;
  transition: color var(--transition);
}
.server-instance .server-card__addr-text {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline dashed;
  text-underline-offset: 3px;
}

.server-instance .server-card__players {
  margin-top: 12px;
  border-top: 1px dashed var(--border-ink);
  padding-top: 8px;
}
.server-instance .server-card__players-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-kai);
}
.server-instance .server-card__players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==================== 玩家标签 ==================== */
.player-tag {
  padding: 4px 12px;
  background: var(--bg-section);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius-small);
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--text-secondary);
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== 风物轮播组件 ==================== */
.scenery-widget {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  min-width: 0;
  margin-top: 8px;
  padding: 0 4px;
  box-sizing: border-box;
  width: 100%;
}
.ink-gallery-card {
  position: relative;
  width: 100%;
  min-height: 180px;
  height: 220px;
  flex: 1 1 auto;
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-paper);
  box-shadow: var(--shadow-paper);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.ink-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
  will-change: opacity;
}
.ink-gallery-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.ink-gallery-card:hover img {
  transform: scale(1.04);
}
.gallery-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  max-width: calc(100% - 24px);
  background: rgba(34, 33, 30, 0.85);
  color: #d4cfc4;
  font-size: 12px;
  font-family: var(--font-kai);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.3s ease, color 0.3s ease;
}
.ink-gallery-card:hover .gallery-tag {
  background: var(--accent);
  color: #fff;
}

/* 卡片内探测信息面板（全零人数时） */
.server-card__info-panel {
  padding: 12px 8px;
  font-family: var(--font-kai);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.server-card__info-panel .info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-ink);
}
.server-card__info-panel .info-row:last-child { border-bottom: none; }
.server-card__info-panel .info-label {
  color: var(--text-muted);
  min-width: 7em;
}
.server-card__info-panel .info-value {
  color: var(--text-ink);
  flex: 1;
  min-width: 0;
}

/* ==================== 挂轴画廊 ==================== */
.gallery-categories, .news-categories {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cat-btn {
  padding: 6px 16px;
  font-family: var(--font-kai);
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-small);
  letter-spacing: 0.05em;
  transition: all var(--transition);
}
.cat-btn:hover { border-color: var(--accent); color: var(--accent); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.scroll-gallery {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.scroll-gallery::-webkit-scrollbar { height: 6px; }
.scroll-gallery::-webkit-scrollbar-thumb { background: var(--border-ink); border-radius: 3px; }

.scroll-track {
  display: flex;
  gap: 24px;
  padding: 8px 4px;
  width: max-content;
}

.scroll-frame {
  flex-shrink: 0;
  width: 280px;
  text-align: center;
}

.scroll-rod {
  height: 8px;
  background: linear-gradient(180deg, #8b7355, #a0896b, #8b7355);
  border-radius: var(--radius-small);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.theme-dark .scroll-rod {
  background: linear-gradient(180deg, #4a4035, #5a4d40, #4a4035);
}

.scroll-img-wrap {
  cursor: pointer;
  overflow: hidden;
  border-left: 3px solid #a0896b;
  border-right: 3px solid #a0896b;
}
.theme-dark .scroll-img-wrap { border-color: #5a4d40; }

.scroll-img-wrap img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.scroll-frame:hover .scroll-img-wrap img { transform: scale(1.05); }

.scroll-caption {
  font-family: var(--font-kai);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.08em;
}

/* PC 端画集网格（挂轴结构 → 卡片网格） */
@media (min-width: 1024px) {
  #chapter-gallery .scroll-gallery {
    overflow: visible;
    width: 100%;
    padding: 10px 4px 40px 4px;
  }
  #chapter-gallery .gallery-grid.scroll-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    width: 100%;
    transform: none;
    white-space: normal;
  }
  #chapter-gallery .gallery-grid > .scroll-frame {
    position: relative;
    width: 100%;
    flex-shrink: unset;
    border: 1px solid var(--border-ink);
    border-radius: var(--radius-large);
    overflow: hidden;
    background: var(--bg-section);
    box-shadow: var(--shadow-paper);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    text-align: left;
  }
  #chapter-gallery .gallery-grid > .scroll-frame:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18), var(--shadow-paper);
    z-index: 10;
  }
  #chapter-gallery .scroll-rod { display: none; }
  #chapter-gallery .scroll-img-wrap {
    border: none;
    aspect-ratio: 16 / 10;
  }
  #chapter-gallery .scroll-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    filter: contrast(0.96) brightness(0.97);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s, filter 0.4s;
  }
  #chapter-gallery .gallery-grid > .scroll-frame:hover img {
    transform: scale(1.05);
    opacity: 1;
    filter: contrast(1) brightness(1);
  }
  #chapter-gallery .scroll-caption {
    position: absolute;
    bottom: 12px;
    left: 12px;
    margin: 0;
    max-width: calc(100% - 24px);
    background: rgba(34, 33, 30, 0.85);
    color: #d4cfc4;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
  }
  #chapter-gallery .gallery-grid > .scroll-frame:hover .scroll-caption {
    color: #fff;
    background: var(--accent);
    transform: translateX(3px);
  }
}

/* ==================== 告示牌动态 ==================== */
.notice-board {
  columns: 2;
  column-gap: 20px;
}

.notice-card {
  break-inside: avoid;
  background: var(--bg-card);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.notice-card:hover {
  box-shadow: var(--shadow-paper);
  transform: rotate(0deg) !important;
}

.notice-pin {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.notice-stamp {
  display: inline-block;
  font-family: var(--font-kai);
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-small);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.notice-title {
  font-family: var(--font-kai);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-ink);
  margin-bottom: 8px;
  line-height: 1.5;
}

.notice-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.notice-foot {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.notice-cat {
  font-family: var(--font-kai);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: var(--radius-small);
  font-size: 12px;
}

.notice-date { font-family: var(--font-song); }

.empty-text {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-family: var(--font-kai);
  font-size: 16px;
  letter-spacing: 0.1em;
}

/* ==================== 弹窗（书卷全篇） ==================== */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none; visibility: hidden;
}
.modal:not([hidden]) {
  display: flex;
}
.modal.modal--visible {
  pointer-events: auto;
  visibility: visible;
}

.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(44, 44, 44, 0.45);
  backdrop-filter: blur(10px);
  opacity: 0; transition: opacity var(--transition);
}
.modal.modal--visible .modal-overlay { opacity: 1; }
.modal.modal--closing .modal-overlay { opacity: 0; }

.modal-content--post.article-scroll-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92%;
  max-width: 720px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity var(--transition), transform var(--transition);
}
.modal.modal--visible .modal-content--post.article-scroll-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.modal.modal--closing .modal-content--post.article-scroll-wrap {
  opacity: 0;
  transform: translateY(18px) scale(0.99);
}

.article-scroll-rod {
  width: min(100%, 704px);
  height: 14px;
  border-radius: var(--radius);
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 40%),
    linear-gradient(90deg, #4a3428 0%, #6b4e3d 18%, #3d2b22 50%, #6b4e3d 82%, #4a3428 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.12),
    inset 0 -2px 4px rgba(0,0,0,0.35),
    0 4px 14px rgba(0,0,0,0.22);
  position: relative;
  z-index: 2;
}
.article-scroll-rod--top { margin-bottom: -2px; }
.article-scroll-rod--bottom { margin-top: -2px; }

.article-scroll-paper {
  position: relative;
  width: 100%;
  max-width: 672px;
  margin: 0 10px;
  max-height: min(74vh, 680px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 24%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(44, 44, 44, 0.04) 27px,
      rgba(44, 44, 44, 0.04) 28px
    ),
    var(--bg-card);
  border: 2px solid rgba(44, 44, 44, 0.22);
  outline: 3px double rgba(44, 44, 44, 0.18);
  outline-offset: -6px;
  box-shadow:
    var(--shadow-paper),
    0 12px 40px rgba(44, 44, 44, 0.12);
  z-index: 1;
}
.article-scroll-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.9;
  pointer-events: none;
}

.seal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 40px; height: 40px;
  padding: 0;
  font-family: var(--font-kai);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  background: rgba(250, 245, 232, 0.92);
  border: 2px solid var(--accent);
  border-radius: var(--radius-small);
  cursor: pointer;
  z-index: 12;
  box-shadow: 2px 2px 0 rgba(44, 44, 44, 0.08);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.theme-dark .seal-close { background: rgba(42, 41, 36, 0.95); }
.seal-close:hover { background: var(--accent); color: #fff; transform: rotate(-3deg); }

.article-scroll-header {
  padding: 36px 48px 12px 28px;
  text-align: center;
  flex-shrink: 0;
}

.article-scroll-eyebrow {
  display: inline-block;
  font-family: var(--font-kai);
  font-size: 12px;
  letter-spacing: 0.45em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 14px 4px 18px;
  margin-bottom: 14px;
  border-radius: var(--radius-small);
}

.article-scroll-title {
  font-family: var(--font-kai);
  font-size: clamp(20px, 4.2vw, 26px);
  font-weight: 700;
  color: var(--text-ink);
  line-height: 1.45;
  margin: 0;
  letter-spacing: 0.12em;
}

.article-scroll-rule {
  width: 72%;
  max-width: 280px;
  height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, var(--border-ink), transparent);
  position: relative;
}
.article-scroll-rule::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  border: 1px solid var(--accent);
  border-radius: 1px;
  background: var(--bg-card);
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-content--post .article-scroll-meta.post-meta {
  justify-content: center;
  margin: 14px 0 0;
  font-family: var(--font-song);
}

.modal-scroll.article-scroll-body {
  padding: 8px 28px 28px 36px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-scroll.article-scroll-body::-webkit-scrollbar { width: 5px; }
.modal-scroll.article-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(194, 58, 43, 0.35);
  border-radius: var(--radius-small);
}

.post-meta {
  font-size: 14px; color: var(--text-muted);
  margin: 8px 0 20px;
  display: flex; gap: 8px; flex-wrap: wrap;
}

.post-body { line-height: 2; color: var(--text-secondary); }
.post-body img { border-radius: var(--radius); margin: 16px 0; }

.article-body-ink {
  font-family: var(--font-song);
  font-size: 16px;
  text-align: justify;
  text-justify: inter-ideograph;
}
.article-body-ink > p:first-child { text-indent: 2em; }
.article-body-ink p { margin: 0.75em 0; }
.article-body-ink h1,
.article-body-ink h2,
.article-body-ink h3 {
  font-family: var(--font-kai);
  color: var(--text-ink);
  margin: 1.2em 0 0.5em;
  letter-spacing: 0.08em;
}

/* ==================== 江湖（留言+白名单合并章） ==================== */
.community-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-ink);
}

.community-tab {
  padding: 12px 32px;
  background: none;
  border: none;
  font-family: var(--font-kai);
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.2em;
  position: relative;
  transition: color var(--transition);
}
.community-tab::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -1px;
  width: 0; height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width var(--transition);
}
.community-tab:hover { color: var(--text-ink); }
.community-tab.active { color: var(--accent); font-weight: 700; }
.community-tab.active::after { width: 60%; }

.community-pane { display: none; }
.community-pane.active { display: block; }
.community-pane[hidden] { display: none !important; }

/* ==================== 题壁诗墙留言 ==================== */
.poem-wall { margin-top: 28px; }
.poem-masonry { columns: 3; column-gap: 16px; }

.poem-card {
  break-inside: avoid;
  background: var(--bg-card);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.poem-card:hover {
  box-shadow: var(--shadow-paper);
  transform: translateY(-2px);
}

.poem-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}

.poem-seal {
  width: 32px; height: 32px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-kai); font-size: 16px; font-weight: 700;
  border-radius: var(--radius-small); flex-shrink: 0;
}

.poem-name {
  font-family: var(--font-kai); font-weight: 700;
  font-size: 15px; color: var(--text-ink);
}

.poem-time { margin-left: auto; font-size: 13px; color: var(--text-muted); }

.poem-text {
  font-size: 15px; color: var(--text-secondary); line-height: 1.8;
}

.poem-reply {
  margin-top: 10px; padding: 8px 12px;
  background: var(--bg-section);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-small);
  font-size: 14px; color: var(--text-secondary);
  font-family: var(--font-kai);
}

/* ==================== 信笺表单 ==================== */
.letter-paper {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-paper);
  position: relative;
}
.letter-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  border-top: 2px solid var(--accent);
}

.letter-heading {
  font-family: var(--font-kai);
  font-size: 18px;
  color: var(--text-ink);
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.15em;
}

.letter-form { display: flex; flex-direction: column; gap: 4px; }

.letter-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px dashed var(--border-ink);
}
.letter-row--full { align-items: flex-start; }

.letter-label {
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--accent);
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.1em;
}

.letter-form input,
.letter-form textarea,
.letter-form select {
  flex: 1; min-width: 0;
  padding: 6px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-ink);
  font-family: var(--font);
  font-size: 15px;
  transition: border-color var(--transition);
}
.letter-form input:focus,
.letter-form textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.letter-form textarea { resize: vertical; }
.letter-form select { cursor: pointer; appearance: auto; }
.letter-form input::placeholder,
.letter-form textarea::placeholder {
  color: var(--text-muted); font-style: italic;
}

.load-more { text-align: center; margin-top: 24px; }

/* ==================== 白名单查询结果 ==================== */
.whitelist-check { padding: 0; }

.check-result {
  margin-top: 12px; padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--font-kai);
  font-size: 15px;
}
.status-pending  { background: var(--bg-section); border-left: 3px solid var(--accent); color: var(--text-ink); }
.status-approved { background: var(--bg-section); border-left: 3px solid #2e8b6d; color: #2e8b6d; }
.status-rejected { background: var(--bg-section); border-left: 3px solid #999; color: var(--text-muted); }
.status-notfound { background: var(--bg-section); border-left: 3px solid var(--border-ink); color: var(--text-muted); }

/* ==================== 夜墨冷调补充覆盖 ==================== */
.theme-dark .ink-sidebar {
  background: #1e1e1c;
  border-right-color: rgba(200, 190, 170, 0.08);
}
.theme-dark .sidebar-tab:hover { background: rgba(200, 190, 170, 0.06); }
.theme-dark .sidebar-tab.active { background: rgba(200, 190, 170, 0.08); }
.theme-dark .prologue-right { background: #1e1e1c; }
.theme-dark .chapter-inner { background: transparent; }
.theme-dark .mobile-tabs {
  background: #1e1e1c;
  border-top-color: rgba(200, 190, 170, 0.08);
}
.theme-dark .community-tabs { border-bottom-color: rgba(200, 190, 170, 0.1); }

/* ==================== 移动端底部导航 ==================== */
.mobile-tabs { display: none; }

.mobile-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: color var(--transition);
  position: relative;
}
.mobile-tab.active {
  color: var(--accent);
  font-weight: 700;
}
.mobile-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: var(--accent);
}

/* 响应式规则见 responsive.css */

/* ==================== 服务器卡片 hover / focus 展开图表 ==================== */
.server-card__chart {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease, margin 0.35s ease;
  margin-top: 0;
}
.server-card__chart-inner {
  height: 200px;
  width: 100%;
}
.server-instance:hover .server-card__chart,
.server-instance:focus-within .server-card__chart {
  max-height: 290px;
  opacity: 1;
  margin-top: 12px;
}

/* 触控设备：图表常显（无 hover） */
@media (hover: none) {
  .server-card__chart {
    max-height: 220px;
    opacity: 1;
    margin-top: 12px;
  }
  .server-card__chart-inner { height: 160px; }
}