/* === CSS 魔法：主题变量字典 === */
:root {
  --bg-main: #F5F5F7; --bg-panel: #FFFFFF; --bg-dock: rgba(255, 255, 255, 0.7);
  --bg-chat-me: #0071E3; --bg-chat-them: #FFFFFF;
  --text-main: #1D1D1F; --text-muted: #86868B; --text-chat-me: #FFFFFF;
  --accent: #0071E3; --border-light: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03); --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.06);
  --font-ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-serif: 'Georgia', serif;
}

[data-theme="night"] {
  --bg-main: #000000; --bg-panel: #1C1C1E; --bg-dock: rgba(28, 28, 30, 0.7);
  --bg-chat-me: #0A84FF; --bg-chat-them: #2C2C2E;
  --text-main: #F5F5F7; --text-muted: #8E8E93; --text-chat-me: #FFFFFF;
  --accent: #0A84FF; --border-light: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2); --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.3);
  --font-ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-serif: 'Georgia', serif;
}

[data-theme="mood"] {
  --bg-main: #F3EFE7; --bg-panel: #FEFAF0; --bg-dock: rgba(243, 239, 231, 0.8);
  --bg-chat-me: #D8A84A; --bg-chat-them: #FFFFFF;
  --text-main: #2C3E50; --text-muted: #A39D93; --text-chat-me: #1A252C;
  --accent: #C06C62; --border-light: rgba(44, 62, 80, 0.1);
  --shadow-sm: 4px 4px 0px rgba(192, 108, 98, 0.15); 
  --shadow-lg: 8px 8px 0px rgba(192, 108, 98, 0.15);
  --font-ui: 'Futura', 'Trebuchet MS', sans-serif; 
  --font-serif: 'Garamond', 'Georgia', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --c-chat: #527694; --c-travel: #6B8E9B; --c-news: #D8A84A; --c-car: #87402D;
  --c-python: #5C6B8A; --c-moments: #C06C62; --c-forum: #984343; --c-novel: #91BDC2;
  --c-group: #c4a08c; --c-characters: #9a8ba8; --c-adventure: #6B5B95;
  --c-script: #D79B95; --c-backend: #807A6F; --c-worldbook: #8B7355;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  width: 100%;
  height: 100dvh;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-ui);
  overflow: hidden;
  transition: background 0.4s ease;
}

#phone {
  width: 390px; height: 844px; background: var(--bg-main); border-radius: 55px; border: 12px solid #111;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.2);
  position: relative; overflow: hidden; display: flex; flex-direction: column; transition: background 0.5s ease;
  transform-origin: center center;
  flex-shrink: 0;
}
#phone::before {
  content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 35px; background: #000; border-radius: 20px; z-index: 200;
}

.sbar {
  height: 55px; padding: 16px 28px 0; display: flex; justify-content: space-between; align-items: center;
  color: var(--text-main); font-size: 14px; font-weight: 600; flex-shrink: 0; z-index: 210;
}
.theme-toggle { cursor: pointer; font-size: 18px; transition: transform 0.2s; position: relative; z-index: 220; }
.theme-toggle:active { transform: scale(0.8); }

.screens { flex: 1; overflow: hidden; position: relative; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; background: var(--bg-main); }
.screen.active { display: flex; animation: fadeIn 0.25s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

#screen-home { padding: 0; overflow: hidden; }

.widget-time-cal {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-panel); border-radius: 24px; padding: 25px 20px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border-light);
  margin-bottom: 25px;
}
.wtc-time { font-family: var(--font-serif); font-size: 58px; font-weight: normal; color: var(--text-main); line-height: 1; letter-spacing: -0.02em; }
.wtc-cal { display: flex; flex-direction: column; align-items: flex-end; }
.wtc-month { font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 8px; }
.wtc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 5px; font-family: var(--font-ui); font-size: 9px; color: var(--text-muted); text-align: center; width: 110px; }
.wtc-day { width: 10px; height: 10px; font-weight: 500; text-transform: uppercase;}
.wtc-num { font-size: 10px; font-weight: 500; font-family: var(--font-mono); color: var(--text-main); line-height: 1; width: 12px; height: 12px; display: flex; align-items: center; justify-content: center; }
.wtc-num.dim { color: var(--border-light); }
.wtc-num.active { background: var(--accent); color: #fff; border-radius: 50%; }

.middle-row { display: flex; gap: 15px; margin-bottom: 25px; align-items: stretch; }
.widget-weather-square {
  width: 155px; height: 155px; background: var(--bg-panel); border-radius: 24px; padding: 20px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border-light);
  display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0; cursor: pointer;
}
.wws-top { display: flex; justify-content: space-between; align-items: flex-start; }
.wws-temp { font-family: var(--font-serif); font-size: 42px; color: var(--text-main); line-height: 1; }
.wws-icon { font-size: 26px; line-height: 1; }
.wws-bottom { text-align: left; }
.wws-loc { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wws-desc { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.oc-grid { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 10px; align-content: center; }

.app-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 10px 10px; }

/* 🌟 修改点：整体缩小桌面图标、间距 */
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 12px; margin-bottom: 20px; }
.app-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.2s; }
.app-item:active { transform: scale(0.85); }
.app-icon {
  width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: var(--shadow-sm); color: #FFF; margin-bottom: 6px;
}
.app-label { font-size: 11px; font-weight: 500; color: var(--text-main); text-align: center; white-space: nowrap; font-family: var(--font-serif); letter-spacing: 0.03em; }

/* 桌面分页指示器 */
.page-indicator {
  display: flex; justify-content: center; align-items: center; gap: 8px; z-index: 40;
}
.page-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  opacity: 0.4; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer;
}
.page-dot.active { opacity: 1; background: var(--text-main); width: 16px; border-radius: 4px; }

/* 🌟 修改点：Dock 栏变细，图标也缩小了 */
.dock {
  height: 65px; background: var(--bg-dock); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 25px; border: 1px solid var(--border-light);
  display: flex; justify-content: space-around; align-items: center; padding: 0 15px;
  z-index: 50; box-shadow: var(--shadow-lg);
}
.dock .app-icon { width: 44px; height: 44px; background: transparent !important; box-shadow: none; font-size: 24px; margin-bottom: 2px; color: var(--text-main); }
.dock .app-label { font-size: 10px; font-weight: 500; margin-top: 0; font-family: var(--font-ui); }


/* === 通用页面头部 === */
.mod-hdr { 
  display: flex; align-items: center; justify-content: space-between; padding: 15px 24px; 
  flex-shrink: 0; background: rgba(var(--bg-main), 0.85); backdrop-filter: blur(10px); z-index: 10;
  border-bottom: 1px solid var(--border-light);
}
.back { font-size: 24px; color: var(--accent); cursor: pointer; transition: opacity 0.2s; font-weight: 300; }
.back:active { opacity: 0.5; }
.mod-title { font-size: 17px; font-weight: 600; color: var(--text-main); }
.mod-action { background: none; border: none; color: var(--accent); font-size: 15px; font-weight: 500; cursor: pointer; }

/* ── 聊天顶栏 ── */
.chat-hdr { padding: 10px 16px; }
.chat-hdr-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chat-hdr-name-row { display: flex; align-items: center; gap: 7px; }
.chat-status-badge {
  font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px; border: 1px solid;
}
.chat-status--online  { color: #34C759; border-color: #34C759; background: rgba(52,199,89,0.1); }
.chat-status--offline { color: #8E8E93; border-color: #8E8E93; background: rgba(142,142,147,0.12); }
.chat-hdr-loc { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }

/* === 统一聊天组件 === */
.chat-list { flex: 1; overflow-y: auto; padding: 10px 0; }
.chat-list::-webkit-scrollbar { display: none; }
.contact-row { display: flex; align-items: center; gap: 15px; padding: 15px 24px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.c-avatar { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--bg-panel); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.c-info { flex: 1; overflow: hidden; }
.c-name { font-size: 16px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.c-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-serif); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; touch-action: pan-y; }
.chat-msgs::-webkit-scrollbar { display: none; }
.bub { display: block; width: fit-content; max-width: 100%; padding: 14px 18px; font-size: inherit; line-height: 1.5; font-family: var(--font-serif); box-shadow: var(--shadow-sm); word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
.bub.me { background: var(--bg-chat-me); color: var(--text-chat-me); border-radius: 24px 24px 6px 24px; }
.bub.them { background: var(--bg-chat-them); color: var(--text-main); border-radius: 24px 24px 24px 6px; border: 1px solid var(--border-light); }
.chat-bar { padding: 12px 24px 30px; display: flex; gap: 12px; align-items: flex-end; background: var(--bg-main); border-top: 1px solid var(--border-light); }
.adv-mode-tabs { display: flex; gap: 4px; padding: 8px 12px 4px; background: var(--bg-panel); border-top: 1px solid var(--border-light); align-items: center; }
.adv-mode-tab { flex: 1; padding: 6px 0; border: 1px solid var(--border-light); border-radius: 16px; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; transition: all 0.2s; }
.adv-mode-tab.active { background: var(--accent); color: white; border-color: var(--accent); font-weight: 600; }
.adv-mode-gear { width: 32px; height: 32px; border: none; background: transparent; font-size: 16px; cursor: pointer; flex-shrink: 0; border-radius: 50%; transition: background 0.2s; }
.adv-mode-gear:active { background: var(--border-light); }
.write-settings-panel { background: var(--bg-panel); border-top: 1px solid var(--border-light); max-height: 55vh; overflow-y: auto; animation: wsSlideUp 0.25s ease; }
@keyframes wsSlideUp { from { max-height: 0; opacity: 0; } to { max-height: 55vh; opacity: 1; } }
.ws-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 8px; position: sticky; top: 0; background: var(--bg-panel); z-index: 1; }
.ws-title { font-size: 14px; font-weight: 600; color: var(--text-main); }
.ws-close { padding: 4px 12px; border-radius: 12px; border: 1px solid var(--border-light); background: var(--accent); color: white; font-size: 12px; font-weight: 500; cursor: pointer; }
.ws-body { padding: 4px 16px 16px; }
.ws-group { margin-bottom: 16px; }
.ws-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.ws-range-row { display: flex; align-items: center; gap: 10px; }
.ws-number-input { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-light); background: var(--bg-main); color: var(--text-main); font-size: 15px; text-align: center; font-family: var(--font-mono); }
.ws-range-sep { color: var(--text-muted); font-size: 16px; }
.ws-seg { display: flex; gap: 0; border-radius: 10px; border: 1px solid var(--border-light); overflow: hidden; }
.ws-seg-btn { flex: 1; padding: 8px 0; border: none; background: var(--bg-main); color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all 0.2s; border-right: 1px solid var(--border-light); }
.ws-seg-btn:last-child { border-right: none; }
.ws-seg-btn.active { background: var(--accent); color: white; font-weight: 600; }
.ws-nav-section { background: var(--bg-main); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.ws-nav-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border-light); }
.ws-nav-row:last-child { border-bottom: none; }
.ws-nav-row:active { background: rgba(0,0,0,0.03); }
.ws-nav-label { font-size: 14px; font-weight: 500; color: var(--text-main); }
.ws-nav-value { font-size: 13px; color: var(--text-muted); }
.ws-section-title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 16px; padding-top: 4px; }
.plus-btn { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-panel); border: 1px solid var(--border-light); color: var(--text-main); font-size: 20px; font-weight: 300; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.plus-btn:active { transform: scale(0.95); background: var(--bg-main); }
.identity-indicator { display: none !important; padding: 8px 14px; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 18px; font-size: 13px; color: var(--text-main); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: all 0.2s; }
.identity-indicator:active { transform: scale(0.95); background: var(--bg-main); }
.chat-inp { flex: 1; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 24px; padding: 12px 18px; color: var(--text-main); font-family: var(--font-ui); font-size: 15px; outline: none; resize: none; min-height: 44px; max-height: 120px; overflow-y: auto; line-height: 1.4; box-shadow: var(--shadow-sm); transition: height 0.1s ease; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* === 功能面板（SullyOS 风格） === */
.adventure-panel { 
  height: 288px; 
  background: var(--bg-panel); 
  border-top: 1px solid var(--border-light); 
  overflow: hidden; 
  flex-shrink: 0;
}
.panel-content { 
  height: 100%; 
  overflow-y: auto; 
  padding: 24px; 
}
.panel-grid { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 32px; 
}
.panel-btn { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 8px; 
  cursor: pointer; 
  background: none; 
  border: none; 
  transition: transform 0.2s;
}
.panel-btn:active { transform: scale(0.95); }
.panel-btn-icon { 
  width: 56px; 
  height: 56px; 
  border-radius: 16px; 
  background: var(--bg-main); 
  border: 1px solid var(--border-light); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 24px; 
  box-shadow: var(--shadow-sm);
}
.panel-btn-label { 
  font-size: 12px; 
  font-weight: 600; 
  color: var(--text-main); 
}
.toolbar-icon { font-size: 28px; }
.toolbar-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.adventure-menu-item:hover { background: var(--bg-main); }
.adventure-menu-item:active { transform: scale(0.98); }
.typewriter-cursor::after { content: '|'; animation: blink 1s step-end infinite; margin-left: 2px; color: var(--accent); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* === Feed 流 & 旅行日志列表新增 === */
.feed-wrap, .backend-wrap { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg-main); }
.feed-wrap::-webkit-scrollbar, .backend-wrap::-webkit-scrollbar { display: none; }

.journal-card { background: var(--bg-panel); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); }
.journal-title { font-family: var(--font-serif); font-size: 24px; font-weight: bold; color: var(--accent); margin-bottom: 5px; }
.journal-sub { font-size: 12px; color: var(--text-muted); letter-spacing: 0.1em; margin-bottom: 20px; }
.journal-body { font-family: var(--font-serif); font-size: 15px; line-height: 2.0; color: var(--text-main); }

.feed-list-item {
  background: var(--bg-panel); border-radius: 16px; padding: 20px;
  margin-bottom: 15px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  cursor: pointer; transition: transform 0.2s;
}
.feed-list-item:active { transform: scale(0.98); }
.fli-title { font-family: var(--font-serif); font-size: 18px; font-weight: bold; color: var(--accent); margin-bottom: 6px; }
.fli-date { font-size: 12px; color: var(--text-muted); font-family: var(--font-ui); letter-spacing: 0.05em; }

.form-group { margin-bottom: 20px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 0.05em; }
.form-inp { width: 100%; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 12px; padding: 14px; color: var(--text-main); font-family: var(--font-ui); font-size: 14px; outline: none; }
.form-area { width: 100%; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 12px; padding: 14px; color: var(--text-main); font-family: var(--font-serif); font-size: 14px; outline: none; resize: none; height: 100px; line-height: 1.5; }
.btn-primary { width: 100%; padding: 14px; border-radius: 12px; border: none; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }

.member-checkbox { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.member-checkbox:hover { background: var(--bg-main); }
.member-checkbox input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }
.member-checkbox span { font-size: 15px; color: var(--text-main); }

.toast { position: absolute; top: 70px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--text-main); color: var(--bg-main); padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 1000; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.identity-picker-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 9999; display: flex; align-items: flex-end; backdrop-filter: blur(4px); }
.identity-picker { background: var(--bg-panel); border-radius: 20px 20px 0 0; width: 100%; max-height: 60%; overflow-y: auto; padding: 20px; box-shadow: var(--shadow-lg); }
.identity-picker::-webkit-scrollbar { display: none; }
.picker-title { font-size: 18px; font-weight: 600; color: var(--text-main); margin-bottom: 15px; text-align: center; }
.identity-option { padding: 15px; background: var(--bg-main); border-radius: 12px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.identity-option:active { transform: scale(0.98); }
.identity-option.active { background: var(--accent); border-color: var(--accent); }
.identity-option.active .identity-option-name,
.identity-option.active .identity-option-desc { color: #fff; }
.identity-option-name { font-size: 16px; font-weight: 600; color: var(--text-main); display: block; margin-bottom: 4px; }
.identity-option-desc { font-size: 13px; color: var(--text-muted); display: block; }

.entry-item { background: var(--bg-main); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; border: 1px solid var(--border-light); }
.entry-item:hover { background: var(--bg-panel); transform: translateX(2px); }
.entry-item:active { transform: scale(0.98); }
.entry-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.entry-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-muted); }
.entry-keywords { color: var(--accent); font-weight: 500; }
.entry-depth { color: var(--text-muted); }

.chat-container { display: flex; width: 200%; height: 100%; transition: transform 0.3s ease; transform: translateX(-50%); }
.chat-container.show-memory { transform: translateX(0); }
.chat-page { width: 50%; flex-shrink: 0; display: flex; flex-direction: column; height: 100%; }
.memory-page { background: var(--bg-main); display: flex; flex-direction: column; height: 100%; }
.memory-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; min-height: 0; -webkit-overflow-scrolling: touch; }
.memory-list::-webkit-scrollbar { display: none; }
.memory-item { background: var(--bg-panel); border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.memory-item .date { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.memory-item .content { font-size: 14px; line-height: 1.6; color: var(--text-main); margin-bottom: 12px; white-space: pre-wrap; }
.memory-item .actions { display: flex; gap: 8px; }
.btn-secondary { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-light); background: var(--bg-main); color: var(--text-main); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-secondary:active { transform: scale(0.95); background: var(--bg-panel); }

.adventure-card { background: var(--bg-panel); border-radius: 12px; padding: 16px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s; }
.adventure-card:active { transform: scale(0.98); background: var(--bg-hover); }
.adventure-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.adventure-title { font-size: 16px; font-weight: 600; color: var(--text-main); }
.adventure-meta { font-size: 12px; color: var(--text-muted); }
.adventure-chars { font-size: 14px; color: var(--text-main); margin-bottom: 8px; padding: 8px 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.adventure-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.btn-text { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 8px; transition: color 0.2s; }
.btn-text:hover { color: var(--text-main); }
.btn-text:active { transform: scale(0.95); }

.backend-tabs { display: flex; background: var(--bg-panel); border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 10; }
.backend-tab { flex: 1; padding: 16px; text-align: center; font-size: 15px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s; border-bottom: 2px solid transparent; }
.backend-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.backend-tab:active { transform: scale(0.98); }
.backend-content { padding: 12px; overflow-y: auto; height: calc(100% - 120px); }

.backend-char-item { background: var(--bg-panel); border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: all 0.2s; border: 1px solid var(--border-light); }
.backend-char-item:active { transform: scale(0.98); box-shadow: none; }
.backend-char-header { display: flex; align-items: center; margin-bottom: 12px; }
.backend-char-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--bg-main); margin-right: 12px; flex-shrink: 0; }
.backend-char-info { flex: 1; min-width: 0; }
.backend-char-name { font-size: 16px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.backend-char-meta { font-size: 13px; color: var(--text-muted); }
.backend-char-preview { font-size: 14px; color: var(--text-muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }

.msg-action-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 9999; display: flex; align-items: flex-end; opacity: 0; transition: opacity 0.3s ease; }
.msg-action-overlay.show { opacity: 1; }
.msg-action-overlay.show .msg-action-sheet { transform: translateY(0); }
.msg-action-sheet { width: 100%; background: var(--bg-panel); border-radius: 16px 16px 0 0; padding: 8px; transform: translateY(100%); transition: transform 0.3s ease; box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15); }
.msg-action-item { padding: 16px 20px; font-size: 16px; color: var(--text-main); background: var(--bg-main); border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; text-align: center; font-weight: 500; }
.msg-action-item:active { transform: scale(0.98); background: var(--bg-chat-them); }
.msg-action-cancel { color: var(--text-muted); margin-top: 4px; }

.msg-wrapper { position: relative; }
.msg-actions { display: flex; gap: 8px; margin-top: 6px; }
.btn-icon { background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.btn-icon:active { transform: scale(0.95); box-shadow: none; }
.btn-icon:hover { background: var(--bg-main); }

.palette-item:hover { background: var(--bg-chat-them); }
.palette-item:active { transform: scale(0.98); }

.npc-option { padding: 12px; margin-bottom: 8px; border-radius: 8px; background: var(--bg-main); cursor: pointer; transition: all 0.2s; }
.npc-option:hover { background: var(--bg-chat-them); transform: translateX(4px); }
.npc-option:active { transform: scale(0.98); }

.home-pages { display: flex; width: 100%; height: 100%; transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1); }
.home-pages.dragging { transition: none !important; }
.home-page { min-width: 100%; height: 100%; flex-shrink: 0; padding: 10px 24px 0; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
.home-page::-webkit-scrollbar { display: none; }

/* 造梦工坊 */
.dc-tag { padding: 8px 14px; border-radius: 18px; background: var(--bg-panel); border: 1px solid var(--border-light); font-size: 13px; color: var(--text-main); cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.dc-tag:active { transform: scale(0.95); }
.dc-sel-world { background: #6B8E9B; color: #FFF; border-color: #6B8E9B; }
.dc-sel-vibe { background: #9a8ba8; color: #FFF; border-color: #9a8ba8; }
.dc-sel-tone { background: #C06C62; color: #FFF; border-color: #C06C62; }
.dc-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-light); transition: all 0.3s; }
.dc-step-dot.active { background: var(--accent); transform: scale(1.3); }
.dc-step-dot.done { background: var(--text-muted); opacity: 0.5; }
.dc-preview-card { background: var(--bg-panel); border-radius: 16px; padding: 18px; margin-bottom: 15px; border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); }
.dc-card-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.dc-regen-mini { background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px; transition: opacity 0.2s; }
.dc-regen-mini:active { opacity: 0.5; }
.dc-char-name { font-size: 17px; font-weight: bold; margin-bottom: 8px; color: var(--text-main); }
.dc-char-desc { font-size: 14px; line-height: 1.6; color: var(--text-main); }
.dc-wb-entry { margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; }
.dc-wb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex-shrink: 0; opacity: 0.8; }
.dc-field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.dc-opening { font-size: 15px; line-height: 1.8; color: var(--text-main); padding: 16px; background: var(--bg-panel); border-radius: 12px; font-family: var(--font-serif); border: 1px solid var(--border-light); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.dc-secondary-btn { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--border-light); background: transparent; color: var(--text-main); font-size: 15px; font-weight: 500; cursor: pointer; margin-top: 10px; transition: background 0.2s; }
.dc-secondary-btn:active { background: var(--border-light); }
@keyframes dc-spin { 100% { transform: rotate(360deg); } }

/* ═══ 入梦聊天：情节卡片 & 导演指令 ═══ */
.adv-card { background: var(--bg-panel); border-radius: 14px; padding: 16px 18px; border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); }
.adv-card--ai { border-right: 3px solid rgba(60,50,40,0.18); box-shadow: -4px 4px 0px rgba(60,50,40,0.12); }
.adv-card--user { background: var(--bg-main); border-left: 3px solid var(--accent); }
.adv-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.adv-card-name { font-size: 13px; font-weight: 700; color: var(--text-main); }
.adv-card-meta { font-size: 11px; color: var(--text-muted); }
.adv-card-body { font-family: var(--font-serif); line-height: 1.85; color: var(--text-main); word-wrap: break-word; white-space: pre-wrap; }
.adv-quote { background: rgba(100,130,210,0.22); border-radius: 3px; padding: 0 1px; }
.adv-status-bar { display: flex; gap: 10px; margin: 8px 0 0; align-items: flex-start; }
.adv-avatar { width: 44px; height: 54px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; opacity: 0.8; }
.adv-status-info { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 2px 0; }
.adv-status-row { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.adv-divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.adv-inner-voice { }
.adv-voice-quote { font-family: var(--font-serif); font-size: 14px; line-height: 1.75; color: var(--text-main); padding: 0 4px; }
.adv-voice-quote::before { content: '\201C'; font-size: 26px; color: var(--accent); opacity: 0.45; line-height: 0; vertical-align: -0.32em; margin-right: 3px; font-family: Georgia, serif; }
.adv-voice-quote::after { content: '\201D'; font-size: 26px; color: var(--accent); opacity: 0.45; line-height: 0; vertical-align: -0.32em; margin-left: 3px; font-family: Georgia, serif; }
.adv-voice-meta { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 4px; }
.adv-voice-row { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); }
.adv-voice-label { flex-shrink: 0; min-width: 46px; }
.adv-directive { display: flex; justify-content: center; margin: 4px 0; }

/* ── AI 生成中占位卡片 ── */
.adv-pending-card { opacity: 0.72; }
.adv-pending-dots { display: inline-flex; gap: 6px; align-items: center; padding: 6px 2px; }
.adv-pending-dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: advDotPulse 1.4s ease-in-out infinite; }
.adv-pending-dots span:nth-child(2) { animation-delay: 0.28s; }
.adv-pending-dots span:nth-child(3) { animation-delay: 0.56s; }
@keyframes advDotPulse { 0%, 60%, 100% { opacity: 0.2; transform: translateY(0) scale(0.85); } 30% { opacity: 1; transform: translateY(-5px) scale(1.1); } }

/* ── 思考过程折叠块 ── */
.adv-thinking-wrap { margin-bottom: 10px; }
.adv-thinking-toggle { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; padding: 2px 4px; border-radius: 4px; font-size: 11px; color: var(--text-muted); cursor: pointer; opacity: 0.6; transition: opacity 0.15s; }
.adv-thinking-toggle:active { opacity: 1; }
.adv-thinking-label-hide { display: none; }
.adv-thinking-wrap.open .adv-thinking-label-show { display: none; }
.adv-thinking-wrap.open .adv-thinking-label-hide { display: inline; }
.adv-thinking-content { display: none; margin-top: 6px; padding: 10px 12px; background: rgba(128,128,128,0.07); border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; font-size: 12px; color: var(--text-muted); line-height: 1.65; font-family: var(--font-serif); white-space: pre-wrap; word-break: break-word; }
.adv-thinking-wrap.open .adv-thinking-content { display: block; }

/* ═══ ST 预设管理 ═══ */
.preset-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-panel); border-radius: 12px; margin-bottom: 10px; border: 1.5px solid var(--border-light); cursor: pointer; transition: border-color 0.2s; }
.preset-item--active { border-color: var(--accent); background: rgba(120,90,60,0.07); }
.preset-item-info { flex: 1; min-width: 0; }
.preset-item-name { font-size: 15px; font-weight: 600; color: var(--text-main); }
.preset-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.preset-item-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: 10px; }
.preset-btn-modules { font-size: 12px; padding: 5px 10px; border-radius: 8px; border: none; cursor: pointer; background: var(--border-light); color: var(--text-main); }
.preset-btn-regex { font-size: 12px; padding: 5px 10px; border-radius: 8px; border: none; cursor: pointer; background: rgba(80,120,200,0.12); color: #5078c8; }
.preset-btn-delete { font-size: 12px; padding: 5px 10px; border-radius: 8px; border: none; cursor: pointer; background: rgba(180,60,60,0.12); color: #b44444; }
.module-divider { padding: 14px 0 4px; font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--border-light); margin-bottom: 2px; }
.module-divider:first-child { padding-top: 4px; }
.ws-preset-hint { font-size: 11px; color: var(--accent); margin-top: 5px; opacity: 0.8; }
.module-item { border-bottom: 1px solid var(--border-light); }
.module-item-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; cursor: pointer; user-select: none; }
.module-item-header:active { opacity: 0.7; }
.module-item-info { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.module-item-expand { font-size: 11px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s; }
.module-item--open .module-item-expand { transform: rotate(90deg); }
.module-item-name { font-size: 14px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-content-area { display: none; padding: 0 0 12px; }
.module-item--open .module-content-area { display: block; }
.module-content-input { width: 100%; box-sizing: border-box; font-size: 12px; font-family: var(--font-mono, monospace); background: rgba(128,128,128,0.07); border: 1px solid var(--border-light); border-radius: 6px; padding: 8px 10px; color: var(--text-main); resize: vertical; line-height: 1.5; outline: none; }
.module-content-input:focus { border-color: var(--accent); }
.module-content-actions { display: flex; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.module-content-actions button { font-size: 12px; padding: 5px 14px; border-radius: 8px; border: none; background: var(--accent); color: #fff; cursor: pointer; }
.module-btn-cancel { background: rgba(128,128,128,0.15) !important; color: var(--text-main) !important; }
.module-role-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.module-role-user { background: rgba(60,120,180,0.15); color: #3c78b4; }
.module-role-assistant { background: rgba(60,160,100,0.15); color: #3ca064; }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border-light); border-radius: 22px; transition: 0.25s; }
.toggle-slider:before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.25s; }
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider:before { transform: translateX(18px); }
.adv-directive-pill { display: inline-block; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 20px; padding: 5px 16px; font-size: 12px; font-style: italic; color: var(--text-muted); max-width: 76%; text-align: center; }

/* ═══ 入梦聊天：集成输入条 ═══ */
.adv-chat-bar { padding: 10px 14px 24px; background: var(--bg-main); border-top: 1px solid var(--border-light); }
.adv-input-pill { display: flex; align-items: flex-end; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 26px; padding: 4px 6px 4px 14px; gap: 6px; box-shadow: var(--shadow-sm); }
.adv-input-pill textarea { flex: 1; border: none; background: transparent; resize: none; outline: none; padding: 8px 0; font-family: var(--font-ui); color: var(--text-main); min-height: 36px; max-height: 120px; overflow-y: auto; line-height: 1.4; }
.adv-pill-menu { width: 32px; height: 32px; border-radius: 50%; background: none; border: none; color: var(--text-muted); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 2px; }
.adv-pill-menu:active { color: var(--text-main); }
.adv-pill-send { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 1px; transition: opacity 0.15s; }
.adv-pill-send:active { opacity: 0.75; }

/* ═══════════════════════════════════════════════════════════
   论坛互动模块
   ═══════════════════════════════════════════════════════════ */

/* ── 论坛首页布局 ── */
.forum-page { display: flex; flex-direction: column; height: 100%; }

/* ── 板块 Tab 横向滑动条 ── */
.forum-board-tabs { display: flex; overflow-x: auto; padding: 0 16px; gap: 0; flex-shrink: 0; border-bottom: 1px solid var(--border-light); scrollbar-width: none; }
.forum-board-tabs::-webkit-scrollbar { display: none; }
.forum-board-tab { display: flex; flex-direction: column; align-items: center; padding: 8px 14px 10px; cursor: pointer; flex-shrink: 0; color: var(--text-muted); font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.18s, border-color 0.18s; white-space: nowrap; gap: 3px; }
.forum-tab-icon { font-size: 18px; line-height: 1; }
.forum-board-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── 帖子列表 ── */
.forum-post-list { flex: 1; overflow-y: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.forum-post-card { background: var(--bg-panel); border-radius: 14px; padding: 14px 14px 12px; border: 1px solid var(--border-light); cursor: pointer; box-shadow: var(--shadow-sm); transition: opacity 0.15s, transform 0.1s; }
.forum-post-card:active { opacity: 0.82; transform: scale(0.99); }
.forum-post-card-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.forum-post-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.forum-post-author { font-size: 13px; color: var(--text-muted); }
.forum-post-board-tag { font-size: 11px; background: var(--bg-secondary); color: var(--text-muted); border-radius: 4px; padding: 2px 6px; margin-left: auto; flex-shrink: 0; }
.forum-post-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 5px; line-height: 1.45; }
.forum-post-preview { font-size: 13px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-post-footer { display: flex; align-items: center; margin-top: 10px; }
.forum-post-meta { font-size: 11px; color: var(--text-muted); }
.forum-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); gap: 8px; padding: 40px 20px; text-align: center; }
.forum-empty-icon { font-size: 52px; opacity: 0.4; }

/* ── 帖子详情页 ── */
.forum-post-page { display: flex; flex-direction: column; height: 100%; }
.forum-floors { flex: 1; overflow-y: auto; padding: 0 16px 8px; }
.forum-floor { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.forum-floor:last-child { border-bottom: none; }
.forum-floor-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.forum-floor-body { flex: 1; min-width: 0; }
.forum-floor-hdr { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.forum-floor-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.forum-floor-num { font-size: 11px; color: var(--text-muted); }
.forum-floor-ts { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.forum-floor-op-title { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; line-height: 1.45; }
.forum-floor-content { font-size: 14px; color: var(--text-main); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* ── 回复输入条 ── */
.forum-reply-bar { padding: 10px 14px 26px; background: var(--bg-main); border-top: 1px solid var(--border-light); display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; position: relative; }
.forum-reply-inp { flex: 1; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 20px; padding: 10px 14px; color: var(--text-main); font-family: var(--font-ui); font-size: 14px; outline: none; resize: none; min-height: 40px; max-height: 100px; overflow-y: auto; line-height: 1.4; box-shadow: var(--shadow-sm); }
.forum-ai-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-panel); border: 1.5px solid var(--border-light); color: var(--text-muted); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); transition: opacity 0.15s; }
.forum-ai-btn:disabled { opacity: 0.45; }
.forum-send-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.15s; }
.forum-send-btn:active { opacity: 0.75; }

/* ── 发帖 Modal ── */
.forum-modal { position: fixed; inset: 0; z-index: 2000; display: none; }
.forum-modal.visible { display: block; }
.forum-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.42); }
.forum-modal-sheet { position: absolute; bottom: 0; left: 0; right: 0; background: var(--bg-panel); border-radius: 20px 20px 0 0; padding: 20px 20px 38px; display: flex; flex-direction: column; gap: 16px; max-height: 88vh; overflow-y: auto; animation: forumSheetUp 0.26s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes forumSheetUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.forum-modal-hdr { display: flex; align-items: center; justify-content: space-between; }
.forum-modal-hdr span { font-size: 16px; font-weight: 600; color: var(--text-main); }
.forum-modal-hdr button { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: 4px 6px; line-height: 1; }
.forum-form-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.forum-form-input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 14px; color: var(--text-main); font-family: var(--font-ui); font-size: 14px; outline: none; box-sizing: border-box; }
.forum-form-textarea { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 14px; color: var(--text-main); font-family: var(--font-ui); font-size: 14px; outline: none; resize: none; min-height: 90px; max-height: 180px; line-height: 1.55; box-sizing: border-box; }
.forum-form-select { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 14px; color: var(--text-main); font-family: var(--font-ui); font-size: 14px; outline: none; }
.forum-author-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.forum-author-pill { padding: 6px 16px; border-radius: 20px; border: 1.5px solid var(--border-light); color: var(--text-muted); font-size: 13px; cursor: pointer; background: none; transition: all 0.15s; }
.forum-author-pill.active { border-color: var(--accent); color: var(--accent); }
.forum-char-picker { flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; margin-top: 6px; }
.forum-char-pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.forum-char-pick-item:active { background: var(--bg-secondary); }
.forum-char-pick-item.selected { background: var(--bg-secondary); outline: 2px solid var(--accent); border-radius: 8px; }
.forum-char-av { font-size: 22px; line-height: 1; }
.forum-char-nm { font-size: 14px; color: var(--text-main); }
.forum-submit-btn { background: var(--accent); color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; transition: opacity 0.15s; }
.forum-submit-btn:disabled { opacity: 0.5; cursor: default; }

/* ── @mention 角色选择弹窗 (v20260527b) ── */
.forum-at-picker { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; max-height: 164px; overflow-y: auto; z-index: 200; box-shadow: 0 -4px 18px rgba(0,0,0,0.22); }
.forum-at-item { display: flex; align-items: center; gap: 9px; padding: 9px 14px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.forum-at-item:hover, .forum-at-item:active { background: var(--bg-tertiary, var(--bg-main)); }
.forum-at-av { font-size: 18px; line-height: 1; flex-shrink: 0; }
/* ── 关系网 NPC 生成器 (v20260527c) ── */
.rn-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rn-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 16px 0; line-height: 1.6; }
.rn-card { border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; background: var(--bg-main); transition: opacity 0.2s; }
.rn-card-added { opacity: 0.55; }
.rn-card-hdr { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; cursor: pointer; user-select: none; gap: 8px; }
.rn-card-hdr:active { background: var(--bg-panel); }
.rn-card-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.rn-av { font-size: 24px; line-height: 1; flex-shrink: 0; }
.rn-card-meta { flex: 1; min-width: 0; overflow: hidden; }
.rn-name { font-size: 14px; font-weight: 600; color: var(--text-main); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-rel { font-size: 11px; color: var(--text-muted); background: var(--bg-panel); padding: 2px 7px; border-radius: 8px; border: 1px solid var(--border-light); white-space: nowrap; display: inline-block; margin-top: 3px; }
.rn-card-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.rn-btn { padding: 4px 9px; border-radius: 7px; border: 1px solid var(--border-light); font-size: 12px; cursor: pointer; background: var(--bg-panel); color: var(--text-main); font-family: var(--font-ui); white-space: nowrap; transition: opacity 0.15s; line-height: 1.4; }
.rn-btn-regen { color: var(--text-muted); }
.rn-btn-regen:active { opacity: 0.6; }
.rn-btn-add { color: var(--accent); border-color: var(--accent); }
.rn-btn-done { color: var(--text-muted); border-color: var(--border-light); }
.rn-btn-del { color: #D0504A; }
.rn-btn:disabled { opacity: 0.45; cursor: default; }
.rn-arrow { font-size: 9px; color: var(--text-muted); margin-left: 2px; flex-shrink: 0; }
.rn-card-body { padding: 10px 12px 14px; border-top: 1px solid var(--border-light); background: var(--bg-panel); display: flex; flex-direction: column; gap: 8px; }
.rn-fields-row { display: flex; gap: 7px; }
.rn-inp { padding: 7px 10px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-main); color: var(--text-main); font-family: var(--font-ui); font-size: 13px; outline: none; }
.rn-inp-av   { width: 52px; text-align: center; font-size: 19px; flex-shrink: 0; }
.rn-inp-name { flex: 1; min-width: 0; }
.rn-inp-rel  { width: 120px; flex-shrink: 0; }
.rn-textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-main); color: var(--text-main); font-family: var(--font-ui); font-size: 13px; outline: none; resize: none; line-height: 1.6; box-sizing: border-box; }
.rn-action-btn { padding: 5px 12px; border-radius: 8px; border: 1.5px solid var(--border-light); background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: var(--font-ui); transition: opacity 0.15s; }
.rn-generate-btn { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.rn-generate-btn:disabled { opacity: 0.5; cursor: default; }

/* ── 世界书绑定（后台角色设定）── */
.wb-bind-list { display:flex; flex-direction:column; gap:8px; }
.wb-bind-item { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; background:var(--bg-card); border-radius:10px; border:1px solid var(--border-light); cursor:pointer; }
.wb-bind-item input[type="checkbox"] { width:18px; height:18px; flex-shrink:0; margin-top:2px; accent-color:var(--accent); }
.wb-bind-item-name { font-size:14px; font-weight:500; color:var(--text-main); }
.wb-bind-item-meta { font-size:11px; color:var(--text-muted); margin-top:3px; }
.wb-bind-empty { font-size:13px; color:var(--text-muted); padding:14px; text-align:center; background:var(--bg-card); border-radius:10px; border:1px dashed var(--border-light); }

/* ── 高级设置折叠标题 ── */
.ws-advanced-hdr { display:flex; justify-content:space-between; align-items:center; padding:12px 0 8px; cursor:pointer; user-select:none; margin-top:4px; border-top:1px solid var(--border-light); }
.ws-advanced-arrow { font-size:10px; color:var(--text-muted); flex-shrink:0; }
.ws-advanced-hdr.ws-advanced-disabled { opacity:0.35; cursor:not-allowed; }
/* 删除预设模块按钮 */
.module-btn-del { padding:2px 7px; border:1px solid var(--border-light); border-radius:6px; background:none; color:#c0504a; font-size:12px; cursor:pointer; line-height:1.4; }

/* ── 场景模式选择器 ── */
.scene-mode-card { padding:14px 16px; background:var(--bg-card); border-radius:12px; border:1.5px solid var(--border-light); margin-bottom:10px; cursor:pointer; transition:border-color 0.15s, background 0.15s; }
.scene-mode-card:active { opacity:0.85; }
.scene-mode-card--active { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 8%, var(--bg-card)); }
.scene-mode-card-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:5px; }
.scene-mode-label { font-size:15px; font-weight:600; color:var(--text-main); }
.scene-mode-check { font-size:15px; color:var(--accent); font-weight:700; }
.scene-mode-desc { font-size:12px; color:var(--text-muted); line-height:1.6; }
/* 社媒微博 tab 激活态 */
.weibo-tab--active { font-weight:700; box-shadow: inset 0 -2px 0 var(--accent); }
