/* 问渠 · 简洁 Agent 样式
   设计：素白主区 + 浅灰侧栏，主色蓝紫 #4d53e8；浅/深色双主题。 */

:root {
  --brand: #4d53e8;
  --brand-strong: #3d43d8;
  --brand-soft: #eef0ff;
  --bg: #ffffff;
  --bg-side: #f7f8fa;
  --bg-hover: #eef0f4;
  --bg-active: #e7e9f5;
  --bg-input: #f4f5f8;
  --text: #1f2329;
  --text-2: #5c6370;
  --text-3: #8a919c;
  --line: #e8eaee;
  --bubble-user: #eef0ff;
  --bubble-user-text: #27307a;
  --danger: #e5484d;
  --ok: #2f9e44;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(20, 26, 51, .08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --brand: #7b80ff;
  --brand-strong: #6a70ff;
  --brand-soft: #23264a;
  --bg: #16181d;
  --bg-side: #1c1f26;
  --bg-hover: #242832;
  --bg-active: #2b3040;
  --bg-input: #23262e;
  --text: #e6e8ec;
  --text-2: #a7adb8;
  --text-3: #7c838f;
  --line: #2a2e37;
  --bubble-user: #2b3070;
  --bubble-user-text: #e8eaff;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); }

/* ---------- 启动占位 ---------- */
.boot { height: 100vh; display: grid; place-content: center; gap: 18px; justify-items: center; }
.boot-logo {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6b6ef5, var(--brand)); color: #fff;
  font-size: 24px; font-weight: 700;
}
.boot-bar { width: 120px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--brand); animation: slide 1.1s infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧栏 ---------- */
.side {
  width: 268px; flex: 0 0 268px; background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; transition: margin-left .2s ease;
}
.side.collapsed { margin-left: -268px; }
.side-head { padding: 14px 12px 10px; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; padding-left: 4px; }
.brand i {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6b6ef5, var(--brand)); color: #fff;
  font-style: normal; font-size: 14px; font-weight: 700;
}
.new-btn {
  margin: 4px 12px 10px; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line);
  color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); font-size: 14px; transition: .15s;
}
.new-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.search-box { margin: 0 12px 8px; position: relative; }
.search-box input {
  width: 100%; padding: 7px 10px 7px 30px; border-radius: 9px; border: 1px solid transparent;
  background: var(--bg); outline: none; font-size: 13.5px;
}
.search-box input:focus { border-color: var(--brand); }
.search-box svg { position: absolute; left: 9px; top: 9px; opacity: .45; }

.sess-list { flex: 1; overflow-y: auto; padding: 2px 8px 10px; }
.sess-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; cursor: pointer; position: relative;
}
.sess-item:hover { background: var(--bg-hover); }
.sess-item.active { background: var(--bg-active); color: var(--text); font-weight: 500; }
.sess-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-item .ops { display: none; gap: 2px; }
.sess-item:hover .ops, .sess-item.active .ops { display: flex; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  color: var(--text-3); flex: 0 0 auto;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(229, 72, 77, .1); }

.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 14px; flex: 0 0 auto;
}
.who { flex: 1; min-width: 0; }
.who b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 12px; color: var(--text-3); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.top {
  height: 54px; flex: 0 0 54px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 15px; font-weight: 600; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  font-size: 12px; color: var(--text-3); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}

.scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.wrap { max-width: 820px; margin: 0 auto; padding: 26px 22px 10px; }

/* 空状态 */
.empty { text-align: center; padding: 9vh 10px 0; }
.empty .big {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6b6ef5, var(--brand)); color: #fff; font-size: 27px; font-weight: 700;
  box-shadow: 0 10px 26px rgba(77, 83, 232, .25);
}
.empty h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.empty p { margin: 0 auto 24px; color: var(--text-3); font-size: 14px; max-width: 460px; }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; max-width: 640px; margin: 0 auto; }
.chip {
  text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); transition: .15s; font-size: 14px; color: var(--text-2);
}
.chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text); transform: translateY(-1px); }
.chip b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; font-size: 14px; }

/* 消息 */
.msg { display: flex; gap: 12px; margin-bottom: 26px; }
.msg .av {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 14px; background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .av { background: var(--bg-input); color: var(--text-2); }
.msg .body { min-width: 0; max-width: 100%; }
.msg.user .body { display: flex; justify-content: flex-end; }
.bubble {
  background: var(--bubble-user); color: var(--bubble-user-text);
  padding: 10px 14px; border-radius: 16px 16px 4px 16px; max-width: 560px;
  white-space: pre-wrap; word-break: break-word;
}
.ai { min-width: 0; flex: 1; padding-top: 2px; }
.ai .md { color: var(--text); }

/* 思考 / 工具条 */
.trace { margin: 0 0 10px; font-size: 13px; color: var(--text-3); }
.trace summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: var(--bg-input); user-select: none;
}
.trace summary::-webkit-details-marker { display: none; }
.trace[open] summary { margin-bottom: 6px; }
.trace ul { margin: 0; padding-left: 18px; }
.trace li { margin: 2px 0; }
.spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); border-top-color: transparent;
  animation: rot .8s linear infinite; display: inline-block;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* Markdown */
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: .55em 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .45em; line-height: 1.4; font-weight: 700; }
.md h1 { font-size: 1.35em; } .md h2 { font-size: 1.2em; } .md h3 { font-size: 1.08em; } .md h4 { font-size: 1em; }
.md ul, .md ol { padding-left: 1.35em; margin: .5em 0; }
.md li { margin: .22em 0; }
.md code {
  font-family: var(--mono); font-size: .88em; background: var(--bg-input);
  padding: .12em .38em; border-radius: 5px;
}
.md pre {
  background: var(--bg-side); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; overflow: auto; margin: .7em 0;
}
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.6; }
.md blockquote { margin: .6em 0; padding: .1em 0 .1em 12px; border-left: 3px solid var(--line); color: var(--text-2); }
.md table { border-collapse: collapse; margin: .7em 0; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--bg-side); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.1em 0; }
.md .todo { list-style: none; padding-left: .2em; }

.msg-ops { margin-top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-ops { opacity: 1; }

/* 输入区 */
.composer-wrap { flex: 0 0 auto; padding: 8px 22px 18px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.composer {
  max-width: 820px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow); padding: 8px 8px 8px 16px;
  display: flex; align-items: flex-end; gap: 8px; transition: border-color .15s;
}
.composer:focus-within { border-color: var(--brand); }
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent;
  max-height: 200px; min-height: 28px; line-height: 1.6; padding: 6px 0; font-size: 15px;
}
.composer textarea::placeholder { color: var(--text-3); }
.send {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto; transition: .15s;
}
.send:hover:not(:disabled) { background: var(--brand-strong); transform: scale(1.04); }
.send:disabled { background: var(--line); color: var(--text-3); cursor: not-allowed; }
.hint { max-width: 820px; margin: 7px auto 0; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(15, 18, 30, .38); display: grid; place-items: center;
  z-index: 50; padding: 20px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; background: var(--bg);
  border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; animation: pop .16s;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .sub { color: var(--text-3); font-size: 13px; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-input); outline: none;
}
.field input:focus { border-color: var(--brand); background: var(--bg); }
.row-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text-2); font-size: 14px;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { padding: 8px 12px; font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.list-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.list-item b { font-size: 14px; }
.list-item p { margin: 3px 0 0; font-size: 13px; color: var(--text-3); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--bg-input); color: var(--text-2); }

/* ---------- 登录 ---------- */
.login-page {
  position: relative;
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% 0%, var(--brand-soft), transparent 60%), var(--bg-side);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg); border-radius: 20px;
  box-shadow: var(--shadow); padding: 30px 28px; border: 1px solid var(--line);
}
.login-card .logo {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6b6ef5, var(--brand)); color: #fff; font-size: 22px; font-weight: 700;
  margin-bottom: 16px;
}
.login-card h2 { margin: 0 0 4px; font-size: 21px; }
.login-card .sub { color: var(--text-3); font-size: 13.5px; margin: 0 0 22px; }
.login-card .err { color: var(--danger); font-size: 13px; margin: -4px 0 10px; min-height: 18px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-card .switch { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--text-3); }
.login-card .switch button { color: var(--brand); font-weight: 500; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast {
  padding: 9px 16px; border-radius: 10px; background: #2b2f3a; color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow); animation: pop .18s;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- 响应式 ---------- */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; box-shadow: var(--shadow);
  }
  .side.collapsed { margin-left: -268px; }
  .menu-btn { display: grid; }
  .wrap { padding: 18px 14px 8px; }
  .composer-wrap { padding: 6px 12px 14px; }
  .bubble { max-width: 84vw; }
}

/* ---------- 技能管理 ---------- */
.upload-box {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 22px 18px;
  text-align: center; background: var(--bg-side); transition: .18s;
}
.upload-box.dragging {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(77, 83, 232, .08);
}
.upload-box.busy { opacity: .7; pointer-events: none; }
.up-icon { color: var(--brand); display: flex; justify-content: center; margin-bottom: 8px; }
.up-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.up-sub { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; line-height: 1.6; }
.up-sub b { color: var(--text-2); }
.up-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.up-actions .btn { padding: 7px 14px; font-size: 13.5px; }
.up-progress {
  margin-top: 14px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden;
}
.up-progress i { display: block; width: 40%; height: 100%; background: var(--brand); }
.up-progress.run i { animation: upslide 1s infinite; }
@keyframes upslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.up-warn {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; text-align: left;
  background: #fff6e8; border: 1px solid #f0d9a8; color: #8a5a12;
  font-size: 12.5px; line-height: 1.6;
}
.up-warn b { display: block; margin-bottom: 4px; }
.up-warn .w-line { margin-top: 2px; word-break: break-word; }

.cli-bar {
  margin: 12px 0 2px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-side);
  font-size: 12.5px; line-height: 1.6;
}
.cli-bar.ok { border-color: #cfe8d4; background: #f2fbf4; color: #1f6b33; }
.cli-bar.bad { border-color: #f0d9a8; background: #fff6e8; color: #8a5a12; }
.cli-bar b { display: block; margin-bottom: 6px; }
.cli-items { display: flex; gap: 6px; flex-wrap: wrap; }
.cli-bar .w-line { margin-top: 6px; word-break: break-word; }
.hit-row { display: flex; gap: 8px; }
.hit-row input { flex: 1; min-width: 0; }
.hit-result { margin-top: 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.hit-result .w-line { margin-top: 2px; }

.skill-grid { display: grid; gap: 10px; }
.skill-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg);
  transition: .15s;
}
.skill-card:hover { border-color: var(--brand); }
.sk-head { display: flex; align-items: center; gap: 8px; }
.sk-head b { font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-ops { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.skill-card:hover .sk-ops { opacity: 1; }
.skill-card p { margin: 4px 0 8px; font-size: 13px; color: var(--text-3); line-height: 1.55; }
.tag.muted { opacity: .65; }
.tag.warn { background: #fdecec; color: #b42318; }
button.tag { border: 1px solid var(--line); cursor: pointer; font-family: inherit; }
button.tag.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.skill-src {
  background: var(--bg-side); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow: auto; margin: 0;
}
.modal textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-input); outline: none; resize: vertical; font-family: var(--mono);
  font-size: 13px; line-height: 1.6;
}
.modal textarea:focus { border-color: var(--brand); background: var(--bg); }

/* ---------- 轮内交互卡片 ---------- */
.ia-card {
  margin-top: 12px; padding: 14px 16px; border: 1px solid var(--brand);
  border-radius: 12px; background: var(--brand-soft);
  box-shadow: 0 4px 16px rgba(77, 83, 232, .10);
}
.ia-q { font-size: 14.5px; line-height: 1.65; word-break: break-all; }
.ia-q a { word-break: break-all; }
.ia-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ia-btn { padding: 8px 16px; border-radius: 999px; font-size: 14px; }
.ia-input { display: flex; gap: 8px; margin-top: 12px; }
.ia-input input {
  flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); outline: none; min-width: 0;
}
.ia-input input:focus { border-color: var(--brand); }
.ia-done { margin-top: 10px; font-size: 14px; color: var(--ok); font-weight: 600; }
.ia-card.answered { opacity: .78; border-color: var(--line); background: var(--bg-side); }
.ia-card.expired { opacity: .55; }

/* ---------- 设置中心（豆包式：左导航 + 右内容） ---------- */
.settings-modal {
  width: min(880px, 94vw);
  height: min(620px, 88vh);
  background: var(--bg);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 236px 1fr;
  overflow: hidden;
}
.set-nav {
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding: 16px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.set-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border-radius: 12px;
  padding: 8px 12px; margin-bottom: 10px;
  color: var(--text-3);
}
.set-search input {
  border: 0; background: none; outline: none;
  width: 100%; font-size: 13.5px; color: var(--text);
}
.set-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.set-user.big { padding: 4px 0 16px; }
.set-user p { margin: 1px 0 0; font-size: 12px; color: var(--text-3); }
.set-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #6b6ef5, var(--brand));
  color: #fff; display: grid; place-items: center;
  font-size: 17px; font-weight: 700; flex: 0 0 40px;
}
.set-user div { min-width: 0; }
.set-user b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px; border-radius: 12px;
  font-size: 14px; color: var(--text); text-align: left;
  transition: background .15s;
}
.set-item:hover { background: var(--bg-hover); }
.set-item.on { background: var(--bg); box-shadow: 0 1px 6px rgba(20, 26, 51, .06); font-weight: 600; }
.set-ic {
  width: 26px; height: 26px; border-radius: 9px; flex: 0 0 26px;
  display: grid; place-items: center;
}
.set-ic.sm { width: 30px; height: 30px; border-radius: 10px; flex: 0 0 30px; }
.set-body { display: flex; flex-direction: column; min-width: 0; }
.set-head {
  display: flex; align-items: center; justify-content: center;
  position: relative; padding: 16px 20px 10px;
}
.set-head h3 { margin: 0; font-size: 16.5px; }
.set-head .icon-btn { position: absolute; right: 14px; top: 12px; }
.set-panel { flex: 1; overflow-y: auto; padding: 6px 26px 24px; }
.set-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.set-card.slim { padding: 12px 14px; }
.set-card.center { text-align: center; padding: 22px 16px; }
.about-logo { width: 52px; height: 52px; font-size: 24px; margin: 0 auto 10px; }
.set-card.center h4 { margin: 0 0 4px; font-size: 16px; }
.set-card.center .sub { margin: 0 auto; max-width: 420px; }
.set-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.set-row:last-child { margin-bottom: 0; }
.set-row > div { flex: 1; min-width: 0; }
.set-row b { font-size: 14px; }
.set-row p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }
.set-row.spread { align-items: center; }
.set-row .sm-btn { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; }

/* 通用-外观选项 */
.theme-opts { display: grid; gap: 8px; margin-top: 4px; }
.theme-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg);
  text-align: left;
}
.theme-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.theme-opt .dot { width: 22px; height: 22px; border-radius: 8px; flex: 0 0 22px; }
.theme-opt .dot.light { background: linear-gradient(135deg, #fdfdfd, #dbe2f2); border: 1px solid var(--line); }
.theme-opt .dot.dark { background: linear-gradient(135deg, #2b3040, #14161b); }
.theme-opt .dot.auto { background: linear-gradient(90deg, #fdfdfd 50%, #2b3040 50%); border: 1px solid var(--line); }
.theme-opt div { flex: 1; }
.theme-opt b { font-size: 13.5px; display: block; }
.theme-opt p { margin: 1px 0 0; font-size: 12px; color: var(--text-3); }
.theme-opt .check { width: 18px; color: var(--brand); opacity: 0; }
.theme-opt.on .check { opacity: 1; }

/* 记忆管理 */
.mem-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--bg-input); color: var(--text-2);
}
.chip.on { background: var(--brand); color: #fff; font-weight: 600; }
.mem-q {
  flex: 1; min-width: 160px; border: 0; outline: none;
  background: var(--bg-input); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--text);
}
.mem-list { display: grid; gap: 10px; margin-bottom: 12px; }
.mem-item {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; transition: opacity .15s;
}
.mem-item.off { opacity: .55; }
.mem-item.off .mem-content { text-decoration: line-through; }
.mem-top { display: flex; align-items: center; gap: 8px; }
.mem-top .tag.kind-profile { background: #f1ecff; color: #7a52e8; }
.mem-top .tag.kind-preference { background: #ffeef2; color: #d8455b; }
.mem-top .tag.kind-fact { background: #e6f7f4; color: #12a89d; }
.mem-top .tag.kind-episode { background: #fff3e2; color: #c97a16; }
.stars { margin-left: auto; font-size: 13px; letter-spacing: 2px; }
.stars i { font-style: normal; color: var(--text-3); opacity: .5; }
.stars i.on { color: #ffb020; opacity: 1; }
.mem-content { margin: 8px 0 6px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.mem-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--text-3);
}
.mem-ops { display: flex; gap: 12px; }
.link-btn { font-size: 12px; color: var(--brand); padding: 0; }
.link-btn:hover { text-decoration: underline; }
.mem-top .switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: 0 0 36px; }
.mem-top .switch input { display: none; }
.mem-top .switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--line);
  transition: background .18s;
}
.mem-top .switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .18s;
}
.mem-top .switch input:checked + i { background: var(--brand); border-color: var(--brand); }
.mem-top .switch input:checked + i::after { left: 18px; }
.btn.danger-ghost { color: var(--danger); border-color: var(--danger); background: none; }
.btn.danger-ghost:hover { background: var(--danger); color: #fff; }
.mem-list .empty { text-align: center; padding: 26px 0; }

/* 关于问渠 */
.about-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.about-row + .about-row { border-top: 1px solid var(--line); }
.about-row > div { flex: 1; min-width: 0; }
.about-row b { font-size: 14px; }
.about-row p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }
.about-row p a { color: var(--text-2); text-decoration: none; }
.about-row p a:hover { color: var(--brand); }
.chev {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 26px;
  color: var(--text-3); background: var(--bg-input);
  transition: transform .18s;
}
a.chev { text-decoration: none; }
.chev:hover { color: var(--brand); }
.chev.open { transform: rotate(90deg); }
.chev.static { width: auto; flex: 0 0 auto; padding: 0 10px; font-size: 12px; border-radius: 999px; }
.beian-ic img { width: 17px; height: auto; display: block; }

@media (max-width: 680px) {
  .settings-modal {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 92vh;
  }
  .set-nav {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 12px; align-items: center;
  }
  .set-search, .set-user { display: none; }
  .set-item { flex: 0 0 auto; padding: 7px 10px; }
  .set-item.on { background: var(--bg-active); }
  .set-panel { padding: 6px 16px 20px; }
}

/* 记忆内联新增/编辑表单 */
.mem-item textarea, .new-mem textarea {
  width: 100%; resize: vertical; min-height: 64px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-input); color: var(--text);
  padding: 9px 12px; font: inherit; font-size: 13.5px; outline: none;
}
.mem-item textarea:focus { border-color: var(--brand); }
.new-mem { border-style: dashed; background: var(--brand-soft); }
.mem-form-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mem-form-row .flex { flex: 1; }
.mem-form-row select {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 13px; outline: none;
}
.mem-form-row .btn { padding: 6px 14px; font-size: 13px; }
.imp { display: flex; gap: 4px; }
.imp button {
  padding: 4px 9px; border-radius: 9px; font-size: 12px;
  background: var(--bg-input); color: var(--text-3);
}
.imp button.on { background: #fff3e2; color: #c97a16; font-weight: 700; }
.row-btns .btn.danger-ghost { margin-right: auto; }


/* ---------- 下载 App 二维码 ---------- */
.qr-box {
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  margin: 6px 0 10px;
}
.qr-box img { width: 220px; height: 220px; display: block; }
.qr-dl { display: inline-flex; margin-bottom: 6px; text-decoration: none; }
.dl-link { margin-top: 12px; }
.dl-link button {
  font-size: 13px;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.dl-link button:hover { color: var(--brand); background: var(--brand-soft); }

/* 备案信息：公安 + ICP 并排 */
.beian-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 3px 0 0;
}
.beian-links a {
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.beian-links a:hover { color: var(--brand); }
.beian-links img { width: 14px; height: auto; display: block; }

/* 登录页底部备案（公安 + ICP） */
.login-footer {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  display: flex; justify-content: center; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 12px;
}
.login-footer a {
  color: var(--text-3);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.login-footer a:hover { color: var(--brand); }
.login-footer img { width: 14px; height: auto; display: block; }
