/* ============================================================
   Editor · Lux
   Token 对齐 settings.css
   ============================================================ */

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  overflow: hidden;
}


/* ===== 全局字体统一：全部用 sans-serif ===== */
html, body,
input, textarea, button, select,
.nav .title,
.detail-title,
.detail-view .hero-name,
.detail-view .hero-avatar,
.detail-view .npc-avatar,
.avatar,
.modal-title,
.modal .count-input,
.modal-flip-counter,
.card-avatar,
.back-avatar,
.back-name,
.card-face .name-input,
.done-count,
.detail-view .hero-card .hero-avatar,
.detail-view .name-input {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif !important;
}

/* 全局字体继承 */
input,
textarea,
button,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  letter-spacing: inherit;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== 中文副标题 ===== */
.subtitle-cn {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  margin-top: 2px;
  text-transform: none;
}


/* ===== CSS VARIABLES (LIGHT) ===== */
.editor-app {
  --bg: #f4f5f7;
  --text: #161718;
  --text-secondary: rgba(22, 23, 24, 0.35);
  --text-tertiary: rgba(22, 23, 24, 0.12);
  --card: rgba(255, 255, 255, 0.35);
  --card-hover: rgba(255, 255, 255, 0.5);
  --border: rgba(22, 23, 24, 0.03);
  --border-strong: rgba(22, 23, 24, 0.06);
  --input-bg: rgba(255, 255, 255, 0.15);
  --button-bg: rgba(45, 46, 48, 0.08);
  --button-hover: rgba(45, 46, 48, 0.15);
  --button-primary: #2d2e30;
  --button-primary-text: #f4f5f7;
  --danger: rgba(200, 80, 80, 0.3);
  --dock-bg: rgba(244, 245, 247, 0.85);
  --npc-dot: rgba(22, 23, 24, 0.12);
  --modal-bg: #ffffff;
  --modal-border: rgba(22, 23, 24, 0.08);
  --overlay: rgba(22, 23, 24, 0.28);
  --rule: rgba(22, 23, 24, 0.06);
}

/* ===== CSS VARIABLES (DARK) ===== */
.editor-app[data-theme="dark"] {
  --bg: #0d0e10;
  --text: #e8e6dc;
  --text-secondary: rgba(232, 230, 220, 0.35);
  --text-tertiary: rgba(232, 230, 220, 0.12);
  --card: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.03);
  --border-strong: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(255, 255, 255, 0.04);
  --button-bg: rgba(255, 255, 255, 0.04);
  --button-hover: rgba(255, 255, 255, 0.08);
  --button-primary: #4a4c52;
  --button-primary-text: #e4e2dc;
  --danger: rgba(212, 96, 96, 0.3);
  --dock-bg: rgba(13, 14, 16, 0.85);
  --npc-dot: rgba(232, 230, 220, 0.12);
  --modal-bg: #1c1e22;
  --modal-border: rgba(255, 255, 255, 0.06);
  --overlay: rgba(0, 0, 0, 0.5);
  --rule: rgba(255, 255, 255, 0.06);
}

/* ===== APP ===== */
.editor-app {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

/* ===== 顶部导航 ===== */
.nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
  border-bottom: 0.5px solid var(--border);
}

.nav .back {
  font-size: 24px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px 2px 0;
  font-family: inherit;
  line-height: 1;
  transition: color 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav .back:hover { color: var(--text-secondary); }

.nav .title {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--text);
}

/* ===== 内容区 ===== */
.content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 100px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 分区标题 ===== */
.group-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 4px;
  margin: 24px 0 8px;
}

/* ===== 卡片列表 ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.setting-card:hover {
  background: var(--card-hover);
}

.setting-card:active {
  transform: scale(0.985);
  background: var(--card-hover);
}

/* ===== 头像 ===== */
.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #f4f5f7;
  user-select: none;
}

/* ===== 卡片文字 ===== */
.info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info .name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.info .name .text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-dot {
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--npc-dot);
}

.info .tagline {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.info .wechat {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.info .sub {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  opacity: 0.7;
}

/* ===== 箭头 ===== */
.arrow {
  font-size: 20px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* ===== 底部 Dock ===== */
.dock-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
}

.dock {
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 100px;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 -1px 0 rgba(22, 23, 24, 0.02) inset;
}

.editor-app[data-theme="dark"] .dock {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
}

.dock-tab {
  position: relative;
  appearance: none;
  border: none;
  background: none;
  padding: 8px 22px 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.dock-tab.is-active {
  color: var(--text);
}

.dock-tab::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--text);
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-tab.is-active::after {
  width: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 420px) {
  .content { padding: 0 14px 100px; }
}

/* ============================================================
   角色详情页
   ============================================================ */

.detail-view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.detail-view.active {
  display: flex;
}

/* ---- 详情页顶部导航 ---- */
.detail-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
  border-bottom: 0.5px solid var(--border);
}

.detail-back {
  font-size: 24px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px 2px 0;
  font-family: inherit;
  line-height: 1;
  transition: color 0.2s ease;
}

.detail-back:hover { color: var(--text-secondary); }

.detail-title {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--text);
}

.detail-delete {
  margin-left: auto;
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s ease;
}
.detail-delete:hover {
  color: var(--danger);
}
.detail-delete:active {
  transform: scale(0.95);
}

/* ---- 详情页内容 ---- */
.detail-content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 140px;
}

/* ---- Hero 卡片 ---- */
.detail-view .hero-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  margin-top: 24px;
  text-align: center;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 -1px 0 rgba(22, 23, 24, 0.02) inset;
}

.editor-app[data-theme="dark"] .detail-view .hero-card {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
}

.detail-view .hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 28px;
  color: #f4f5f7;
  user-select: none;
}

.detail-view .hero-name {
  margin-top: 20px;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.detail-view .hero-name .npc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--npc-dot);
}

.detail-view .hero-wechat {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.detail-view .hero-tagline {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ---- 信息卡片 ---- */
.detail-view .card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-top: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.detail-view .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.detail-view .card-head .group-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.detail-view .section-action {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.detail-view .section-action:hover { color: var(--text); }

.detail-view .text-block {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

/* ---- NPC 列表 ---- */
.detail-view .npc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-view .npc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.detail-view .npc-card:not(:last-child) {
  border-bottom: 0.5px solid var(--border);
}

.detail-view .npc-card:active { opacity: 0.55; }

.detail-view .npc-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 14px;
  color: #f4f5f7;
  user-select: none;
}

.detail-view .npc-info { flex: 1; min-width: 0; }

.detail-view .npc-name {
  font-size: 12px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-view .npc-relation {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-view .npc-arrow {
  font-size: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ---- 空状态 ---- */
.detail-view .empty-state {
  padding: 20px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ---- 底部按钮 ---- */
.detail-footer {
  flex: 0 0 auto;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 20px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--bg) 30%,
    var(--bg) 100%);
  pointer-events: none;
}

.detail-footer .btn-primary {
  pointer-events: auto;
  display: block;
  width: 100%;
  appearance: none;
  border: none;
  background: var(--button-primary);
  color: var(--button-primary-text);
  border-radius: 12px;
  padding: 14px 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.detail-footer .btn-primary:active {
  transform: scale(0.985);
  opacity: 0.9;
}

/* ============================================================
   生成关系网弹窗
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#step-input {
  background: var(--modal-bg);
  border: 0.5px solid var(--modal-border);
  border-radius: 24px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.editor-app[data-theme="dark"] #step-input {
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

#step-loading {
  background: var(--modal-bg);
  border: 0.5px solid var(--modal-border);
  border-radius: 24px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.editor-app[data-theme="dark"] #step-loading {
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

.editor-app[data-theme="dark"] .modal {
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---- 弹窗头部 ---- */
.modal-header {
  padding: 26px 26px 0;
}

.modal-eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.modal-title {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.15;
}

.modal-subtitle {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ---- 弹窗内容 ---- */
.modal-body {
  padding: 24px 26px 0;
}

.modal-body .field {
  margin-bottom: 20px;
}

.modal-body .field:last-child {
  margin-bottom: 0;
}

.modal-body .field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.modal .input-card {
  background: rgba(22, 23, 24, 0.025);
  border: 0.5px solid rgba(22, 23, 24, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.editor-app[data-theme="dark"] .modal .input-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.modal .input-card:focus-within {
  border-color: var(--text-secondary);
}

.modal .input-card input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  letter-spacing: 0.02em;
}

.modal .input-card input::placeholder {
  color: var(--text-tertiary);
}

.modal .count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(22, 23, 24, 0.025);
  border: 0.5px solid rgba(22, 23, 24, 0.08);
  border-radius: 12px;
  transition: border-color 0.25s ease;
}

.editor-app[data-theme="dark"] .modal .count-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.modal .count-row:focus-within {
  border-color: var(--text-secondary);
}

.modal .count-label {
  font-size: 13px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
}

.modal .count-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.modal .count-input {
  width: 36px;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 22px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  text-align: right;
  letter-spacing: 0.02em;
  padding: 0;
  -moz-appearance: textfield;
}

.modal .count-input::-webkit-outer-spin-button,
.modal .count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.modal .count-suffix {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

/* 实时预览 */
.modal .live-preview {
  margin-top: 20px;
  padding: 0 26px;
}

.modal .live-preview-text {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  line-height: 1.6;
  min-height: 16px;
}

.modal .live-preview-text .muted {
  color: var(--text-tertiary);
}

/* ---- 弹窗底部 ---- */
.modal-footer {
  padding: 20px 26px 24px;
  display: flex;
  gap: 8px;
  border-top: 0.5px solid var(--rule);
  margin-top: 20px;
}

.modal-btn {
  padding: 13px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-btn:active {
  transform: scale(0.97);
}

.modal-btn.cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 0.5px solid var(--border-strong);
  flex: 0 0 auto;
  min-width: 88px;
}

.modal-btn.cancel:hover {
  background: var(--button-bg);
  color: var(--text);
}

.modal-btn.primary {
  background: var(--button-primary);
  color: var(--button-primary-text);
  letter-spacing: 0.06em;
  flex: 1;
}

.modal-btn.primary:hover {
  opacity: 0.9;
}

/* ============================================================
   NPC 详情页（可编辑）
   ============================================================ */

.detail-view .hero-card .hero-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  cursor: pointer;
}

.detail-view .hero-card .hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 34px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease;
}

.detail-view .hero-card .hero-avatar-wrap:active .hero-avatar {
  transform: scale(0.97);
}

.detail-view .hero-card .hero-avatar-overlay {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  background: rgba(22, 23, 24, 0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}

/* NPC 名字输入 */
.detail-view .name-input {
  width: 100%;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: center;
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
}

.detail-view .name-input:focus {
  border-bottom: 0.5px solid var(--text-tertiary);
}

.detail-view .wechat-input {
  width: 100%;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
  margin-top: 8px;
}

.detail-view .wechat-input:focus {
  color: var(--text);
}

.detail-view .tagline-input {
  width: 100%;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.detail-view .tagline-input:focus {
  color: var(--text);
}

/* 信息行 */
.detail-view .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
}

.detail-view .info-row:last-child {
  border-bottom: none;
}

.detail-view .info-row .label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.detail-view .info-row .value {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
  text-align: right;
}

.detail-view .info-input {
  width: 100%;
  font-size: 13px;
  color: var(--text);
  text-align: right;
  background: transparent;
  border: none;
  outline: none;
  padding: 2px 0;
  letter-spacing: 0.02em;
}

.detail-view .info-input:focus {
  border-bottom: 0.5px solid var(--text-tertiary);
}

.detail-view .info-readonly {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* 可编辑 textarea */
.detail-view .field-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  letter-spacing: 0.02em;
  min-height: 80px;
}

.detail-view .field-textarea::placeholder {
  color: var(--text-tertiary);
}

/* Toast */
.editor-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #2d2e30;
  color: #f4f5f7;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 450;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  white-space: nowrap;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.12);
}

.editor-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.editor-app[data-theme="dark"] .editor-toast {
  background: #e8e6dc;
  color: #161718;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.editor-toast .toast-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 245, 247, 0.65);
}

.editor-app[data-theme="dark"] .editor-toast .toast-icon {
  color: rgba(22, 23, 24, 0.55);
}

.editor-toast .toast-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- 响应式 ---- */
@media (max-width: 420px) {
  .modal-overlay { padding: 16px; }
  .modal { border-radius: 22px; }
  .modal-header { padding: 24px 22px 0; }
  .modal-body { padding: 20px 22px 0; }
  .modal-footer { padding: 18px 22px 20px; }
  .modal-title { font-size: 24px; }
  .modal .live-preview { padding: 0 22px; }
}

/* ============================================================
   列表页空状态
   ============================================================ */

.content .empty-state {
  padding: 28px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.6;
  border: 0.5px dashed var(--border-strong);
  border-radius: 14px;
  margin-top: 4px;
}

/* 列表页第二个分组标题加一点顶部间距 */
.content #characterList .group-label + .list,
.content #characterList .empty-state {
  margin-top: 0;
}

.content #characterList .group-label:not(:first-child) {
  margin-top: 32px;
}

/* ============================================================
   生成弹窗 · 第 2 步（生成中）
   ============================================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px 60px;
}

.loading-dots { display: flex; gap: 8px; }

.loading-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.2;
  animation: luxPulseDot 1.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes luxPulseDot {
  0%, 80%, 100% { opacity: 0.2; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.4); }
}

.loading-text {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   生成弹窗 · 第 3 步（翻页卡片）
   ============================================================ */

#step-flip {
  padding: 24px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-flip-counter {
  text-align: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 16px;
}
.editor-app[data-theme="dark"] .modal-flip-counter {
  color: rgba(232, 230, 220, 0.45);
}

.modal-flip-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1400px;
  touch-action: pan-y;
}

.flip-wrapper {
  width: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}
.flip-wrapper.flipped { transform: rotateY(180deg); }

.card-face {
  width: 100%;
  background: var(--modal-bg);
  border: 0.5px solid var(--modal-border);
  border-radius: 20px;
  padding: 28px 24px 20px;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.06),
    0 12px 48px rgba(0, 0, 0, 0.12);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
}
.editor-app[data-theme="dark"] .card-face {
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 16px 56px rgba(0, 0, 0, 0.5);
}

.card-front { transform: rotateY(0deg); }
.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
}

.corner-btn {
  position: absolute;
  top: 16px; right: 16px;
  appearance: none;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  border-radius: 100px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}
.corner-btn:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
  background: var(--input-bg);
}
.corner-btn:active { transform: scale(0.95); }

.card-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 8px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 26px;
  color: #f4f5f7;
  pointer-events: none;
}
.card-field { margin-bottom: 12px; }
.card-field:last-child { margin-bottom: 0; }
.card-label {
  display: block;
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.card-input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s ease;
  letter-spacing: 0.02em;
  -webkit-user-select: text;
  user-select: text;
}
.card-input:focus { border-color: var(--text-secondary); }

/* 背面 */
.back-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-top: 8px;
}
.back-avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 16px;
  color: #f4f5f7;
}
.back-name {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.2;
}
.back-relation {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.back-persona {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  padding: 0 4px 4px 0;
  max-height: 320px;
}
.back-persona::-webkit-scrollbar { width: 2px; }
.back-persona::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.card-face .add-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 13px 18px;
  border-radius: 12px;
  appearance: none;
  border: none;
  background: var(--button-primary);
  color: var(--button-primary-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.card-face .add-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.modal-close-btn {
  margin: 20px auto 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  appearance: none;
  border: 0.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.editor-app[data-theme="dark"] .modal-close-btn {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(232, 230, 220, 0.65);
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.modal-close-btn:active { transform: scale(0.92); }

.done-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--modal-bg);
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}
.done-state.show { opacity: 1; pointer-events: auto; }

.done-icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--button-primary);
  color: var(--button-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
.done-state.show .done-icon { transform: scale(1); }
.done-icon svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.done-count {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.done-state.show .done-count { opacity: 1; transform: none; }

.done-text {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}
.done-state.show .done-text { opacity: 1; transform: none; }

.generate-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(200, 80, 80, 0.08);
  border: 0.5px solid rgba(200, 80, 80, 0.2);
  border-radius: 10px;
  font-size: 11px;
  color: rgba(200, 80, 80, 0.9);
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.editor-app[data-theme="dark"] .generate-error {
  background: rgba(212, 96, 96, 0.08);
  border-color: rgba(212, 96, 96, 0.25);
  color: rgba(212, 96, 96, 0.9);
}

/* ============================================================
   New Character 按钮
   ============================================================ */

.new-character-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  background: transparent;
  border: 0.5px dashed var(--border-strong);
  border-radius: 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.new-character-btn:hover {
  background: var(--card);
  color: var(--text);
  border-color: var(--text-tertiary);
}

.new-character-btn:active {
  transform: scale(0.985);
}

.new-character-btn .plus {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}

/* ============================================================
   Form Tabs（新建角色页 / NPC 编辑页）
   ============================================================ */

.form-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 28px 0 16px;
  padding: 0 4px;
  border-bottom: 0.5px solid var(--border);
}

.form-tab {
  position: relative;
  appearance: none;
  background: none;
  border: none;
  padding: 8px 4px 14px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.form-tab:hover {
  color: var(--text-secondary);
}

.form-tab.is-active {
  color: var(--text);
}

.form-tab::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--text);
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-tab.is-active::after {
  width: 16px;
}

.form-panel {
  display: none;
}

.form-panel.active {
  display: block;
}

.detail-view .wechat-input:focus {
  color: var(--text);
}

.detail-view .tagline-input:focus {
  color: var(--text);
}

.detail-view .wechat-input::placeholder,
.detail-view .tagline-input::placeholder {
  color: var(--text-secondary);
}

/* 新建角色页的头像（不在 hero-card 里） */
#newAvatarWrap {
  position: relative;
  width: 88px;
  height: 88px;
  cursor: pointer;
}

#newAvatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 34px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease;
}

#newAvatarWrap:active #newAvatar {
  transform: scale(0.97);
}

#newAvatarWrap .hero-avatar-overlay {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  background: rgba(22, 23, 24, 0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}

/* 身份编辑页的头像（同上，复用样式） */
#identityAvatarWrap {
  position: relative;
  width: 88px;
  height: 88px;
  cursor: pointer;
}

#identityAvatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 34px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease;
}

#identityAvatarWrap:active #identityAvatar {
  transform: scale(0.97);
}

#identityAvatarWrap .hero-avatar-overlay {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  background: rgba(22, 23, 24, 0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}

/* ============================================================
   Link modal · checkbox
   ============================================================ */

.link-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 0.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  background: transparent;
}

.link-check svg {
  width: 12px;
  height: 12px;
  stroke: var(--button-primary-text);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.link-check.checked {
  background: var(--button-primary);
  border-color: var(--button-primary);
}

.link-check.checked svg {
  opacity: 1;
}

/* ============================================================
   Link modal · 完整卡片样式（因为弹窗不在 .detail-view 里）
   ============================================================ */

#linkList .npc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

#linkList .npc-card:last-child {
  margin-bottom: 0;
}

#linkList .npc-card:hover {
  background: var(--card-hover);
}

#linkList .npc-card:active {
  transform: scale(0.985);
  background: var(--card-hover);
}

#linkList .npc-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
}

#linkList .npc-info {
  flex: 1;
  min-width: 0;
}

#linkList .npc-name {
  font-size: 13px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#linkList .npc-relation {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 勾选框 */
.link-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 0.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  background: transparent;
}

.link-check svg {
  width: 12px;
  height: 12px;
  stroke: var(--button-primary-text);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.link-check.checked {
  background: var(--button-primary);
  border-color: var(--button-primary);
}

.link-check.checked svg {
  opacity: 1;
}

/* 弹窗里空状态 */
#linkList .empty-state {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* ============================================================
   Nav 图标按钮
   ============================================================ */

.nav-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-icon-btn {
  width: 34px;
  height: 34px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-icon-btn:hover {
  color: var(--text);
  background: var(--input-bg);
}

.nav-icon-btn:active {
  transform: scale(0.92);
}

.nav-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Export modal（复用 Link modal 的卡片样式）
   ============================================================ */

#exportList .npc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

#exportList .npc-card:last-child {
  margin-bottom: 0;
}

#exportList .npc-card:hover {
  background: var(--card-hover);
}

#exportList .npc-card:active {
  transform: scale(0.985);
  background: var(--card-hover);
}

#exportList .npc-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  font-size: 15px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
}

#exportList .npc-info {
  flex: 1;
  min-width: 0;
}

#exportList .npc-name {
  font-size: 13px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#exportList .npc-relation {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#exportList .empty-state {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}