﻿/* ============================================================
   UniMatch Design System — 统一的样式核心
   所有页面通过 <link href="unimatch-style.css"> 引用此文件
   ============================================================ */

/* =============================================
   1. CSS 变量（设计令牌）
   ============================================= */
:root {
    /* 基础色板 */
    --bg: #f9fbff;
    --sidebar: #f0f4f9;
    --text: #1e293b;
    --accent: #22A5A0;
    --green: #059669;
    --red: #dc2626;
    --amber: #d97706;
    --border: #e2e8f0;
    --msg-user: #e2e8f0;
    --gradient-positive: linear-gradient(135deg, #f8fafc 0%, #f0fdfa 100%);

    /* 排版变量（Grok 紧凑风格默认） */
    --chat-padding: 40px 18%;
    --msg-font: 16px;
    --msg-leading: 1.7;
    --msg-gap: 32px;
    --input-padding: 20px 18%;
}

/* =============================================
   2. 排版布局覆盖方案
   ============================================= */
.layout-grok  { --chat-padding: 20px 8%;   --msg-font: 15px;   --msg-leading: 1.5; --msg-gap: 20px; --input-padding: 10px 8%; }
.layout-ultra { --chat-padding: 10px 4%;   --msg-font: 14px;   --msg-leading: 1.4; --msg-gap: 12px; --input-padding: 5px 4%; }
.layout-modern{ --chat-padding: 30px 12%;  --msg-font: 15.5px; --msg-leading: 1.6; --msg-gap: 24px; --input-padding: 15px 12%; }

/* =============================================
   3. 配色主题覆盖
   ============================================= */
.theme-midnight     { --bg: #0f172a; --sidebar: #1e293b; --text: #f1f5f9; --accent: #38bdf8; --border: #334155; --msg-user: #334155; }
.theme-ivory        { --bg: #fdfcf0; --sidebar: #f5f3e7; --text: #433422; --accent: #936324; --border: #e5e1cc; --msg-user: #ede9d0; }
.theme-ivory-sepia  { --bg: #f4ece1; --sidebar: #e8dfd0; --text: #5f4b32; --accent: #704214; --border: #dcd0bc; --msg-user: #e2d7c5; }
.theme-nord         { --bg: #eceff4; --sidebar: #d8dee9; --text: #2e3440; --accent: #5e81ac; --border: #cbd5e1; --msg-user: #e5e9f0; }

/* =============================================
   4. 全局重置与基础
   ============================================= */
* { box-sizing: border-box; font-family: 'Inter', sans-serif; transition: background 0.2s, color 0.2s; }

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
}

[contenteditable] { text-decoration-skip-ink: none !important; outline: none; }

[contenteditable="true"]:focus {
    outline: none;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =============================================
   5. 全页应用布局（主搜索页使用）
   ============================================= */
.app-container { display: flex; height: 100vh; width: 100vw; }
body.app-layout { overflow: hidden; }

/* 左侧栏 */
.sidebar-left {
    width: 260px; flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 16px;
    overflow: hidden;
    padding-bottom: 0;
}
/* 正在使用档案徽标（Broad Search / DeepSearch 显示） */
.current-profile-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(34, 165, 160, 0.10);
    border: 1px solid rgba(34, 165, 160, 0.25);
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}
.modal-name-input {
    flex: 1; min-width: 120px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: 'Inter', sans-serif; outline: none;
}
.modal-name-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34,165,160,0.10);
}



.logo { font-weight: 800; font-size: 20px; margin-bottom: 24px; }
.logo .logo-uni { color: #22A5A0; }
.logo .logo-match { color: #283558; }

.nav-btn {
    padding: 12px; margin-bottom: 8px;
    border-radius: 12px; cursor: pointer;
    font-weight: 600; font-size: 14px; text-align: left;
}
.nav-btn.active {
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.separator {
    margin: 20px 0 10px 12px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; opacity: 0.6;
}

.uni-list { flex-grow: 1; overflow-y: auto; min-height: 0; }

/* 2026-10-08：侧栏最底部的反馈入口。固定在列表下方（不随列表滚动），
   列表本身仍是 flex-grow + overflow，所以不会挡住对话项。 */
.sidebar-footer {
    flex-shrink: 0;
    margin: 8px -16px 0;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--sidebar);
    text-align: center;
}
.sidebar-footer a {
    font-size: 12px;
    color: var(--muted, #7d7d76);
    text-decoration: none;
}
.sidebar-footer a:hover { color: var(--accent); text-decoration: underline; }
.uni-item {
    padding: 10px 12px; font-size: 13px;
    border-radius: 8px; cursor: pointer; margin-bottom: 4px;
}
.uni-item--variant { display: flex; align-items: center; }
.uni-item--conversation { display: flex; align-items: flex-start; gap: 6px; }
/* 2026-09-30：侧栏标题不再单行省略 —— 学校名/文书名默认折行显示全文 */
.uni-item-title {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.uni-item-edit {
    flex-shrink: 0; width: 20px; height: 20px; padding: 0;
    border: none; background: transparent; color: var(--card-soft, #7d7d76);
    cursor: pointer; opacity: 0; transition: opacity .15s;
    display: inline-flex; align-items: center; justify-content: center;
}
.uni-item-edit svg { width: 13px; height: 13px; }
/* 2026-10-13（F4）：回复在你切走时落地 → 侧栏留个红点。
   旧行为是完全静默的，用户只能靠"我没看到"来追问（实测）。 */
.uni-item-unread {
    flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
    background: #ef4444; margin-top: 5px;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .16);
}
.uni-group-head .uni-item-unread { margin-top: 0; }
.uni-item--conversation:hover .uni-item-edit { opacity: .55; }
.uni-item--variant:hover .uni-item-edit { opacity: .55; }
.uni-item-edit:hover { opacity: 1; color: var(--accent); }
.uni-item-current-btn {
    flex-shrink: 0; border: none; background: transparent;
    color: var(--accent); font-size: 11px; font-weight: 600;
    cursor: pointer; padding: 2px 4px; opacity: .85;
}
.uni-item-current-btn:hover { opacity: 1; text-decoration: underline; }
.profile-current-badge {
    flex-shrink: 0; font-size: 10px; font-weight: 700;
    color: #1d4ed8; background: rgba(59, 130, 246, .12);
    border-radius: 8px; padding: 2px 6px; white-space: nowrap;
}
.variant-chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 18px; padding: 0 6px; margin-right: 8px;
    border-radius: 9px; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.variant-chip.ok { background: var(--accent); color: #fff; }
.variant-chip.none { background: #cbd5e1; color: #475569; }
.variant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.uni-item.selected {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    font-weight: 600;
}
.uni-list .uni-item:last-child {
    position: sticky;
    bottom: 0;
    background: var(--sidebar);
    border-top: 1px solid var(--border);
    margin-top: 8px;
    margin-bottom: 0;
    z-index: 1;
}

.sidebar-sub-menu { display: none; flex: 1; flex-direction: column; min-height: 0; }
html[data-active-module="profile"]   #menu-profile    { display: flex; flex-direction: column; min-height: 0; }
html[data-active-module="deepsearch"] #menu-deepsearch { display: flex; flex-direction: column; min-height: 0; }
html[data-active-module="broadsearch"] #menu-broadsearch { display: flex; flex-direction: column; min-height: 0; }
html[data-active-module="essay"]      #menu-essay      { display: flex; flex-direction: column; min-height: 0; }

/* 主舞台 */
.main-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.header { padding: 16px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }

.module-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - 65px);
    min-height: 0;
    min-width: 0;
}
html[data-active-module="profile"]   #panel-profile    { display: flex; }
html[data-active-module="deepsearch"] #panel-deepsearch { display: flex; }
html[data-active-module="broadsearch"] #panel-broadsearch { display: flex; }
html[data-active-module="essay"]      #panel-essay      { display: flex; }

/* 对话区 */
.chat-area {
    flex-grow: 1;
    padding: var(--chat-padding);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--msg-gap);
}
.user-msg {
    align-self: flex-end;
    background: var(--msg-user);
    padding: 14px 22px;
    border-radius: 22px;
    max-width: 85%;
    font-size: 15px;
    /* 2026-10-04：用户消息里的换行必须保留（发送时已把 \n 存成 <br>，
       历史消息可能直接是带 \n 的纯文本，两种都要能显示）。 */
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-msg {
    align-self: flex-start;
    width: 100%;
    font-size: var(--msg-font);
    line-height: var(--msg-leading);
}
.ai-msg p { margin: 0 0 8px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul, .ai-msg ol { margin: 6px 0 8px; padding-left: 22px; }
.ai-msg li { margin: 2px 0; }

/* 底部输入 */
.input-wrap {
    padding: var(--input-padding);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.input-box {
    flex-grow: 1;
    background: var(--sidebar);
    border: 1px solid var(--border);
    padding: 14px 18px 12px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.input-text {
    min-height: 24px;
    max-height: 168px;
    overflow-y: auto;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
}
/* 输入框提示语：走 data-placeholder + :empty，避免占位文本被当成真实输入发出去 */
.input-text:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}
.input-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.input-attachments {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 26px;
}
.input-send {
    font-size: 20px;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}

/* Agent 事件状态条（R2 精简版；R3 完善为顺序播放） */
.agent-status {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0;
}
.agent-status-play {
    padding: 4px 2px;
    border-left: 2px solid var(--accent);
    padding-left: 12px;
    margin: 4px 0;
}

/* Pending Action 模态表单（R3） */
.pending-field { margin-bottom: 14px; }
.pending-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pending-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
}
.pending-input:focus { border-color: var(--accent); }
.pending-tip { font-size: 13px; color: var(--muted); }

/* #11（2026-10-04）：长文本字段——默认一行摘要，点击展开大文本框 */
.pending-longbox {
    /* 2026-10-06（#3）：长文本控件与整张确认卡同宽（文书的"选定大纲"尤其需要） */
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: text;
}
.pending-longbox:hover { border-color: var(--accent); }
.pending-longbox-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-longbox-hint { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.pending-longedit { width: 100%; max-width: none; display: flex; flex-direction: column; gap: 6px; }
.pending-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
    font-family: inherit;
}
.pending-longedit-done {
    align-self: flex-end;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.pending-longedit-hint { font-size: 11px; color: var(--muted); }

/* #12（2026-10-04）：硬性约束按可选项展开成 是/否 下拉，不再手写 JSON */
.pending-constraint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pending-constraint-row:last-child { margin-bottom: 0; }
.pending-constraint-label {
    flex: 0 0 128px;
    font-size: 13px;
    color: var(--text);
}
.pending-select { max-width: 140px; flex: 1; }
.pending-constraint-row .pending-input { flex: 1; min-width: 0; }

/* ===== B4：对话内联确认卡（主路径；全屏模态仅兜底） ===== */
.pending-card {
    border: 1px solid var(--card-line, #deded8);
    border-radius: 8px;
    background: var(--card-paper, #fbfbfa);
    overflow: hidden;
    margin: 10px 0 4px;
    box-shadow: 0 1px 3px rgba(20, 20, 16, 0.08);
    transition: opacity 0.2s ease;
}
.pending-card[data-state="busy"],
.pending-card[data-state="done"],
.pending-card[data-state="rejected"] { opacity: 0.85; }
.pending-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-line, #deded8);
    background: var(--card-bar, #f2f2ef);
}
.pending-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(34, 165, 160, 0.12);
    color: #0f766e;
}
.pending-badge.is-done { background: rgba(34, 165, 160, 0.22); }
.pending-badge.is-error { background: rgba(220, 38, 38, 0.12); color: #b23b3b; }
.pending-card-title { font-size: 12px; font-weight: 600; color: var(--card-soft, #7d7d76); }
.pending-card-body { padding: 12px 16px 0; }
.pending-card-body .pending-input { max-width: 340px; }
/* #3（2026-10-06）：长文本 textarea 铺满整张卡，不受上面 340px 的短字段上限影响 */
.pending-card-body .pending-textarea { max-width: none; width: 100%; }
/* R18：只读参数（如已锁定的学校名）—— 看得见，改不了 */
.pending-value {
    max-width: 340px;
    padding: 9px 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.015);
}
/* R18：确认/取消后卡片收缩——参数区与按钮都不再出现，只留一行结果 */
.pending-card.is-collapsed .pending-card-head { border-bottom: none; }
.pending-card.is-collapsed .pending-card-note { padding: 0 12px 8px; }
.pending-card-note {
    padding: 0 16px;
    font-size: 12px;
    color: var(--card-soft, #7d7d76);
}
.pending-card-note:not(:empty) { padding: 2px 16px 6px; }
.pending-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px 12px;
}
.pending-btn {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--card-line, #deded8);
    background: transparent;
    color: var(--card-ink, #35352f);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pending-btn-reject:hover { background: rgba(20, 20, 16, 0.05); }
.pending-btn-accept {
    background: var(--accent, #22a5a0);
    border-color: var(--accent, #22a5a0);
    color: #fff;
    font-weight: 600;
}
.pending-btn-accept:hover { filter: brightness(0.95); }

/* ===== 套餐额度限制卡（对话内联，不是弹窗、不是报错） ===== */
.limit-card {
    border: 1px solid var(--card-line, #deded8);
    border-radius: 8px;
    background: var(--card-paper, #fbfbfa);
    overflow: hidden;
    margin: 10px 0 4px;
    box-shadow: 0 1px 3px rgba(20, 20, 16, 0.08);
}
.limit-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-line, #deded8);
    background: var(--card-bar, #f2f2ef);
}
.limit-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34, 165, 160, 0.14);
    color: #0f766e;
    white-space: nowrap;
}
.limit-card-title { font-size: 13px; font-weight: 700; color: var(--card-ink, #35352f); }
.limit-card-body {
    padding: 12px 16px 4px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--card-ink, #35352f);
}
.limit-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px 12px;
    flex-wrap: wrap;
}
.limit-btn {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--card-line, #deded8);
    background: transparent;
    color: var(--card-ink, #35352f);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.limit-btn:hover { background: rgba(20, 20, 16, 0.05); }
.limit-btn-primary {
    background: var(--accent, #22a5a0);
    border-color: var(--accent, #22a5a0);
    color: #fff;
    font-weight: 600;
}
.limit-btn-primary:hover { filter: brightness(0.95); background: var(--accent, #22a5a0); }

/* ===== Alignment A（2026-09-09 规范）：工件卡 Style B + Graphite token + 图标动作 ===== */
:root {
    --card-paper: #fbfbfa;
    --card-bar: #f2f2ef;
    --card-line: #deded8;
    --card-ink: #35352f;
    --card-soft: #7d7d76;
    --mark-bg: #fff08a;
    --mark-ink: #3d3408;
    --pill-bg: #efefe9;
    --pill-line: #d7d7d0;
    --pill-ink: #4c4c45;
}
.artifact-card {
    border: 1px solid var(--card-line, #deded8);
    border-radius: 8px;
    background: var(--card-paper, #fbfbfa);
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(20, 20, 16, 0.08);
}
.artifact-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-line, #deded8);
    background: var(--card-bar, #f2f2ef);
}
.artifact-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--card-soft, #7d7d76);
    white-space: nowrap;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artifact-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}
.artifact-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--card-ink, #35352f);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.artifact-action svg { width: 19px; height: 19px; }
.artifact-action:hover { background: rgba(34, 165, 160, 0.10); color: #0f766e; }
.artifact-body {
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--card-ink, #35352f);
}
.artifact-note {
    padding: 8px 18px;
    border-top: 1px dashed var(--card-line, #deded8);
    font-size: 11px;
    color: var(--card-soft, #7d7d76);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
/* 风险提示标识：卡片底部免责 + 引用未核实提示都带可见标记 */
.artifact-note .note-tag,
.verify-note .note-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex: 0 0 auto;
}
.artifact-note .note-tag svg { width: 12px; height: 12px; }
.artifact-note .note-text { color: var(--card-soft, #7d7d76); }
.verify-note {
    margin-top: 10px;
    padding: 8px 10px;
    border-left: 3px solid #d97706;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.08);
    color: #92400e;
    font-size: 13px;
}
.verify-note strong {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.18);
    color: #b45309;
    font-size: 11px;
}

/* R5：mark 柔和黄高亮（token；契约标题保留英文） */
.ai-msg mark {
    background: var(--mark-bg, #ffe9a8);
    color: var(--mark-ink, #4a3700);
    border-radius: 2px;
    padding: 0 2px;
}

/* 确定性高亮的 hover 释义；提示内容由前端按语义类添加。 */
.artifact-body mark[data-highlight-tip] {
    cursor: help;
}

/* 高亮释义浮层挂 body，不受 artifact-card 的 overflow:hidden 裁切。 */
.highlight-tip-float {
    position: fixed;
    max-width: 260px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: normal;
    z-index: 9999;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

/* R5：source pill + hover 引用原文 */
.source-pill {
    display: inline-flex;
    align-items: center;
    background: var(--border);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    position: relative;
    cursor: default;
}
.source-pill:hover::after {
    content: attr(data-quote);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    width: 260px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: normal;
    z-index: 30;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* R5：Sources 可折叠抽屉 */
.sources-drawer { border-top: 1px solid var(--border); }
.sources-toggle {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    padding: 8px 18px;
    text-align: left;
    cursor: pointer;
}
.sources-toggle:hover { color: var(--accent); }
.sources-list { display: none; padding: 4px 18px 12px; }
.sources-list.open { display: block; }
.sources-item { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sources-item:last-child { border-bottom: none; }
.sources-item-head { font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.sources-item-head a { color: var(--accent); font-size: 11px; font-weight: 500; white-space: nowrap; }
.sources-quote { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* 档案选择触发器：输入框内部的展开标签（显示当前档案 + 箭头） */
.profile-picker-trigger {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 14px;
    background: var(--card-paper, #fbfbfa);
    border: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    max-width: 220px;
    user-select: none;
    transition: background 0.15s;
}
.profile-picker-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-picker-caret {
    font-size: 15px; color: var(--muted); flex-shrink: 0;
    display: inline-block;
    transition: transform 0.15s;
}
.profile-picker-trigger.open .profile-picker-caret { transform: rotate(180deg); }

/* Profile Builder：创建档案处不显示档案切换触发器 */
html[data-active-module="profile"] .profile-picker-trigger { display: none; }

/* 档案选择浮层（展开的滚动列表） */
.profile-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 280px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    z-index: 50;
    display: none;
    padding: 6px;
}
.profile-picker.open { display: block; }
.profile-picker-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.profile-picker-item:hover { background: var(--border); }
.profile-picker-item.selected {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}
.profile-picker-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}
.pending-profile-select { position: relative; }
.pending-profile-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--card-line, #deded8);
    border-radius: 10px; background: var(--card-paper, #fbfbfa);
    font-size: 13px; font-weight: 600; color: var(--text);
    cursor: pointer; user-select: none;
}
.pending-profile-trigger.open .profile-picker-caret { transform: rotate(180deg); }
.pending-profile-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    max-height: 220px; overflow-y: auto; padding: 6px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); z-index: 60;
}
.pending-profile-menu.open { display: block; }
.essay-report-binding {
    font-size: 12px;
    color: var(--card-soft, #7d7d76);
    padding: 4px 2px;
    white-space: nowrap;
}

/* 复制按钮 */
/* 负边距抵消 .chat-area 的 flex gap：复制键紧贴对应消息，而不是被拉开一行 */
.copy-btn-container { display: flex; justify-content: flex-start; margin: calc(4px - var(--msg-gap)) 0 0 6px; }
.copy-btn-container.right { justify-content: flex-end; margin: calc(4px - var(--msg-gap)) 6px 0 0; }
.copy-report-btn {
    position: relative; background: transparent; border: none;
    color: var(--card-soft, #7d7d76); width: 32px; height: 32px; padding: 0;
    border-radius: 6px;
    cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; opacity: 0.55; transition: all 0.2s ease;
}
.copy-report-btn svg { width: 18px; height: 18px; }
.copy-report-btn:hover { opacity: 0.85; background: rgba(34, 165, 160, 0.10); color: #0f766e; }

/* Agent 切换引导：轻量、安静，不与标题字体撞风格 */
.module-guide {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    user-select: none;
}
.module-guide-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    opacity: 0.55;
}
.module-guide-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    opacity: 0.75;
}

/* ===== Alignment B（2026-09-09）：favicon+域名 pill / 右侧 Sources 抽屉 / essay-ready ===== */
.src-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 2px 9px 2px 3px;
    margin-left: 4px;
    border-radius: 999px;
    border: 1px solid var(--pill-line, #d7d7d0);
    color: var(--pill-ink, #4c4c45);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    background: var(--pill-bg, #efefe9);
    position: relative;
    vertical-align: middle;
    transition: border-color 0.15s, background 0.15s;
}
.src-pill:hover, .src-pill:focus-visible {
    border-color: var(--pill-ink, #4c4c45);
    background: var(--card-bar, #f2f2ef);
    outline: none;
}

/* 引用收敛后的 (+N)：点开在原地展开这块被折叠的其余引用（2026-09-24） */
.src-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 18px;
    margin-left: 4px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px dashed var(--pill-line, #d7d7d0);
    background: transparent;
    color: var(--pill-ink, #4c4c45);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
    transition: border-color 0.15s, background 0.15s;
}
.src-more:hover, .src-more:focus-visible {
    border-style: solid;
    border-color: var(--pill-ink, #4c4c45);
    background: var(--pill-bg, #efefe9);
    outline: none;
}

/* 被折叠的 pill 只是隐藏，**不删**（否则落库 HTML 会丢引用、重开网页展不开） */
.src-pill.is-folded { display: none; }

/* Sources 抽屉底部说明：被隐藏的未引用检索结果（含别校页面） */
.sources-drawer-skipped {
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.6;
    color: #94a3b8;
    border-top: 1px dashed var(--border);
}

/* =============================================
   13. Essay Assistant：学校分组 + 一校多文书（2026-09-29）
   ============================================= */
.uni-group-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-top: 6px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    background: var(--bg);
}
.uni-group-head:hover { background: #e9eef5; }
.uni-group-caret { font-size: 10px; color: #94a3b8; width: 10px; }
.uni-group-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    /* 折行显示学校全名，不截断成"几个字母+省略号" */
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.uni-group-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: #64748b;
}
.uni-group-badge.ok { color: var(--green); border-color: #a7f3d0; background: #ecfdf5; }
.uni-group-badge.none { color: var(--amber); border-color: #fde68a; background: #fffbeb; }
.uni-group-action {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}
.uni-group-action svg { width: 13px; height: 13px; }
.uni-group-action-text { font-size: 10.5px; font-weight: 700; line-height: 1; }
.uni-group-action:hover { color: var(--text); background: #fff; }

.uni-group-menu {
    position: absolute;
    top: calc(100% - 2px);
    right: 6px;
    z-index: 900;
    min-width: 190px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    padding: 4px;
}
.uni-group-menu-item {
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 12.5px;
    cursor: pointer;
    color: var(--text);
}
.uni-group-menu-item:hover { background: var(--bg); }
.uni-group-menu-item.selected { color: var(--accent); font-weight: 700; }
.uni-group-menu-empty { padding: 8px 9px; font-size: 12px; color: #94a3b8; }

.uni-item--thread { padding-left: 18px; }
.uni-item-type {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid #a7e5e2;
    background: #f0fbfa;
    border-radius: 999px;
    padding: 1px 5px;
    margin-right: 6px;
    flex: none;
}

.essay-new-field { margin-bottom: 14px; }
.essay-new-label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.essay-new-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
.essay-new-select:hover { border-color: var(--accent); }
.essay-new-menu {
    margin-top: 6px;
    max-height: 210px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 4px;
}
.essay-new-option { padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.essay-new-option:hover { background: var(--bg); }
.essay-new-option.selected { color: var(--accent); font-weight: 700; }
.essay-new-option-fixed {
    border-top: 1px dashed var(--border);
    margin-top: 4px;
    color: var(--accent);
    font-weight: 600;
}
.essay-new-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    outline: none;
}
.essay-new-input:focus { border-color: var(--accent); }
.essay-new-hint { font-size: 12px; color: #94a3b8; line-height: 1.6; }

/* 工件卡底部的文书 ID（排障用，可复制） */
.artifact-id-line {
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    user-select: all;
}
.artifact-id-line:hover { color: var(--accent); }

/* 确认卡上的资源提示 + "先做 School Research"入口（P1，2026-09-29） */
.pending-card-notice {
    margin: 8px 0 0;
    padding: 8px 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.pending-btn-report {
    margin-top: 10px;
    border: 1px dashed var(--accent);
    background: #f0fbfa;
    color: #0f766e;
}
.pending-btn-report:hover { background: #e0f7f5; }

/* 创造力档位（P4）：文书输入区的三档切换 */
.creativity-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}
.creativity-label { font-size: 11px; color: #94a3b8; }
.creativity-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-radius: 999px;
    padding: 2px 6px;
    cursor: pointer;
}
.creativity-btn:hover { background: var(--bg); }
.creativity-btn.active { background: var(--accent); color: #fff; }
.src-face {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #7b7b73;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}
.src-face img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    display: block;
}
.src-ico-fallback {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}
.src-name {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 2026-10-04：来源胶囊只显示短来源名（如 Mastersportal），比正文更小更安静 */
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.src-tip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: #35352f;
    color: #f6f5ef;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 11px;
    border-radius: 8px;
    white-space: normal;
    z-index: 40;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}
.src-pill:hover .src-tip { display: block; }
.src-tip-tag {
    display: block;
    margin-bottom: 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #7fd8d2;
}

/* 引用浮层：挂 body、fixed 定位，不受卡片 overflow 裁切 */
.src-tip-float {
    position: fixed;
    max-width: 320px;
    background: #35352f;
    color: #f6f5ef;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 11px;
    border-radius: 8px;
    white-space: normal;
    z-index: 9999;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}
.src-tip-float .src-tip-tag { color: #7fd8d2; }

/* 卡底来源入口：叠头像 + N sources */
.src-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 2px 10px 2px 4px;
    border-radius: 999px;
    border: 1px solid var(--pill-line, #d7d7d0);
    background: var(--pill-bg, #efefe9);
    color: var(--pill-ink, #4c4c45);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}
.src-open-btn:hover {
    border-color: var(--pill-ink, #4c4c45);
    background: var(--card-bar, #f2f2ef);
}
.src-stack-avatars { display: inline-flex; align-items: center; }
.src-open-btn .src-face { width: 16px; height: 16px; border: 1.5px solid var(--pill-bg, #efefe9); }
.src-stack-avatars .src-stack-face + .src-stack-face { margin-left: -6px; }

/* 右侧 Sources 抽屉 */
#sources-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.26);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s, visibility 0.22s;
    z-index: 5900;
}
#sources-drawer-backdrop.show { opacity: 1; visibility: visible; }
#sources-drawer-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: min(380px, 92vw);
    height: 100vh;
    background: var(--card-paper, #fbfbfa);
    box-shadow: -10px 0 34px rgba(15, 23, 42, 0.22);
    transition: right 0.24s ease;
    z-index: 6000;
    padding: 18px 16px;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#sources-drawer-panel.open { right: 0; }
.sources-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--card-ink, #26261f);
    border-bottom: 1px solid var(--card-line, #deded8);
    padding-bottom: 12px;
}
.sources-drawer-close {
    width: 28px;
    height: 28px;
    border: 1px solid var(--card-line, #deded8);
    background: #fff;
    border-radius: 8px;
    color: var(--card-soft, #575750);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.sources-drawer-close:hover { background: var(--card-bar, #f2f2ee); }
.sources-drawer-list { display: flex; flex-direction: column; gap: 10px; }
.sources-drawer-item {
    border: 1px solid var(--card-line, #deded8);
    background: #fff;
    border-radius: 8px;
    padding: 11px;
}
.sources-drawer-item.highlight {
    outline: 2px solid #ffd84d;
    outline-offset: 1px;
    background: #fffbe6;
}
.sources-drawer-title {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--card-ink, #26261f);
    text-decoration: none;
    margin-bottom: 5px;
}
.sources-drawer-title:hover { text-decoration: underline; }
.sources-drawer-quote {
    color: #57534e;
    font-size: 12.5px;
    font-style: italic;
    line-height: 1.55;
    border-left: 2px solid #e3c95d;
    padding: 2px 0 2px 9px;
    margin: 0 0 7px;
}
.sources-drawer-noquote {
    color: var(--card-soft, #7d7d76);
    font-size: 12px;
    font-style: italic;
    margin: 0 0 7px;
}
.sources-drawer-link {
    display: block;
    font-size: 11px;
    color: #4e746f;
    word-break: break-all;
    text-decoration: none;
}
.sources-drawer-link:hover { text-decoration: underline; }

/* essay-ready：加粗下划线，hover 整句浮起，点击复制（不黄高亮） */
.essay-ready {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
    display: inline-block;
    border-radius: 8px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.essay-ready:hover {
    transform: translateY(-2px);
    background: var(--card-bar, #f2f2ef);
    box-shadow: 0 1px 2px rgba(20, 20, 16, 0.08), 0 7px 16px rgba(20, 20, 16, 0.10);
}

/* 点的使用句独占一行：· Point one: …(pill)(+N) / __I will …__（2026-09-24） */
.artifact-body li > .essay-ready { display: block; margin-top: 4px; }

/* Essay 工件卡编辑态 */
.artifact-card.editing .artifact-body {
    background: #fff;
    cursor: text;
    outline: none;
}
.artifact-card.editing .artifact-body .src-pill,
.artifact-card.editing .artifact-body .essay-ready {
    pointer-events: none;
}

/* =============================================
   6. 认证组件（登录页使用）
   ============================================= */

/* 页面容器 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

/* 登录卡片 */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 0 0 1px var(--border);
    padding: 44px 40px 36px;
}

/* 品牌标识 */
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-brand .logo-text {
    font-weight: 800; font-size: 24px;
    letter-spacing: -0.3px;
    color: #22A5A0;
}
.auth-brand .logo-text span { color: #283558; }
.auth-brand .tagline {
    font-size: 14px; color: #64748b;
    margin-top: 6px; font-weight: 400;
}

/* Tabs 切换 */
.auth-tabs {
    display: flex;
    background: var(--sidebar);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1; border: none; background: transparent;
    padding: 10px 16px; border-radius: 10px;
    font-size: 14px; font-weight: 600;
    color: var(--text); cursor: pointer; opacity: 0.5;
    transition: all 0.2s;
}
.auth-tab:hover { opacity: 0.75; }
.auth-tab.active {
    background: #fff; opacity: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    color: var(--accent);
}

/* 表单 */
.auth-form { display: none; flex-direction: column; gap: 18px; }
.auth-form.visible { display: flex; }

.auth-input {
    width: 100%; padding: 14px 18px;
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 14px; font-family: 'Inter', sans-serif;
    color: var(--text); background: #fff; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input::placeholder { color: #94a3b8; }
.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.10);
}

.auth-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: #64748b; cursor: pointer; user-select: none;
}
.auth-check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent); cursor: pointer;
}

.auth-btn {
    width: 100%; padding: 14px; border: none; border-radius: 12px;
    background: var(--accent); color: #fff;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
}
.auth-btn:hover { background: #1a8a86; }
.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.auth-btn .spinner {
    display: none; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.6s linear infinite; margin: 0 auto;
}
.auth-btn.loading .spinner { display: inline-block; }
.auth-btn.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-footer {
    text-align: center; font-size: 13px;
    color: #94a3b8; margin-top: 4px;
}
.auth-footer a {
    color: var(--accent); text-decoration: none;
    font-weight: 600; cursor: pointer;
}
.auth-footer a:hover { text-decoration: underline; }

/* =============================================
   7. Toast 通知组件
   ============================================= */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column;
    gap: 10px; pointer-events: none;
}
.toast {
    pointer-events: auto; background: #fff;
    border-radius: 12px; padding: 14px 20px;
    font-size: 14px; font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10), 0 0 0 1px var(--border);
    display: flex; align-items: center; gap: 10px;
    max-width: 380px; animation: toast-in 0.3s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}
.toast.removing { opacity: 0; transform: translateY(-10px); }
.toast.toast-success { border-left: 4px solid #059669; }
.toast.toast-error   { border-left: 4px solid #dc2626; }
.toast .toast-icon { font-size: 18px; line-height: 1; }
.toast.toast-success .toast-icon { color: #059669; }
.toast.toast-error   .toast-icon { color: #dc2626; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   8. 开发者调试面板（Ctrl+Shift+D）
   ============================================= */
.debug-panel {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    height: 280px; background: #0f172a; color: #e2e8f0;
    z-index: 10000; flex-direction: column;
    font-family: 'JetBrains Mono','Fira Code','Consolas',monospace;
    font-size: 12px; border-top: 2px solid var(--accent);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.20);
    animation: debug-slide-up 0.25s ease-out;
}
.debug-panel.open { display: flex; }
@keyframes debug-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.debug-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; background: #1e293b;
    border-bottom: 1px solid #334155; flex-shrink: 0;
}
.debug-header .debug-title {
    font-weight: 700; font-size: 13px;
    display: flex; align-items: center; gap: 8px; color: #f1f5f9;
}
.debug-header .debug-title .badge {
    background: var(--accent); color: #fff;
    font-size: 10px; padding: 2px 8px;
    border-radius: 6px; font-weight: 600;
}
.debug-header .debug-actions { display: flex; gap: 8px; }
.debug-header .debug-actions button {
    background: #334155; border: none; color: #cbd5e1;
    padding: 6px 12px; border-radius: 6px; font-size: 11px;
    cursor: pointer; font-family: 'Inter', sans-serif;
    font-weight: 500; transition: background 0.15s;
}
.debug-header .debug-actions button:hover { background: #475569; color: #fff; }

.debug-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.debug-body .log-entry {
    padding: 8px 18px; border-bottom: 1px solid #1e293b;
    display: flex; flex-direction: column; gap: 4px;
}
.debug-body .log-entry:hover { background: rgba(255,255,255,0.03); }

.log-entry .log-head {
    display: flex; align-items: center; gap: 12px;
}
.log-entry .log-method {
    font-weight: 700; font-size: 11px; padding: 2px 8px;
    border-radius: 4px; background: #334155; flex-shrink: 0;
}
.log-entry .log-method.get     { color: #38bdf8; }
.log-entry .log-method.post    { color: #4ade80; }
.log-entry .log-method.put     { color: #fbbf24; }
.log-entry .log-method.delete  { color: #f87171; }

.log-entry .log-status {
    font-weight: 600; font-size: 11px; padding: 2px 8px;
    border-radius: 4px; flex-shrink: 0;
}
.log-entry .log-status.status-2xx { color: #4ade80; background: rgba(74,222,128,0.10); }
.log-entry .log-status.status-4xx { color: #fbbf24; background: rgba(251,191,36,0.10); }
.log-entry .log-status.status-5xx { color: #f87171; background: rgba(248,113,113,0.10); }

.log-entry .log-url {
    flex: 1; color: #94a3b8; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.log-entry .log-time { color: #64748b; font-size: 11px; flex-shrink: 0; }
.log-entry .log-duration { color: #64748b; font-size: 11px; }
.log-entry .log-expand { color: #64748b; font-size: 10px; cursor: pointer; user-select: none; }
.log-entry .log-expand:hover { color: #94a3b8; }

.log-entry .log-detail {
    display: none; padding: 8px 12px; margin-top: 4px;
    background: #1e293b; border-radius: 8px; font-size: 11px;
    line-height: 1.5; white-space: pre-wrap; word-break: break-all;
    max-height: 200px; overflow-y: auto;
}
.log-entry .log-detail.open { display: block; }

.debug-empty {
    padding: 40px 18px; text-align: center;
    color: #64748b; font-size: 13px; font-family: 'Inter', sans-serif;
}

.dev-hint {
    position: fixed; bottom: 16px; left: 50%;
    transform: translateX(-50%); font-size: 11px; color: #94a3b8;
    background: rgba(255,255,255,0.85); padding: 6px 14px;
    border-radius: 20px; backdrop-filter: blur(4px);
    border: 1px solid var(--border); opacity: 0;
    transition: opacity 0.4s; pointer-events: none; z-index: 100;
}
.dev-hint.visible { opacity: 1; }

/* =============================================
   9. 设计器工具（隐藏的开发者面板）
   ============================================= */
.store {
    position: fixed; right: 20px; top: 20px; width: 280px;
    background: #fff; border: 2px solid #000; border-radius: 12px;
    z-index: 10000; box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    color: #000; overflow: hidden;
}
.store.hidden { display: none !important; }
.store-header { background: #000; color: #fff; padding: 10px; font-size: 10px; font-weight: 900; cursor: move; text-transform: uppercase; }
.store-body { padding: 15px; max-height: 80vh; overflow-y: auto; }
.store h4 { margin: 15px 0 5px 0; font-size: 10px; font-weight: 800; color: #888; border-bottom: 1px solid #eee; }
.store button { width: 100%; padding: 8px; margin-bottom: 4px; cursor: pointer; font-size: 11px; background: #f8f8f8; border: 1px solid #ddd; text-align: left; border-radius: 4px; }
.toolbar-group { display: flex; gap: 4px; margin-bottom: 8px; }
.tool-btn { flex: 1; text-align: center !important; font-weight: bold; }
.highlight-pal { display: flex; gap: 6px; margin: 6px 0; }
.hl-dot { width: 28px; height: 28px; border-radius: 4px; cursor: pointer; border: 1px solid #ddd; }

/* =============================================
   10. 响应式
   ============================================= */
@media (max-width: 480px) {
    .auth-card { padding: 32px 24px 28px; border-radius: 16px; }
    .auth-brand .logo-text { font-size: 20px; }
    .debug-panel { height: 40vh; }
}

/* =============================================
   11. 用户设置浮层（mainpage.html 头像点击打开）
   ============================================= */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.45);
}
.settings-overlay.visible { display: block; }

.settings-shell {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, calc(100vw - 48px));
    height: min(640px, calc(100vh - 48px));
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    overflow: hidden;
}

/* 左侧导航 */
.settings-nav {
    width: 220px;
    flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
}
.settings-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 6px;
}
.settings-brand { font-weight: 800; font-size: 18px; }
.settings-brand .logo-uni { color: #22A5A0; }
.settings-brand .logo-match { color: #283558; }
.settings-close {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text);
    opacity: 0.55;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.15s, opacity 0.15s;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}
.settings-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

/* 设置页导航项：与主页导航按钮使用相同的 .nav-btn 类（见 mainpage.html），
   视觉与主页完全一致；同时强制禁掉浏览器默认的焦点轮廓（黑框），
   确保任何状态（点击/聚焦/按下）都不显示。 */
.settings-nav-item:focus,
.settings-nav-item:focus-visible,
.settings-nav-item:active {
    outline: none !important;
}
.settings-overlay button:focus,
.settings-modal-overlay button:focus,
.settings-overlay button:focus-visible,
.settings-modal-overlay button:focus-visible {
    outline: none !important;
}
.settings-nav-foot {
    margin-top: auto;
    padding: 10px 8px 0;
    font-size: 11px;
    color: #94a3b8;
    border-top: 1px solid var(--border);
}

/* 右侧内容区 */
.settings-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 28px 32px;
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.settings-panel-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.settings-primary-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.settings-primary-btn:hover { background: #1a8a86; }
.settings-primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Profile 列表 */
.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-list-empty {
    padding: 48px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
}
.profile-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s;
}
.profile-list-item:hover { border-color: #cbd5e1; }
.profile-list-info { flex: 1; min-width: 0; }
.profile-list-name { font-size: 15px; font-weight: 700; color: var(--text); }
.profile-list-summary {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-list-date { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.profile-list-actions { display: flex; gap: 8px; flex-shrink: 0; }

.settings-btn-ghost {
    padding: 7px 14px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.settings-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.settings-btn-danger-ghost {
    padding: 7px 14px;
    background: #fff;
    color: var(--red);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.settings-btn-danger-ghost:hover { border-color: var(--red); background: #fef2f2; }

.settings-btn-primary {
    padding: 9px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.settings-btn-primary:hover { background: #1a8a86; }

.settings-btn-danger {
    padding: 9px 22px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.settings-btn-danger:hover { background: #b91c1c; }

/* 套餐面板 */
.plan-status-head {
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
    border: 1px solid #cdeae7;
}
.plan-status-title { font-size: 15px; font-weight: 800; color: #0f766e; }
.plan-status-desc { font-size: 12.5px; color: #475569; margin-top: 6px; line-height: 1.6; }
.plan-entitlement {
    margin-top: 14px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.plan-entitlement-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.plan-entitlement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.plan-entitlement-label { color: #64748b; }
.plan-entitlement-value { font-weight: 800; color: var(--accent); }
.plan-entitlement-tip { font-size: 11.5px; color: #94a3b8; margin-top: 6px; }
.plan-entitlement-actions { margin-top: 12px; }
.plan-entitlement-actions button[disabled] { opacity: 0.55; cursor: not-allowed; }
.plan-entitlement-redeem { margin-top: 12px; }
.redeem-row { display: flex; gap: 8px; align-items: center; }
.redeem-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.redeem-input:focus { border-color: var(--accent); }
.plan-entitlement-msg { font-size: 12.5px; margin-top: 8px; min-height: 16px; color: #64748b; }
.plan-entitlement-msg.ok { color: #0f766e; font-weight: 600; }
.plan-entitlement-msg.error { color: #b23b3b; }
.plan-referral { margin-top: 12px; }

/* 分享卡片：阶段性成果后的低打扰推荐（非弹窗） */
.share-card {
    border: 1px solid #cdeae7;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
    padding: 14px 16px;
    margin: 10px 0 4px;
}
.share-card-title { font-size: 14px; font-weight: 800; color: #0f766e; }
.share-card-body { font-size: 13px; color: #475569; margin-top: 6px; line-height: 1.6; }
.share-card-body strong { color: var(--text); }
.share-card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 阶段完成 / 下一步卡片（A3+A4）：一张卡讲清"做完了什么 + 下一步" */
.next-step-card {
    border: 1px solid var(--card-line, #deded8);
    border-radius: 8px;
    background: var(--card-paper, #fbfbfa);
    overflow: hidden;
    margin: 10px 0 4px;
    box-shadow: 0 1px 3px rgba(20, 20, 16, 0.08);
}
.next-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-line, #deded8);
    background: var(--card-bar, #f2f2ef);
}
.next-step-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(34, 165, 160, 0.14);
    color: #0f766e;
    white-space: nowrap;
}
.next-step-title { font-size: 13px; font-weight: 700; color: var(--card-ink, #35352f); }
.next-step-body {
    padding: 12px 16px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--card-ink, #35352f);
}
.next-step-schools { list-style: none; margin: 6px 0 0; padding: 0 16px; }
.next-step-schools li { font-size: 12.5px; line-height: 1.9; color: #475569; }
.next-step-schools .next-step-done { color: #0f766e; font-weight: 600; }
.next-step-schools .next-step-todo { color: #94a3b8; }
.next-step-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 12px;
    flex-wrap: wrap;
}
.next-step-link {
    background: transparent;
    border: none;
    padding: 6px 4px;
    font-size: 12.5px;
    color: #64748b;
    text-decoration: underline;
    cursor: pointer;
}
.next-step-link:hover { color: #0f766e; }
.next-step-share {
    flex-basis: 100%;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
    border: 1px solid #cdeae7;
}

/* B6：生成中 / 待确认期间锁定输入 */
.conversation-locked .input-text { opacity: 0.55; }
.conversation-locked .input-send { opacity: 0.45; cursor: not-allowed; }
.input-box { position: relative; }
/* 锁定提示放在输入框正文的位置（更醒目），覆盖在可编辑区之上 */
.input-lock-hint {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 14px;
    font-size: 15px;
    line-height: 1.6;
    color: #94a3b8;
    pointer-events: none;
    background: var(--sidebar);
}

/* "卡住了？点这里解锁"：提示层整体不吃点击，只有这个链接单独放行 */
.input-lock-hint .input-unlock-link {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

/* 数据与隐私（R6） */
.privacy-inline {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}
.privacy-inline a { color: #0f766e; text-decoration: underline; }
.privacy-inline.compact { margin: 6px 0 0; font-size: 11.5px; }
.privacy-qa { margin-bottom: 12px; }
.privacy-q { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.privacy-a { font-size: 13px; color: #475569; line-height: 1.65; }
.privacy-counts {
    margin: 14px 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12px;
    color: #64748b;
}
.privacy-clear {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.settings-btn-ghost.danger { color: #b23b3b; border-color: #fecaca; }
.settings-btn-ghost.danger.confirming { background: #fef2f2; border-color: #ef4444; }
.privacy-clear-tip { margin-top: 8px; font-size: 11.5px; color: #94a3b8; line-height: 1.6; }
.plan-card-tagline { font-size: 12px; font-weight: 700; color: #0f766e; margin-top: 8px; }
.plan-card-deduct { font-size: 12px; color: #64748b; margin-top: 6px; }
.plan-card-payable { font-size: 14px; font-weight: 800; color: var(--text); margin-top: 4px; }

.plan-current-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    background: var(--gradient-positive);
    margin-bottom: 20px;
}
.plan-modal-overlay .settings-modal-lg {
    width: min(1080px, calc(100vw - 56px));
    height: min(760px, calc(100vh - 64px));
}
.plan-current-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.plan-current-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 6px;
}
.plan-current-name { font-size: 22px; font-weight: 800; color: var(--text); }
.plan-current-desc { font-size: 13px; color: #64748b; margin-top: 6px; }
.plan-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 7px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.plan-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.plan-status-active { opacity: 0.75; }
.plan-current-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.plan-feature-pill {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
}
.plan-current-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.plan-access {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 18px;
    background: #fff;
}
.plan-access-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    padding: 10px 0 4px;
}
.plan-access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}
.plan-access-name { font-weight: 600; color: var(--text); }
.plan-access-state { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.plan-access-state.ok { color: #065f46; background: #d1fae5; }
.plan-access-state.locked { color: #92400e; background: #fef3c7; cursor: pointer; }

/* 套餐选择弹窗 */
.settings-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.5);
    align-items: center;
    justify-content: center;
}
.settings-modal-overlay.visible { display: flex; }

.settings-modal {
    width: min(620px, calc(100vw - 48px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    overflow: hidden;
}
.settings-modal-lg { width: min(760px, calc(100vw - 48px)); }
.settings-modal-sm { width: min(420px, calc(100vw - 48px)); }
.settings-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}
.settings-modal-x {
    background: transparent;
    border: none;
    font-size: 15px;
    color: var(--text);
    opacity: 0.55;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
}
.settings-modal-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

/* 设置页按钮：彻底移除浏览器原生按钮外观（Windows 点击时闪现的黑框/系统高光），
   与主页导航按钮（div）的点击表现一致：无系统焦点环、无原生按下效果、不选中文字。
   键盘导航改用 box-shadow 指示焦点，鼠标点击不显示任何焦点框。 */
.settings-overlay button,
.settings-modal-overlay button {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
.settings-overlay button:focus,
.settings-modal-overlay button:focus,
.settings-overlay button:focus-visible,
.settings-modal-overlay button:focus-visible {
    outline: none;
}
.settings-overlay button:active,
.settings-modal-overlay button:active {
    outline: none;
    box-shadow: none;
}
.settings-overlay button:focus-visible:not(:active),
.settings-modal-overlay button:focus-visible:not(:active) {
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.25);
}

.settings-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; }
.settings-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.plan-cards {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.plan-card {
    flex: 1;
    min-width: 190px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.plan-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(34, 165, 160, 0.12); }
.plan-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.15);
    background: #f0fdfa;
}
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card-name { font-size: 15px; font-weight: 800; color: var(--text); }
.plan-card-badge {
    font-size: 11px;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.plan-card-price { font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 10px; }
.plan-card-desc { font-size: 12px; color: #64748b; margin-top: 6px; line-height: 1.5; }
.plan-card-features { margin: 12px 0 16px; padding: 0; list-style: none; flex: 1; }
.plan-card-features li {
    font-size: 12px;
    color: #334155;
    padding: 4px 0 4px 18px;
    position: relative;
}
.plan-card-features li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.plan-card-btn {
    padding: 9px 0;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.plan-card-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.plan-card-btn.disabled {
    background: #f1f5f9;
    border-color: var(--border);
    color: #94a3b8;
    cursor: not-allowed;
}

/* 激活码验证 */
.activation-view { padding-top: 6px; }
.activation-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.activation-hint { font-size: 14px; color: #475569; margin: 0 0 14px; }
.activation-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    letter-spacing: 0.5px;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.activation-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.15);
}
.activation-tip { font-size: 12px; color: #94a3b8; margin: 12px 0 0; }
.activation-actions { border-top: none; padding: 18px 0 0; }
.activation-summary {
    margin: 4px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfbfa;
}
.activation-summary:empty { display: none; }
.activation-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    line-height: 2;
    color: var(--text);
}
.activation-summary-row.muted { color: #64748b; }
.activation-summary-row.total {
    border-top: 1px dashed var(--border);
    margin-top: 6px;
    padding-top: 6px;
    font-weight: 800;
}
.pay-plan { font-size: 17px; font-weight: 800; color: var(--text); }
.pay-notice {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f0fdfa;
    border: 1px solid #cdeae7;
    font-size: 12.5px;
    color: #0f766e;
    line-height: 1.6;
}

/* 档案编辑弹窗 */
.security-account-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 18px;
}
.security-account-info .security-field {
    margin-bottom: 0;
}
.security-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}
.security-field input {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.security-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.15);
}
.profile-editor-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}
.profile-editor-textarea {
    min-height: 72px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.profile-editor-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 165, 160, 0.15);
}

/* 删除确认 */
.delete-confirm-title { font-size: 17px; font-weight: 800; color: var(--red); margin-bottom: 8px; }
.delete-confirm-text { font-size: 14px; color: #475569; margin: 0; line-height: 1.6; }

/* 设置浮层小屏适配 */
@media (max-width: 720px) {
    .settings-shell { flex-direction: column; }
    .settings-nav {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .settings-nav-head { margin: 0 8px 0 0; padding: 0; }
    .settings-nav-foot { display: none; }
    .settings-content { padding: 20px; }
}

/* =============================================
   12. 功能锁（Feature Access）
   ============================================= */

/* 侧栏锁定模块：置灰 + 锁图标 */
.nav-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
    position: relative;
}
.nav-btn.locked:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.nav-btn .lock-icon {
    margin-left: 8px;
    font-size: 12px;
    vertical-align: middle;
}

/* 升级提示弹窗 */
.upgrade-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 960;
    background: rgba(15, 23, 42, 0.5);
    align-items: center;
    justify-content: center;
}
.upgrade-overlay.visible { display: flex; }

.upgrade-modal {
    width: min(400px, calc(100vw - 48px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 32px 30px 26px;
    text-align: center;
}
.upgrade-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.upgrade-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}
.upgrade-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}
.upgrade-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.upgrade-btn-ghost {
    padding: 10px 22px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.15s, color 0.15s;
}
.upgrade-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.upgrade-btn-primary {
    padding: 10px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: background 0.15s;
}
.upgrade-btn-primary:hover { background: #1a8a86; }
.upgrade-btn-ghost:focus,
.upgrade-btn-primary:focus {
    outline: none;
}

/* =============================================
   12. 站内通知（铃铛 / 下拉列表 / 未读红点 / 详情弹窗）
   ============================================= */
.notif-wrap { position: relative; display: flex; align-items: center; }

.notif-bell {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.notif-bell:hover { background: var(--sidebar); border-color: var(--accent); }

/* 未读小红点（挂在铃铛右上角） */
.notif-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 2px #fff;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 336px;
    /* 列表可上下滚动 */
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    /* 必须低于 .review-overlay(1000)，否则会盖住设置/确认/详情弹窗 */
    z-index: 800;
    /* 不留内边距：否则吸顶标题栏四周会露出下面滚动中的通知（2026-09-24） */
    padding: 0;
}

.notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    /* 吸顶标题栏：必须铺满面板宽度并不透明，否则后面的通知会从缝隙露出来 */
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 2;
}
.notif-panel-title { font-size: 13px; font-weight: 700; color: var(--text); }
.notif-list { display: flex; flex-direction: column; padding: 6px; }
.notif-empty { padding: 22px 10px; text-align: center; color: #94a3b8; font-size: 13px; }

.notif-item {
    padding: 10px;
    border-radius: 10px;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.is-unread { border-left-color: var(--accent); background: #f2fbfa; }
.notif-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notif-kind { font-size: 11px; font-weight: 700; color: var(--accent); }
.notif-time { font-size: 11px; color: #94a3b8; }
.notif-item-title { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item-body {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 详情弹窗正文：通知正文是纯文本，保留换行即可 */
#notif-detail-body {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}
