/* Xingyu web visual layer: align the web catalog with the native purple-glass UI. */
:root {
  --bg: #0d0d19;
  --panel: rgba(28, 27, 46, .78);
  --panel-hi: rgba(55, 45, 78, .72);
  --line: rgba(188, 155, 255, .18);
  --text: #f5f1ff;
  --muted: #aaa5be;
  --accent: #a77bff;
  --accent-2: #d1b7ff;
  --gold: #f0c878;
  --shadow: 0 20px 55px rgba(0, 0, 0, .34);
}

* { letter-spacing: 0 !important; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 88% 0%, rgba(123, 84, 197, .25), transparent 34%),
    radial-gradient(circle at 4% 55%, rgba(43, 64, 112, .20), transparent 31%),
    linear-gradient(145deg, #11101f 0%, #17142a 52%, #0b0c16 100%);
}
button { -webkit-tap-highlight-color: transparent; }
.app-shell { padding: 0 14px 104px; }
.app { width: min(100%, 760px); }
.topbar {
  height: 106px;
  position: relative;
  align-items: flex-end;
  padding: 0 8px 12px;
  background: rgba(16, 15, 29, .76);
  border-bottom: 1px solid rgba(188, 155, 255, .10);
  backdrop-filter: blur(22px);
  backdrop-filter: none;
}
.brand { gap: 8px; align-items: flex-start; color: var(--text); font-size: 28px; line-height: 1; }
.brand-mark { width: 34px; height: 34px; margin-top: -2px; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#8059d6,#b68cff); box-shadow: 0 8px 22px rgba(134,88,224,.28); font-size: 17px; }
.brand small { margin-top: 9px; color: #778985; font-size: 12px; letter-spacing: .08em !important; text-transform: none; }
.top-actions { align-self: flex-start; padding-top: 48px; }
.top-actions #refreshBtn,.top-actions #noticeBtn,.top-actions #topProfileBtn { display: none; }
.top-actions .icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); color: #e8dcff; background: rgba(255,255,255,.07); box-shadow: 0 9px 22px rgba(0,0,0,.18); font-size: 22px; }

.hero { display: block; min-height: 270px; margin: 12px 0 25px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 29px; background: linear-gradient(135deg,rgba(58,43,86,.9),rgba(24,32,54,.85)); box-shadow: var(--shadow); position: relative; }
.hero > div:first-child { width: 64%; min-height: 270px; padding: 37px 19px 23px 24px; position: relative; z-index: 2; }
.hero > div:first-child:after { content: ''; position: absolute; inset: 0 -60px 0 38%; z-index: -1; background: linear-gradient(90deg, rgba(29,24,47,1) 0%, rgba(29,24,47,.96) 47%, rgba(29,24,47,.08) 100%); }
.hero .eyebrow { color: #718b88; font-size: 11px; letter-spacing: .12em !important; }
.hero .eyebrow i { width: 15px; background: #76c9bd; }
.hero h1 { max-width: 300px; margin: 16px 0 15px; color: #fff; font-family: 'Noto Sans SC', sans-serif; font-size: 27px; font-weight: 600; line-height: 1.42; letter-spacing: .03em !important; }
.hero h1 em { color: inherit; }
.hero p { max-width: 270px; color: #c1bad3; font-size: 11px; line-height: 1.75; }
.hero .hero-orb { width: 59%; height: 100%; min-height: 270px; position: absolute; inset: 0 0 0 auto; border: 0; border-radius: 0; background: linear-gradient(140deg, #5b3b86, #273a57); background-size: cover; background-position: 62% center; box-shadow: none; }
.hero .hero-orb:before { width: 100%; height: 100%; inset: 0; border-radius: 0; filter: none; background: linear-gradient(90deg, rgba(29,24,47,.98), rgba(29,24,47,.05) 42%, rgba(15,47,53,.03)); }
.hero .hero-orb:after { display: none; }
.orb-copy { display: none; }
.hero .hero-cta { margin-top: 21px; padding: 11px 18px; border-radius: 999px; color: #241936; background: linear-gradient(135deg,#d5b7ff,#a77bff); font-size: 12px; box-shadow: 0 8px 16px rgba(119,75,210,.26); }

.home-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 17px 10px 14px; margin-bottom: 27px; border: 1px solid var(--line); border-radius: 27px; background: rgba(27,24,46,.66); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.home-shortcut { min-width: 0; display: grid; gap: 8px; justify-items: center; color: #e7def7; background: transparent; font-size: 12px; }
.home-shortcut i { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; font-size: 22px; font-style: normal; color: #fff; background: linear-gradient(145deg,#a9baff,#8995e8); box-shadow: 0 6px 14px rgba(90,110,200,.2); }
.home-shortcut:nth-child(2) i { background: linear-gradient(145deg,#f9c6b9,#efa38d); }
.home-shortcut:nth-child(3) i { background: linear-gradient(145deg,#c0a7ff,#9075ed); }
.home-shortcut:nth-child(4) i { background: linear-gradient(145deg,#a8d6ff,#75acf0); }
.home-shortcut em { position: absolute; margin: -50px 0 0 37px; padding: 2px 5px; border-radius: 7px; color: #fff; background: #9977f2; font-size: 7px; font-style: normal; }

.ticker { display: none; }
.section-head { margin: 27px 5px 13px; align-items: center; }
.section-head h2 { color: #fff; font-family: 'Noto Sans SC', sans-serif; font-size: 24px; font-weight: 600; }
.section-head h2:after { content: ''; width: 37px; height: 5px; display: block; margin: 1px 0 -5px 4px; border-radius: 99px; opacity: .42; background: #a8c2ff; transform: rotate(-9deg); }
.section-head p { display: none; }
.filter { color: #b6aec8; font-size: 11px; }
.filter:before { content: '全部角色  ›'; }
.filter select { display: none; }

.characters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.character-card { min-height: 320px; border: 1px solid rgba(188,155,255,.16); border-radius: 20px; background: #201c31; box-shadow: 0 16px 32px rgba(0,0,0,.28); }
.character-card:hover { transform: translateY(-3px); box-shadow: 0 20px 38px rgba(0,0,0,.4); }
.character-card .portrait { background-position: center top; filter: saturate(.9) contrast(.94); }
.portrait:after { background: linear-gradient(180deg, transparent 28%, rgba(14,32,39,.86) 100%); }
.card-top { top: 8px; left: 8px; right: 8px; }
.tag { padding: 5px 7px; border: 1px solid rgba(218,194,255,.24); border-radius: 11px 11px 11px 2px; color: #f2eaff; background: rgba(42,28,67,.75); font-size: 9px; backdrop-filter: blur(12px); }
.favorite { display: grid; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.16); }
.card-info { left: 10px; right: 10px; bottom: 9px; }
.card-info h3 { margin-bottom: 3px; color: #fff; font-size: 18px; }
.card-info p { overflow: hidden; color: rgba(255,255,255,.9); }
.card-info .card-role-line { min-height: 15px; margin: 0; color: rgba(255,255,255,.87); font-size: 10px; line-height: 1.45; }
.card-info .card-summary { min-height: 30px; display: -webkit-box; margin: 7px 0 0; overflow: hidden; color: rgba(255,255,255,.82); font-size: 9px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; justify-content: space-between; gap: 4px; margin-top: 8px; color: rgba(255,255,255,.92); font-size: 9px; }
.card-meta span { min-width: 0; white-space: nowrap; }
.card-info:after { display: none; }

.feature { min-height: 147px; padding: 22px; margin-top: 26px; overflow: hidden; border: 1px solid rgba(188,155,255,.20); border-radius: 23px; background: linear-gradient(135deg,rgba(89,61,126,.42),rgba(40,50,83,.36)); box-shadow: var(--shadow); position: relative; backdrop-filter: blur(18px); }
.feature:after { content: '＋'; width: 110px; height: 110px; position: absolute; right: 23px; top: 16px; display: grid; place-items: center; border: 1px solid rgba(157,167,255,.32); border-radius: 30px; color: #fff; background: rgba(162,173,255,.36); box-shadow: 0 0 35px rgba(148,157,246,.36); font-size: 68px; font-weight: 200; }
.feature-icon { display: none; }
.feature strong { max-width: 220px; color: #fff; font-size: 19px; }
.feature span { max-width: 205px; color: #c0b6d2; font-size: 11px; line-height: 1.7; }
.feature button { display: block; z-index: 1; margin: 16px 0 0; padding: 9px 14px; border-radius: 999px; color: #261b37; background: linear-gradient(135deg,#d5b7ff,#a77bff); font-size: 11px; }
.quick-tools { display: none; }
#homePage > section:last-child { display: none; }

.bottom-nav-wrap { bottom: 13px; width: min(calc(100% - 28px), 472px); }
.bottom-nav { min-height: 74px; grid-template-columns: repeat(4,1fr); padding: 7px; border: 1px solid rgba(188,155,255,.18); border-radius: 27px; background: rgba(25,22,42,.88); box-shadow: 0 14px 36px rgba(0,0,0,.38); backdrop-filter: blur(18px); }
.nav-item { min-height: 59px; gap: 4px; border-radius: 18px; color: #9e97b1; }
.nav-item svg { width: 22px; height: 22px; stroke-width: 1.8; }
.nav-item span { font-size: 11px; }
.nav-item.active { color: #c09bff; background: linear-gradient(135deg,rgba(151,105,222,.30),rgba(83,66,132,.28)); box-shadow: none; }

/* 角色馆：双列竖向卡片。 */
#searchPage .page-bar,#searchPage .input-group > span,#searchHint { display: none; }
#searchPage { padding-top: 16px; }
#searchPage:before { content: '星宇'; display: block; margin: 8px 6px 11px; color: #fff; font-size: 35px; font-weight: 700; }
#searchPage:after { content: '每一次对话，都是故事的开始'; display: block; margin: -8px 7px 25px; color: #aaa5be; font-size: 12px; }
#searchPage .input-group { display: none; }
#searchTags { gap: 10px; margin: 0 0 25px !important; padding: 0 4px 4px; }
#searchTags button { padding: 8px 11px; border-radius: 999px; color: #aaa5be; background: rgba(255,255,255,.045); border: 1px solid rgba(188,155,255,.13); font-size: 12px; }
#searchTags button.active { color: #281d3b; background: linear-gradient(135deg,#d5b7ff,#a77bff); box-shadow: 0 8px 16px rgba(119,75,210,.24); }
.search-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; min-width: 0; }
.search-controls .subnav { flex: 1; min-width: 0; margin: 0; }
.search-sort { display: flex; align-items: center; gap: 5px; flex: none; padding: 7px 9px; border: 1px solid rgba(188,155,255,.16); border-radius: 11px; color: #aaa5be; background: rgba(255,255,255,.045); font-size: 10px; }
.search-sort select { max-width: 48px; border: 0; outline: 0; color: #e8dcff; background: transparent; font: inherit; }
.search-sort option { color: #eee; background: #201c31; }
#searchPage .section-head { display: none; }
.search-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; min-width: 0; }
.search-controls .subnav { flex: 1; min-width: 0; margin: 0; }
.search-sort { display: flex; align-items: center; gap: 5px; flex: none; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--panel); font-size: 10px; }
.search-sort select { max-width: 48px; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.search-sort option { color: #eee; background: #201c31; }
.mini-character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
#searchGrid .mini-character { min-height: 357px; position: relative; overflow: hidden; border: 1px solid rgba(188,155,255,.16); border-radius: 21px; color: #fff; background: #201c31; box-shadow: 0 11px 25px rgba(0,0,0,.30); }
#searchGrid .mini-character:before { display: none; }
.mini-tag { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 5px 8px; border-radius: 9px 9px 9px 2px; color: #ecfffc; background: rgba(0,137,122,.82); font-size: 9px; }
#searchGrid .mini-character-image { position: absolute; inset: 0; height: auto; }
#searchGrid .mini-character-image:after { background: linear-gradient(180deg,transparent 35%,rgba(14,30,39,.90) 100%); }
#searchGrid .mini-character-copy { position: absolute; z-index: 2; bottom: 11px; left: 12px; right: 10px; padding: 0; }
#searchGrid .mini-character-copy strong { color: #fff; font-size: 20px; }
#searchGrid .mini-character-copy span { display: block; margin-top: 7px; color: rgba(255,255,255,.9); white-space: normal; }
#searchGrid .mini-role-line { font-size: 12px; line-height: 1.35; }
#searchGrid .mini-summary { display: -webkit-box; min-height: 46px; overflow: hidden; color: rgba(255,255,255,.84); font-size: 11px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#searchGrid .mini-meta { margin-top: 10px; color: rgba(255,255,255,.93); font-size: 10px; line-height: 1.25; }

/* 聊天页：只在发送中使用思考气泡，不遮住整个页面。 */
.chat-backdrop { align-items: stretch; background: #f4f8f7; }
.chat { width: min(100%, 472px); height: 100vh; grid-template-rows: 72px 52px minmax(0,1fr) 62px 58px; background: linear-gradient(180deg,#f8fbfa,#eef7f5); color: #173d38; }
.chat-head { gap: 10px; padding: 0 14px; border-bottom: 0; background: rgba(250,253,252,.92); }
.chat-head .icon-btn { width: 39px; height: 39px; border-radius: 50%; border: 0; color: #173d38; background: #fff; box-shadow: 0 5px 16px rgba(37,87,82,.08); font-size: 24px; }
.chat-head .mini-avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 5px 12px rgba(35,78,73,.12); }
.chat-head h3 { color: #183c37; font-size: 16px; }
.chat-head span { color: #6b827b; font-size: 10px; }
.chat-head span:before { content: '● '; color: #0aae98; }
.chat-body { width: 100%; padding: 21px 18px; gap: 14px; }
.chat-note { padding: 6px 10px; border-radius: 999px; color: #74908a; background: rgba(255,255,255,.75); font-size: 9px; }
.bubble-row { gap: 7px; }
.bubble-avatar { width: 29px; height: 29px; border-radius: 50%; }
.bubble { max-width: 81%; padding: 13px 14px; border: 0; border-radius: 19px 19px 19px 5px; color: #25473f; background: #fff; box-shadow: 0 8px 19px rgba(34,88,79,.08); font-size: 13px; line-height: 1.75; }
.me .bubble { border-radius: 19px 19px 5px 19px; color: #fff; background: linear-gradient(135deg,#008e82,#65cdbc); box-shadow: 0 8px 18px rgba(0,142,130,.16); }
.thinking { display: flex; min-width: 109px; align-items: center; padding: 11px 13px; color: #20786c; background: #e0f2ed; }
.thinking span { width: 7px; height: 7px; background: #14a895; }
.chat-input { width: calc(100% - 28px); gap: 8px; padding: 0; }
.chat-input .icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; color: #177d71; background: #fff; box-shadow: 0 5px 14px rgba(36,86,80,.08); }
.chat-input input { min-width: 0; height: 48px; padding: 0 51px 0 14px; border: 0; border-radius: 24px; color: #24473f; background: #fff; box-shadow: 0 5px 14px rgba(36,86,80,.08); font-size: 12px; }
.send { width: 48px; height: 48px; border-radius: 50%; color: #fff; background: linear-gradient(135deg,#008e82,#68d0bd); box-shadow: 0 8px 19px rgba(0,142,130,.26); font-size: 23px; }
.send:disabled { opacity: .45; box-shadow: none; }

/* 创建页：三个分区，实时预览和规则设置。 */
#createPage .page-bar { margin-top: 3px; padding: 15px 0 13px; }
#createPage .page-bar h1 { color: #173d38; font-size: 25px; }
#createPage .page-bar p { color: #778985; }
.create-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-bottom: 13px; padding: 4px; border: 1px solid rgba(21,104,94,.07); border-radius: 14px; background: rgba(255,255,255,.8); box-shadow: 0 5px 16px rgba(31,81,75,.05); }
.create-tabs button { min-height: 34px; padding: 4px; border-radius: 10px; color: #687f7a; background: transparent; font-size: 10px; }
.create-tabs button.active { color: #007f74; background: #e2f5ef; font-weight: 700; }
.form-layout { gap: 14px; }
.form-panel,.side-panel { padding: 17px; border: 1px solid rgba(20,99,89,.08); border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: 0 10px 24px rgba(25,88,80,.07); }
.form-section { padding: 0 0 18px; margin: 0 0 17px; border-bottom: 1px solid rgba(20,99,89,.08); }
.form-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.form-section h2,.side-panel h2 { color: #183f39; font-size: 17px; }
.form-section p,.side-panel > p { color: #7a8d88; font-size: 11px; line-height: 1.7; }
.form-grid { gap: 10px; }
.input-group > span { color: #284f48; font-size: 12px; font-weight: 600; }
.input-group > span small { color: #849590; font-size: 10px; font-weight: 400; }
.field,textarea { border: 1px solid rgba(16,103,91,.10); border-radius: 13px; color: #284941; background: #fbfdfc; }
.field { height: 43px; }
textarea { min-height: 95px; padding: 12px; font-size: 12px; line-height: 1.6; }
.cover-picker { min-height: 136px; border: 1px dashed rgba(0,142,130,.26); border-radius: 16px; background: #fbfdfc; }
.cover-preview { width: 93px; height: 112px; border-radius: 14px; }
.cover-copy strong { color: #21463f; }
.cover-copy label,.primary { color: #fff; background: linear-gradient(135deg,#008e82,#76d5c3); }
.choice-chip { border: 1px solid rgba(15,104,92,.10); color: #47746c; background: #f4f8f7; }
.choice-chip.selected { color: #007f74; border-color: rgba(0,142,130,.34); background: #e4f7f2; }
.visibility-choices { grid-template-columns: 1fr 1fr; }
.visibility-choice { border-color: rgba(15,104,92,.10); color: #385e57; background: #fbfdfc; }
.visibility-choice.active { border-color: #27b3a4; background: #edfaf7; }
.create-extra { display: grid; gap: 12px; }
.create-row-options { display: flex; flex-wrap: wrap; gap: 8px; }
.create-option { padding: 8px 10px; border: 1px solid rgba(15,104,92,.10); border-radius: 11px; color: #50756e; background: #f7faf9; font-size: 11px; }
.create-option.selected { color: #007e73; border-color: #37b8aa; background: #e8f8f4; }
.creator-preview { display: grid; gap: 10px; padding: 13px; border-radius: 16px; background: #f7fbfa; }
.creator-preview-chat { justify-self: end; padding: 10px 12px; border-radius: 13px 13px 4px 13px; color: #fff; background: linear-gradient(135deg,#008e82,#70cdbc); font-size: 11px; }
.form-progress i { background: linear-gradient(90deg,#008e82,#78d5c4); }
.publish-note { color: #6c8580; background: #f4f9f7; }

/* Keep the creator workflow close to the supplied portrait-first layout. */
#createPage .page-actions .ghost { border-radius: 50%; width: 40px; height: 40px; padding: 0; font-size: 0; }
#createPage .page-actions .ghost:after { content: '‹'; color: #35534e; font-size: 32px; line-height: 1; }
#createPage .page-actions .primary { min-height: 40px; border-radius: 13px; }
#createPage .cover-picker { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 15px; align-items: center; min-height: 144px; }
#createPage .cover-preview { width: 94px; height: 112px; border: 1px dashed rgba(0,142,130,.32); background: linear-gradient(145deg,#f7fbfa,#e6f1ee); }
#createPage .cover-preview:empty:before { content: '+'; display: grid; width: 100%; height: 100%; place-items: center; color: #5ebbad; font-size: 36px; }
#createPage .cover-copy { display: grid; align-content: center; gap: 8px; }
#createPage .cover-copy span { line-height: 1.55; }
#createPage .cover-copy label { display: inline-flex; width: max-content; min-height: 31px; align-items: center; padding: 0 11px; border-radius: 10px; font-size: 10px; }
#createPage .cover-copy label + label { margin-left: 4px; background: #edf8f5; color: #007f74; }
#createPage .input-group.full { grid-column: 1 / -1; }
#createPage .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#createPage .form-grid .input-group.full { grid-column: 1 / -1; }
#createPage .form-grid .input-group:nth-child(n+5) { grid-column: span 1; }
#createPage .form-grid .input-group:nth-child(n+8) { grid-column: 1 / -1; }

/* 个人与创作中心继续沿用原有功能，更新为同一浅色层级。 */
.page-view { animation: none; }
.page-intro { padding: 18px 3px; }
.page-intro h1 { color: #173d38; font-size: 31px; }
.profile-hero { border: 0; background: linear-gradient(135deg,#e4f6f2,#f1f8f6); box-shadow: var(--shadow); }
.profile-avatar { color: #fff; background: linear-gradient(145deg,#008e82,#7bd4c3); }
.settings-list,.conversation-card,.announcement-row { border-color: rgba(23,95,86,.10); background: rgba(255,255,255,.88); box-shadow: 0 8px 21px rgba(31,84,77,.05); }
.setting-row { color: #214942; border-bottom-color: rgba(23,95,86,.08); }
.setting-icon { color: #008e82; background: #e3f5f0; }
.creator-actions { grid-template-columns: repeat(2,1fr); }
.creator-action { min-height: 118px; border-color: rgba(23,95,86,.10); color: #234840; background: #fff; box-shadow: 0 8px 20px rgba(31,84,77,.06); }
.creator-action-main { background: linear-gradient(135deg,#e5f7f2,#f6fbfa); }
.creator-action span { color: #fff; background: linear-gradient(135deg,#008e82,#79d7c6); }

/* Long character settings must not push the chat action beyond the viewport. */
.detail-backdrop { align-items: center; }
.detail-panel { max-height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.detail-cover { flex: 0 0 164px; }
.detail-content { min-height: 0; overflow-y: auto; padding-bottom: 20px; overscroll-behavior: contain; }
.detail-content p { max-height: none; overflow: visible; }
.detail-actions { position: sticky; bottom: 0; margin: 18px -4px 0; padding: 12px 4px 2px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 24%); }

@media (min-width: 760px) {
  .app-shell { padding-top: 12px; }
  .app { max-width: 760px; }
}
@media (max-width: 390px) {
  .hero { min-height: 250px; }
  .hero > div:first-child { min-height: 250px; padding: 30px 14px; }
  .hero h1 { font-size: 25px; }
  .character-card { min-height: 267px; }
  #searchGrid .mini-character { min-height: 335px; }
  .search-controls { align-items: stretch; flex-direction: column; }
  .search-sort { align-self: flex-end; }
  .create-tabs button { font-size: 9px; }
}

/* Shared runtime fixes: keep the chat surface scrollable and make the
   announcement/activity and comment surfaces use the same compact hierarchy. */
.chat { grid-template-rows: 72px auto minmax(0,1fr) auto auto; min-height: 0; overflow: hidden; }
#chatToolsBackdrop { z-index: 20; }
.top-actions #refreshBtn,.top-actions #noticeBtn,.top-actions #topProfileBtn { display: grid; }
.chat-body { min-height: 0; height: auto; align-self: stretch; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scrollbar-width: thin; }
.chat-input { flex-shrink: 0; }
.comment-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid rgba(255,255,255,.06); }
.comment-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.comment-copy { min-width: 0; flex: 1; }
.comment-head { min-width: 0; display: flex; align-items: center; gap: 6px; }
.comment-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-head time { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.comment-badges { display: inline-flex; gap: 4px; min-width: 0; }
.comment-badge { padding: 2px 5px; border-radius: 5px; color: var(--badge-color,#c9a6f4); background: color-mix(in srgb, var(--badge-color,#b68cf2) 15%, transparent); font-size: 8px; white-space: nowrap; }
.comment-badge.creator { color: #e8c07f; background: rgba(232,192,127,.13); }
.comment-item p { margin: 5px 0 0; word-break: break-word; }
.notice-card { cursor: pointer; transition: background .2s ease, transform .2s ease; }
.notice-card:hover { transform: translateY(-1px); }
.notice-card.unread { border-color: rgba(194,147,255,.28); background: linear-gradient(135deg,rgba(117,77,160,.16),rgba(255,255,255,.035)); }
.notice-card.unread .notice-dot { color: #d7b4fb; box-shadow: 0 0 0 4px rgba(183,135,244,.08); }
.modal-activity { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid rgba(192,145,255,.20); border-radius: 15px; background: linear-gradient(135deg,rgba(116,76,157,.25),rgba(31,31,49,.65)); }
.activity-modal-copy { min-width: 0; flex: 1; }
.activity-modal-copy span,.activity-modal-copy small { display: block; color: #bca6d6; font-size: 10px; }
.activity-modal-copy strong { display: block; margin-top: 3px; overflow: hidden; color: #f2e9fc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.activity-modal-copy small { margin-top: 4px; color: #e2bd83; }
.modal-activity .primary { flex: none; padding: 8px 10px; }
.activity-section { margin-top: 26px; }
.activity-section { display: none; }
.announcement-reward { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.announcement-reward span { color:var(--gold); font-size:11px; font-weight:600; }
.announcement-reward button { min-width:76px; height:32px; padding:0 10px; border-radius:9px; font-size:10px; }
.activity-list { display: grid; gap: 10px; }
.activity-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(192,145,255,.14); border-radius: 16px; background: linear-gradient(135deg,rgba(115,76,152,.15),rgba(255,255,255,.025)); }
.activity-row-copy { min-width: 0; flex: 1; }
.activity-kicker { color: #c4a4e8; font-size: 9px; letter-spacing: .08em; }
.activity-row h3 { margin: 4px 0 0; font-size: 14px; }
.activity-row p { max-height: 40px; margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; }
.activity-row small { display: block; margin-top: 5px; color: #858494; font-size: 9px; }
.activity-row-action { flex: none; display: grid; justify-items: end; gap: 2px; }
.activity-row-action strong { color: #e9c58e; font-size: 16px; }
.activity-row-action span { color: var(--muted); font-size: 9px; }
.activity-row-action .primary { margin-top: 6px; padding: 7px 9px; font-size: 10px; }

/* Three restrained themes for the conversation surface. */
#chatBackdrop .chat[data-chat-theme="violet"] { background: radial-gradient(circle at 75% 5%,rgba(145,87,190,.18),transparent 34%), #0e0b16; color: #f1ebf7; }
#chatBackdrop .chat[data-chat-theme="violet"] .chat-head { border-bottom-color: rgba(207,169,255,.13); }
#chatBackdrop .chat[data-chat-theme="violet"] .bubble { color: #e8ddf0; background: rgba(42,29,58,.92); border-color: rgba(209,171,255,.10); }
#chatBackdrop .chat[data-chat-theme="violet"] .me .bubble { color: #fff; background: linear-gradient(135deg,#70448d,#a466ae); }
#chatBackdrop .chat[data-chat-theme="violet"] .chat-input input { color: #f4edf8; background: rgba(42,29,58,.75); border-color: rgba(209,171,255,.14); }
#chatBackdrop .chat[data-chat-theme="rose"] { background: radial-gradient(circle at 75% 5%,rgba(177,71,94,.18),transparent 34%), #140c12; color: #f8ebed; }
#chatBackdrop .chat[data-chat-theme="rose"] .chat-head { border-bottom-color: rgba(244,143,158,.15); }
#chatBackdrop .chat[data-chat-theme="rose"] .bubble { color: #f2dfe2; background: rgba(53,29,37,.94); border-color: rgba(244,143,158,.11); }
#chatBackdrop .chat[data-chat-theme="rose"] .me .bubble { color: #fff; background: linear-gradient(135deg,#863d50,#c45e6d); }
#chatBackdrop .chat[data-chat-theme="rose"] .chat-input input { color: #fff1f3; background: rgba(53,29,37,.78); border-color: rgba(244,143,158,.15); }
#chatBackdrop .chat[data-chat-theme="indigo"] { background: radial-gradient(circle at 75% 5%,rgba(78,119,202,.19),transparent 34%), #0b101c; color: #eaf0fc; }
#chatBackdrop .chat[data-chat-theme="indigo"] .chat-head { border-bottom-color: rgba(137,170,241,.15); }
#chatBackdrop .chat[data-chat-theme="indigo"] .bubble { color: #dce7fb; background: rgba(25,39,63,.94); border-color: rgba(137,170,241,.12); }
#chatBackdrop .chat[data-chat-theme="indigo"] .me .bubble { color: #fff; background: linear-gradient(135deg,#345a9a,#5d83c6); }
#chatBackdrop .chat[data-chat-theme="indigo"] .chat-input input { color: #edf3ff; background: rgba(25,39,63,.80); border-color: rgba(137,170,241,.16); }
@media (max-width: 520px) { .activity-row { align-items: flex-start; } .activity-row-action { width: 78px; } .activity-row-action .primary { width: 78px; } }

/* Web release 3: application-level appearance settings and a simplified chat. */
html[data-app-theme="violet"] {
  --bg: #151720;
  --panel: #20222d;
  --panel-hi: #282a37;
  --line: rgba(255,255,255,.085);
  --text: #f4f2f7;
  --muted: #aaa6b4;
  --accent: #a87cff;
  --accent-2: #61bbae;
  --gold: #e4bd7d;
  --shadow: 0 15px 34px rgba(0,0,0,.24);
  --theme-surface: #1b1d27;
  --theme-surface-soft: #242631;
  --theme-accent-rgb: 168,124,255;
  --theme-secondary-rgb: 97,187,174;
}
html[data-app-theme="rose"] {
  --bg: #151114;
  --panel: #21191e;
  --panel-hi: #2c2026;
  --line: rgba(255,255,255,.085);
  --text: #f8f1f3;
  --muted: #b0a2a7;
  --accent: #e16478;
  --accent-2: #aa8bd8;
  --gold: #e6bd83;
  --shadow: 0 15px 34px rgba(0,0,0,.27);
  --theme-surface: #1c1519;
  --theme-surface-soft: #281d22;
  --theme-accent-rgb: 225,100,120;
  --theme-secondary-rgb: 170,139,216;
}
html[data-app-theme="indigo"] {
  --bg: #101521;
  --panel: #192130;
  --panel-hi: #222c3d;
  --line: rgba(255,255,255,.09);
  --text: #f1f4fa;
  --muted: #a3abba;
  --accent: #7599e8;
  --accent-2: #58b4a4;
  --gold: #e2ba77;
  --shadow: 0 15px 34px rgba(0,0,0,.27);
  --theme-surface: #141b28;
  --theme-surface-soft: #1d2737;
  --theme-accent-rgb: 117,153,232;
  --theme-secondary-rgb: 88,180,164;
}
html[data-app-font="system"] body { font-family: system-ui, "Microsoft YaHei", sans-serif; }
html[data-app-font="noto"] body { font-family: "Noto Sans SC", system-ui, sans-serif; }
html[data-app-font="yahei"] body { font-family: "Microsoft YaHei", system-ui, sans-serif; }

body {
  color: var(--text);
  background: var(--bg);
}
.app-shell { background: var(--bg); }
.app { color: var(--text); }
.topbar { color: var(--text); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
.topbar .brand,.brand,.brand small,.page-intro h1,.page-bar h1,.section-head h2,.profile-main h1 { color: var(--text); }
.brand-mark,.eyebrow,.setting-icon { color: var(--accent); }
.brand small,.page-intro p,.page-bar p,.section-head p { color: var(--muted); }
h1,.hero h1,.page-intro h1,.page-bar h1 { font-size: 28px; letter-spacing: 0; }
.top-actions .icon-btn { color: var(--text); border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }

.hero {
  min-height: 245px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--theme-surface);
  box-shadow: var(--shadow);
}
.hero > div:first-child { min-height: 245px; }
.hero > div:first-child:after { background: linear-gradient(90deg,var(--theme-surface) 0%,var(--theme-surface) 72%,transparent 100%); }
.hero .hero-orb { min-height: 245px; background: linear-gradient(145deg,rgba(var(--theme-accent-rgb),.30),rgba(var(--theme-secondary-rgb),.13)); }
.hero .hero-orb:before { background: linear-gradient(90deg,var(--theme-surface),transparent 58%); }
.hero h1,.hero h1 em { color: var(--text); font-size: 28px; }
.hero p,.hero .eyebrow { color: var(--muted); }
.feature { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
.feature:after { color: rgba(255,255,255,.88); border-color: rgba(var(--theme-accent-rgb),.28); background: rgba(var(--theme-accent-rgb),.20); box-shadow: none; }
.feature strong { color: var(--text); }
.feature span { color: var(--muted); }
.feature button,.primary { color: #fff; background: var(--accent); }

.discovery-section .section-head { margin-bottom: 11px; }
.discovery-modes { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.discovery-modes button { min-width: 0; min-height: 49px; display: grid; align-content: center; gap: 3px; border-radius: 10px; color: var(--muted); background: transparent; }
.discovery-modes strong { color: inherit; font-size: 13px; }
.discovery-modes small { color: inherit; font-size: 9px; opacity: .74; }
.discovery-modes button.active { color: #fff; background: rgba(var(--theme-accent-rgb),.24); box-shadow: inset 0 0 0 1px rgba(var(--theme-accent-rgb),.24); }
.discovery-categories { display: flex; gap: 6px; margin: 10px 0 13px; overflow-x: auto; scrollbar-width: none; }
.discovery-categories::-webkit-scrollbar { display: none; }
.discovery-categories button { flex: none; min-height: 31px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 11px; }
.discovery-categories button.active { color: #fff; border-color: rgba(var(--theme-accent-rgb),.34); background: rgba(var(--theme-accent-rgb),.22); }
.discovery-empty { grid-column: 1 / -1; margin-top: 0; }
.tag { color: #fff; background: rgba(var(--theme-accent-rgb),.78); }

.bottom-nav { border-color: var(--line); background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: var(--shadow); }
.nav-item { color: var(--muted); }
.nav-item.active { color: var(--accent); background: rgba(var(--theme-accent-rgb),.13); }
.profile-hero { color: var(--text); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.profile-hero:after { display: none; }
.profile-avatar { color: #fff; background: linear-gradient(145deg,var(--accent),var(--accent-2)); }
.profile-main p,.profile-stat span { color: var(--muted); }
.profile-edit { color: var(--text); border-color: var(--line); background: var(--panel-hi); }
.settings-list,.conversation-card,.announcement-row,.notice-card,.form-panel,.side-panel,.model-card,.balance-card,.recharge-panel,.vip-progress-panel,.recharge-history,.creator-workspace {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.setting-row { color: var(--text); border-bottom-color: var(--line); }
.setting-icon { background: rgba(var(--theme-accent-rgb),.13); }
.setting-copy small,.conversation-copy p,.announcement-row p,.notice-card p { color: var(--muted); }
.field,.input-group textarea,.input-group select,.comment-form input,.recharge-input-row input {
  color: var(--text);
  border-color: var(--line);
  background: var(--theme-surface-soft);
}
.input-group > span,.form-section h2,.side-panel h2 { color: var(--text); }
.input-group small,.form-section p,.side-panel > p { color: var(--muted); }
.model-card.active { border-color: rgba(var(--theme-accent-rgb),.50); background: rgba(var(--theme-accent-rgb),.12); }
.modal,.detail-panel,.auth-panel { color: var(--text); border-color: var(--line); background: var(--panel); }
.modal-body,.detail-content p { color: var(--muted); }
.close,.ghost,.back-link { color: var(--text); background: var(--panel-hi); }
.detail-actions { background: linear-gradient(180deg,transparent,var(--panel) 28%); }
.comment-item { border-color: var(--line); background: var(--theme-surface-soft); }
.comment-item p { color: var(--text); }
.activity-row,.modal-activity { border-color: rgba(var(--theme-accent-rgb),.24); background: rgba(var(--theme-accent-rgb),.10); }
.activity-row p,.activity-row small,.activity-row-action span { color: var(--muted); }
.activity-kicker,.activity-modal-copy span { color: var(--accent); }
.activity-row-action strong,.activity-modal-copy small { color: var(--gold); }
.activity-modal-copy strong { color: var(--text); }
.appearance-fields { display: grid; gap: 13px; }
.appearance-fields .input-group { display: grid; gap: 7px; }
.appearance-modal .modal-foot { gap: 8px; }

/* Chat now has three stable rows: header, independently scrolling messages,
   and the real text composer. Decorative or unavailable controls are removed. */
.chat {
  width: min(100%,472px);
  height: 100dvh;
  min-height: 0;
  grid-template-rows: 66px minmax(0,1fr) 70px;
  overflow: hidden;
  color: var(--text);
  background: var(--theme-surface);
}
.chat-head { min-width: 0; padding: 0 13px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--theme-surface) 89%, transparent); backdrop-filter: blur(16px); }
.chat-head .icon-btn { width: 37px; height: 37px; color: var(--text); border: 1px solid var(--line); background: var(--panel); box-shadow: none; font-size: 20px; }
.chat-head .mini-avatar { width: 40px; height: 40px; border: 1px solid var(--line); box-shadow: none; }
.chat-head h3 { color: var(--text); font-size: 14px; }
.chat-head span { color: var(--muted); }
.chat-head span:before { color: var(--accent-2); }
.chat-body { width: 100%; min-height: 0; padding: 20px 14px 26px; gap: 15px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.chat-note { color: var(--muted); background: rgba(255,255,255,.05); }
.bubble-row { gap: 8px; }
.bubble-avatar { width: 27px; height: 27px; }
.bubble { max-width: 82%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; color: var(--text); background: color-mix(in srgb,var(--panel) 86%,transparent); box-shadow: 0 8px 22px rgba(0,0,0,.16); font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.me .bubble { color: #fff; border: 0; border-radius: 18px 18px 5px 18px; background: linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 55%,var(--accent-2))); box-shadow: 0 8px 20px rgba(var(--theme-accent-rgb),.20); }
.thinking { color: var(--text); background: var(--panel-hi); }
.thinking span { background: var(--accent); }
.chat-input { width: 100%; min-width: 0; gap: 8px; align-items: center; margin: 0; padding: 9px 13px max(9px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb,var(--theme-surface) 91%,transparent); }
.chat-input input { min-width: 0; height: 45px; padding: 0 15px; color: var(--text); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: none; font-size: 13px; }
.send { width: 43px; height: 43px; flex: none; border-radius: 13px; color: #fff; background: var(--accent); box-shadow: none; font-size: 20px; }
.chat[data-bubble-style="minimal"] .bubble-row:not(.me) .bubble { padding: 3px 2px 5px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.chat[data-bubble-style="minimal"] .me .bubble { padding: 9px 12px; border-radius: 14px 14px 4px 14px; }
.chat[data-bubble-style="compact"] .chat-body { gap: 9px; }
.chat[data-bubble-style="compact"] .bubble { max-width: 88%; padding: 8px 10px; border-radius: 13px 13px 13px 4px; font-size: 12px; line-height: 1.58; }
.chat[data-bubble-style="compact"] .me .bubble { border-radius: 13px 13px 4px 13px; }

#chatBackdrop .chat[data-chat-theme="violet"] { background: linear-gradient(180deg,#17131f,#0f1017); }
#chatBackdrop .chat[data-chat-theme="rose"] { background: linear-gradient(180deg,#1b1116,#100e12); }
#chatBackdrop .chat[data-chat-theme="indigo"] { background: linear-gradient(180deg,#111a2a,#0d111a); }
#chatBackdrop .chat[data-chat-theme] .chat-head { border-bottom-color: var(--line); }
#chatBackdrop .chat[data-chat-theme] .bubble { color: var(--text); background: color-mix(in srgb,var(--panel) 84%,transparent); border-color: var(--line); }
#chatBackdrop .chat[data-chat-theme] .me .bubble { color: #fff; background: linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 55%,var(--accent-2))); }
#chatBackdrop .chat[data-chat-theme] .chat-input input { color: var(--text); background: var(--panel); border-color: var(--line); }
#chatBackdrop .chat[data-chat-theme][data-bubble-style="minimal"] .bubble-row:not(.me) .bubble { background: transparent; }

@media (max-width: 520px) {
  .app-shell { padding-inline: 12px; }
  .topbar { min-width: 0; gap: 8px; }
  .brand { min-width: 0; flex: 1; align-items: center; font-size: 25px; }
  .brand-mark { flex: none; margin-top: 0; }
  .brand small { max-width: 82px; margin-top: 5px; overflow: hidden; font-size: 9px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
  .top-actions { flex: none; gap: 4px; }
  .top-actions .icon-btn { width: 38px; height: 38px; font-size: 20px; }
  .characters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .character-card { min-height: 278px; }
  .chat-body { padding-inline: 13px; }
  .appearance-modal { width: min(100%,410px); }
  .search-controls { align-items: stretch; flex-direction: column; }
  .search-sort { align-self: flex-end; }
}
