/* OC 档案馆 · 档案馆/收藏馆 浅色纸感主题 */
* { box-sizing: border-box; }
:root {
  --theme: #6B4FA8;
  --bg: #F4F1EA;
  --card: #FFFFFF;
  --text: #1F2024;
  --muted: #6B7280;
  --line: #E6E3DA;
  --radius: 14px;
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: 1px; color: var(--theme); }
.creator-btn {
  font-size: 12px; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted);
}
.creator-btn:hover { color: var(--theme); border-color: var(--theme); }
.search-link { font-size: 13px; color: var(--muted); margin-right: 12px; }
.search-link:hover { color: var(--theme); }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }
.notice { background: #FFF7E6; border: 1px solid #FFE1A8; color: #8A6D1A; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; }

/* 首页 hero */
.hero { text-align: center; padding: 28px 0 12px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: 2px; }
.hero-sub { color: var(--muted); margin: 0; font-size: 14px; }

/* 卡片网格 */
.grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.card {
  flex: 1 1 260px; min-width: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: block; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.card-body { padding: 12px 14px; }
.card-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-tagline { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; }

.world-cover {
  height: 120px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 65%, #000 15%));
}
.world-cover span { font-size: 44px; color: rgba(255,255,255,0.92); font-weight: 700; }

/* 角色卡 */
.char-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; flex-basis: 240px; }
.avatar {
  flex: 0 0 auto; border-radius: 50%; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 70%, #000 10%));
  font-weight: 700;
}
.badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--theme); color: #fff; font-weight: 400;
}
.back-link { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.back-link:hover { color: var(--theme); }

/* 世界观 banner */
.world-banner {
  padding: 26px 24px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 60%, #000 20%));
}
.world-banner h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 1px; }
.world-banner .hero-sub { color: rgba(255,255,255,0.85); }

.section-title { margin: 28px 0 0; font-size: 16px; font-weight: 700; padding-left: 10px; border-left: 4px solid var(--theme); }
.prose { margin-top: 22px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.prose h2 { margin: 0 0 8px; font-size: 16px; }
.prose p { margin: 0; }

/* 角色详情 */
.chain { margin: 10px 0 18px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain-label { color: var(--muted); }
.chain-node { color: var(--theme); border-bottom: 1px dashed var(--theme); }
.chain-arrow { color: var(--muted); }
.chain-current { font-weight: 600; }
.chain-world { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.world-tag {
  display: inline-block; font-size: 10.5px; padding: 1px 7px; margin-left: 4px;
  border-radius: 999px; background: color-mix(in srgb, var(--theme) 12%, #fff);
  color: var(--theme);
}
.parent-line { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.parent-link { color: var(--theme); border-bottom: 1px dashed var(--theme); margin: 0 2px; }
.char-head {
  display: flex; gap: 18px; align-items: center; padding: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.char-head h1 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.char-sub { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #F1EFE8; color: #555; }
.pill-link { color: var(--theme); background: color-mix(in srgb, var(--theme) 12%, #fff); }
.todo-note { margin-top: 26px; color: var(--muted); font-size: 12.5px; text-align: center; }

.site-footer { text-align: center; color: #9AA0A6; font-size: 12px; padding: 24px 0 32px; }

/* 登录页 */
.login-box { max-width: 420px; margin: 40px auto; padding: 28px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.login-box h1 { margin: 0 0 6px; font-size: 22px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: 5px; }
.login-form input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.btn-primary { margin-top: 6px; padding: 10px; background: var(--theme); color: #fff; border: 0; border-radius: 9px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { filter: brightness(1.05); }
.mode-badge { font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.creator-on { background: color-mix(in srgb, var(--theme) 15%, #fff); color: var(--theme); border: 1px solid var(--theme); }
.inline-form { display: inline; }

/* 服饰图鉴 */
.outfit-grid { margin-top: 16px; }
.outfit-card { cursor: pointer; }
.outfit-cover {
  height: 140px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 60%, #000 15%));
  position: relative; overflow: hidden;
}
.outfit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.outfit-ph { font-size: 36px; color: rgba(255,255,255,0.85); font-weight: 700; }

/* 文稿 */
.text-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.text-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.text-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.text-item summary::-webkit-details-marker { display: none; }
.text-item summary::before { content: '▸'; color: var(--theme); transition: transform .15s; }
.text-item[open] summary::before { transform: rotate(90deg); }
.text-title { font-weight: 600; font-size: 14px; }
.text-tags { font-size: 11px; color: var(--muted); }
.text-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: #333; }

/* 搜索页 */
.search-box { display: flex; gap: 8px; margin: 20px 0; }
.search-box input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.search-box button { padding: 10px 20px; background: var(--theme); color: #fff; border: 0; border-radius: 10px; cursor: pointer; }
.search-section { margin-top: 22px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag-filter a { font-size: 12px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.tag-filter a.active, .tag-filter a:hover { background: var(--theme); color: #fff; border-color: var(--theme); }

/* 灵感来源 */
.inspire-list { margin: 8px 0 0; padding-left: 20px; }
.inspire-list li { margin: 4px 0; font-size: 13.5px; color: #333; }
.inspire-list strong { color: var(--theme); }

/* 服饰卡片提示 */
.outfit-hint {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.35); color: #fff; opacity: 0; transition: opacity .15s;
}
.outfit-card:hover .outfit-hint { opacity: 1; }
.outfit-card { cursor: pointer; }

.section-title-row { display: flex; align-items: center; gap: 12px; margin-top: 28px; }

/* Lightbox */
.lb-overlay[hidden] { display: none; }
.lb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.lb-panel { width: min(900px, 92vw); max-height: 90vh; display: flex; flex-direction: column; }
.lb-head { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 0 0 10px; font-size: 15px; }
.lb-close { background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.lb-body { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 200px; overflow: auto; }
.lb-body img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
.lb-ph { width: 100%; height: 60vh; background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 50%, #000 20%)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.8); font-size: 16px; }
.lb-nav { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; }
.lb-nav button { background: rgba(255,255,255,0.15); color: #fff; border: 0; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.lb-nav span { color: #ccc; font-size: 12px; }

/* 访客模式防复制 */
.guest-mode { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }
.guest-mode img { -webkit-user-drag: none; }

/* 关系网 */
.graph-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.graph-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #555; flex: 1; }
.graph-legend i { display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: 4px; border-top: 2px solid; }
.graph-legend i.derived { border-color:#6B4FA8; border-top-style:dashed; }
.graph-legend i.ally { border-color:#2E7D32; }
.graph-legend i.enemy { border-color:#C0392B; }
.graph-legend i.blood { border-color:#1565C0; }
.graph-legend i.love { border-color:#B0648A; }
.graph-legend i.master { border-color:#8B6914; }
.graph-zoom { display: flex; align-items: center; gap: 6px; }
.graph-zoom button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; }
.graph-zoom button#zreset { width: auto; padding: 0 10px; font-size: 12px; }
.graph-zoom span { font-size: 12px; color: var(--muted); min-width: 44px; text-align: center; }
.graph-stage { width: 100%; height: 60vh; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
.graph-stage svg { display: block; }

/* 角色分条资料 */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 8px; margin-top: 8px; }
.profile-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.profile-item .pk { font-size: 11px; color: var(--muted); }
.profile-item .pv { font-size: 13px; color: #222; font-weight: 500; }

/* 世界模块：词条/阵营/时间线 */
.glossary-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.glossary-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.glossary-term { font-weight: 600; font-size: 14px; color: var(--theme); }
.glossary-def { font-size: 13px; color: #333; margin-top: 4px; }
.faction-card { display: flex; align-items: center; gap: 12px; }
.faction-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--theme); flex-shrink: 0; }
.timeline { position: relative; padding-left: 20px; border-left: 2px solid var(--line); margin: 8px 0; }
.tl-item { position: relative; padding: 8px 0 8px 16px; }
.tl-item::before { content: ''; position: absolute; left: -25px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--theme); }
.tl-date { font-size: 11px; color: var(--muted); }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-content { font-size: 13px; color: #333; margin-top: 2px; }

@media (max-width: 480px) {
  .container { padding: 18px 14px 48px; }
  .hero h1 { font-size: 24px; }
  .char-head { flex-direction: column; align-items: flex-start; }
}

@media print {
  .site-header, .top-nav, .creator-btn, button, .pill-link { display: none !important; }
  body { background: #fff !important; }
  .char-head { background-image: none !important; color: #000 !important; }
  .memo-page { box-shadow: none; }
}

/* 标签 */
.tag-row { display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 6px; }
.tag-pill { display:inline-block; padding:2px 10px; border-radius:999px; font-size:11px; color:var(--text); background:color-mix(in srgb, var(--theme) 14%, #fff); border:1px solid color-mix(in srgb, var(--theme) 30%, transparent); }
.world-banner .tag-pill, .char-head .tag-pill { background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.35); color:#fff; }
