/* AIHOME 家庭智能助手 — 三栏模式（左导航 / 中对话 / 右常用功能） */

:root {
    --bg: #f2f3f9;
    --card: #ffffff;
    --ink: #1d1f2a;
    --muted: #8a8f9e;
    --line: #eceef4;
    --brand: #6a5af9;
    --brand-deep: #5a48e8;
    --brand-soft: #edeafe;
    --ok: #22b573;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

svg {
    width: 20px; height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; outline: none; }
a { text-decoration: none; color: inherit; }

/* ========== 整体三栏 ========== */
#app {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr) 296px;
    flex: 1;
    min-height: 0;
}

/* 备案号页脚：常驻底部，不挤压三栏 */
.site-footer {
    flex-shrink: 0;
    padding: 5px 0 7px;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }

/* ========== 左侧导航 ========== */
.sidebar {
    background: #fbfbfd;
    border-right: 1px solid var(--line);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }

.brand-logo {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b7bff, #5a48e8);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(106, 90, 249, .35);
}
.brand-logo svg { width: 22px; height: 22px; }

.brand-text b { display: block; font-size: 15px; letter-spacing: .8px; }
.brand-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.new-chat {
    margin-top: 18px;
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #e4e6ef;
    border-radius: 12px;
    background: #fff;
    color: #3a3d4a;
    font-size: 14px;
    transition: .15s;
}
.new-chat svg { width: 16px; height: 16px; color: var(--brand); }
.new-chat:hover { border-color: var(--brand); color: var(--brand); }

.nav { margin-top: 16px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #565b6b;
    font-size: 14px;
    transition: .12s;
}
.nav-ico { color: #7c8294; }
.nav-item:hover { background: #f3f4f9; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--brand); }

.drawer-mask {
    position: fixed; inset: 0;
    background: rgba(20, 22, 34, .32);
    z-index: 40;
}

/* ========== 中间主列 ========== */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 26px 30px 22px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.menu-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 17px;
    color: #565b6b;
}

.head-text { flex: 1; min-width: 0; }
.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
}
.page-head h1 {
    font-size: 25px;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: .3px;
}
.head-sub { font-size: 14px; color: var(--muted); margin-top: 7px; }

.more-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 19px;
    line-height: 1;
    color: #6a6f7e;
    transition: .15s;
}
.more-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 对话卡 ---------- */
.chat-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 34px rgba(30, 32, 64, .06);
    padding: 22px;
}

.chat-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 4px;
}

.chat-hero { margin: auto; text-align: center; padding: 26px 0; }
.hero-logo {
    width: 66px; height: 66px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #8b7bff, #5a48e8);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px rgba(106, 90, 249, .38);
}
.hero-logo svg { width: 30px; height: 30px; }
.chat-hero h2 { font-size: 22px; font-weight: 700; }
.chat-hero p { font-size: 14px; color: var(--muted); margin-top: 9px; }

.message { display: flex; margin-top: 14px; }
.user-message { justify-content: flex-end; }
.ai-message { justify-content: flex-start; }

.message-content { max-width: 76%; display: flex; flex-direction: column; }

.message-bubble {
    max-width: 100%;
    padding: 11px 15px;
    font-size: 14.5px;
    line-height: 1.65;
    word-break: break-word;
}
.user-message .message-bubble {
    background: #e9e5ff;
    color: #23233a;
    border-radius: 16px 16px 4px 16px;
}
.ai-message .message-bubble {
    background: #f5f6fa;
    color: var(--ink);
    border-radius: 16px 16px 16px 4px;
}

.message-time { font-size: 11px; color: #b4b8c6; margin-top: 6px; }
.user-message .message-time { text-align: right; }

/* 对话里展示摄像头照片 */
.msg-img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
    margin: 6px 0 4px;
    display: block;
    cursor: zoom-in;
    border: 1px solid var(--line);
}

.message-bubble.loading { display: flex; gap: 5px; padding: 15px 18px; }
.message-bubble.loading span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #b9aedf;
    animation: blink 1.2s infinite;
}
.message-bubble.loading span:nth-child(2) { animation-delay: .2s; }
.message-bubble.loading span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 70%, 100% { opacity: .3; } 35% { opacity: 1; } }

/* 流式打字机光标 */
.message-bubble.typing::after {
    content: '▍';
    color: var(--brand);
    animation: blink 1s infinite;
    margin-left: 1px;
}

/* 思考过程（推理模型 reasoning 折叠块） */
.think-wrap { margin-bottom: 6px; }
.think-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px;
    color: #9a8fc2;
    background: #f3f1fc;
    border: 1px solid #e6e1fa;
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
}
.think-toggle:hover { color: var(--brand); border-color: #d5cdf6; }
.think-detail {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.5;
    color: #8a8f9e;
    background: #faf9fd;
    border: 1px solid #efedf7;
    border-radius: 8px;
    padding: 7px 10px;
    max-height: 120px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.think-spinner {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #a89ae0;
    animation: blink 1.1s infinite;
}
.think-body {
    margin-top: 7px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #8b8ba7;
    background: #f8f7fd;
    border-left: 2.5px solid #ddd5f6;
    border-radius: 0 10px 10px 0;
    padding: 8px 12px;
    max-height: 180px;
    overflow-y: auto;
    word-break: break-word;
}

/* ---------- 订单确认卡（两段式支付） ---------- */
.order-card {
    margin-top: 16px;
    background: #fbfaff;
    border: 1.5px solid #e4e0ff;
    border-radius: 16px;
    padding: 16px;
}
.order-header { display: flex; justify-content: space-between; align-items: center; }
.order-title { font-size: 14px; font-weight: 700; }
.order-state { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.order-state.watching        { background: #fff4e3; color: #b26a00; }
.order-state.awaiting_confirm{ background: var(--brand-soft); color: var(--brand-deep); }
.order-state.paying          { background: #e3f2ff; color: #0a66c2; }
.order-state.paid            { background: #e3f8ec; color: #17945c; }
.order-state.failed          { background: #ffe9e9; color: #c0392b; }
.order-state.cancelled       { background: #f0f1f5; color: #667; }

.order-body { margin-top: 12px; }
.order-progress { font-size: 13.5px; color: #4a4e5e; line-height: 1.6; }

.order-screenshot-wrap { text-align: center; }
.order-screenshot {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.order-screenshot-placeholder {
    height: 180px;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px dashed #d8daf0;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
}

.order-note { font-size: 13px; color: #4a4e5e; line-height: 1.6; }
.order-note.paid { color: #17945c; font-weight: 600; }
.order-note.failed { color: #c0392b; }
.order-note.cancelled { color: var(--muted); }

.order-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-confirm {
    background: var(--brand);
    color: #fff;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}
.btn-confirm:hover { background: var(--brand-deep); }
.btn-cancel {
    background: #fff;
    border: 1px solid #e0e2ec;
    color: #565b6b;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 14px;
}
.btn-dismiss {
    margin-top: 10px;
    border: 1px solid #e0e2ec;
    background: #fff;
    color: #565b6b;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 13px;
}

/* ---------- 输入区 ---------- */
.chat-input { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.input-row { display: flex; align-items: center; gap: 10px; }

/* 附件芯片 */
.attach-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: #f2f0ff;
    border: 1px solid #e0dcfa;
    border-radius: 12px;
    font-size: 13px;
    color: var(--ink);
}
.attach-chip .attach-name {
    max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600;
}
.attach-chip .attach-state { color: #8a8fa3; font-size: 12px; }
.attach-chip .attach-state.ok { color: #1d9a5b; }
.attach-remove {
    margin-left: auto;
    width: 22px; height: 22px; border-radius: 50%;
    background: #e3e0f7; color: #55507a;
    font-size: 15px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.attach-remove:disabled { opacity: .5; }

.attach-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: #f2f0ff; color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    transition: .15s;
}
.attach-btn:hover:not(:disabled) { background: var(--brand-soft); }
.attach-btn:disabled { opacity: .4; cursor: default; }
.attach-btn svg { width: 18px; height: 18px; }

/* 反馈闭环 👍/👎 */
.fb-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.fb-btn {
    width: 28px; height: 28px; border-radius: 8px;
    background: transparent; border: 1px solid var(--line);
    font-size: 13px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: .15s;
}
.fb-btn:hover { background: #f2f0ff; }
.fb-btn.active { background: var(--brand-soft); border-color: var(--brand); }
.fb-input {
    flex: 1; min-width: 140px; height: 30px;
    border: 1px solid var(--line); border-radius: 8px;
    padding: 0 10px; font-size: 12.5px; background: #fff;
}
.fb-send {
    height: 30px; padding: 0 12px; border-radius: 8px;
    background: var(--brand); color: #fff; font-size: 12.5px;
}
.fb-done { font-size: 12px; color: #9aa0b4; }

/* 记忆页进化区块 */
.evolve-head { margin-top: 18px; }

.chat-input input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border-radius: 14px;
    border: 1px solid #e4e6ef;
    background: #f7f8fc;
    padding: 0 16px;
    font-size: 14.5px;
    color: var(--ink);
    transition: .15s;
}
.chat-input input:focus { border-color: var(--brand); background: #fff; }
.chat-input input::placeholder { color: #a9adbc; }
.chat-input input:disabled { opacity: .6; }

.mic-btn, .send-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: .15s;
}
.mic-btn { background: #f2f0ff; color: var(--brand); }
.mic-btn:hover { background: var(--brand-soft); }
.mic-btn.recording { background: #ffe9e9; color: #c0392b; animation: pulse 1.2s infinite; }
.mic-btn.voice-mode-btn { background: #f2f0ff; color: #9a97b0; }
.mic-btn.voice-mode-btn.on { background: var(--brand); color: #fff; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .25); }
    50% { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); }
}

.send-btn { background: var(--brand); color: #fff; }
.send-btn:hover:not(:disabled) { background: var(--brand-deep); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn svg, .mic-btn svg { width: 18px; height: 18px; }
.send-btn.stop { background: #e0533f; animation: pulse 1.2s infinite; }
.send-btn.stop:hover { background: #c0392b; }

/* ---------- 通用页卡 ---------- */
.page-card {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 34px rgba(30, 32, 64, .06);
    padding: 24px;
}

.page-note { font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* 生活服务 */
.life-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.life-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fcfcfe;
    padding: 18px;
    transition: .15s;
}
.life-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.life-card b { font-size: 15px; }
.life-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* 彩色图标瓦片（生活服务 / 能力页 / 右栏共用） */
.tone-blue   { background: #e8f1ff; color: #2f6fdd; }
.tone-green  { background: #e5f7ec; color: #1d9e5f; }
.tone-orange { background: #fff1e2; color: #d97a1f; }
.tone-purple { background: var(--brand-soft); color: var(--brand); }

.life-ico, .quick-ico, .ability-ico {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.life-ico svg, .quick-ico svg, .ability-ico svg { width: 20px; height: 20px; }

/* 我的能力 */
.ability-list { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.ability-group-title {
    margin: 16px 0 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
}
.ability-item {
    display: flex; align-items: center; gap: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 15px;
}
.ability-text { flex: 1; min-width: 0; }
.ability-text b { display: block; font-size: 14px; }
.ability-text span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ability-tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f0f1f5; color: #66708a; white-space: nowrap; }
.ability-tag.ok { background: #e3f8ec; color: #17945c; }
.tone-gray { background: #f0f1f5 !important; }

/* 智能家居：米家设备开关与只读状态 */
.mijia-ops { display: flex; flex-direction: column; gap: 8px; margin-left: 6px; }
.mijia-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.mijia-switch input { display: none; }
.mijia-switch .mijia-prop-name { font-size: 13px; color: #565b6b; min-width: 44px; }
.mijia-slider {
    position: relative; width: 42px; height: 24px; border-radius: 999px;
    background: #d9dce3; transition: background 0.2s; flex-shrink: 0;
}
.mijia-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.mijia-switch input:checked + .mijia-slider { background: var(--brand, #4f6ef7); }
.mijia-switch input:checked + .mijia-slider::after { left: 20px; }
.mijia-switch input:disabled + .mijia-slider { opacity: 0.45; cursor: not-allowed; }
.mijia-readonly { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 6px; max-width: 220px; }
.mijia-stat {
    font-size: 11.5px; color: var(--muted); background: #f4f5f8;
    border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px;
}

/* 记忆与偏好 */
.memory-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    max-width: 640px;
    font-size: 13.5px;
    color: #565b6b;
}
.memory-list { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin-top: 14px; }
.memory-item {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 15px;
}
.memory-text { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }
.memory-time { font-size: 11.5px; color: #b4b8c6; white-space: nowrap; }
.memory-del {
    border: none; background: #f0f1f5; color: #8a8f9e;
    width: 24px; height: 24px; border-radius: 50%;
    font-size: 12px; line-height: 1;
    cursor: pointer; flex-shrink: 0;
}
.memory-del:hover { background: #ffe4e4; color: #d5455c; }
.memory-empty {
    border: 1.5px dashed #e0e2ec;
    border-radius: 14px;
    padding: 26px 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

/* 占位页 */
.placeholder-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; gap: 12px;
}
.placeholder-ico {
    width: 74px; height: 74px;
    border-radius: 20px;
    background: #f1effe;
    color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.placeholder-ico svg { width: 32px; height: 32px; }
.placeholder-card h2 { font-size: 20px; }
.placeholder-card p { font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.7; }
.ghost-btn {
    margin-top: 8px;
    border: 1px solid #e0e2ec;
    background: #fff;
    color: #565b6b;
    border-radius: 10px;
    padding: 9px 20px;
    font-size: 13.5px;
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 应用与账号（设置页） ---------- */
.settings-form { max-width: 560px; }

.form-item { margin-bottom: 17px; }
.form-item > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3c4050;
    margin-bottom: 7px;
}
.hint-inline { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }

.form-item input[type="text"],
.form-item input[type="password"],
.form-item select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #e3e5ee;
    background: #fbfbfd;
    padding: 0 12px;
    font-size: 14px;
    color: var(--ink);
    transition: .15s;
}
.form-item input:focus, .form-item select:focus { border-color: var(--brand); background: #fff; }

.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.warn-hint { color: #b26a00; }

.payable-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.payable-item {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid #e0e2ec;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13px;
    color: #4a4e5e;
    cursor: pointer;
    transition: .12s;
}
.payable-item input { accent-color: var(--brand); }
.payable-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }

.sync-banner {
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.6;
}
.sync-banner.warn { background: #fff6e8; color: #9a6b00; }
.sync-banner.ok { background: #e7f7ee; color: #178a52; }

.confirm-btn {
    background: var(--brand);
    color: #fff;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    transition: .15s;
}
.confirm-btn:hover:not(:disabled) { background: var(--brand-deep); }
.confirm-btn:disabled { opacity: .5; cursor: default; }

/* 设置页系统日志 */
.settings-sep { border: none; border-top: 1px solid #ececf3; margin: 20px 0 14px; }
.logs-block { text-align: left; }
.logs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.logs-head b { font-size: 14px; }
.logs-tabs { display: inline-flex; background: #f0f0f7; border-radius: 8px; padding: 2px; }
.logs-tab { border: none; background: none; padding: 3px 10px; font-size: 12px; border-radius: 6px; color: #6a7080; cursor: pointer; }
.logs-tab.on { background: var(--brand); color: #fff; }
.logs-meta { flex: 1; font-size: 11px; color: #9aa0b0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: none; color: var(--brand); font-size: 12px; cursor: pointer; }
.logs-view {
    background: #0f1220; color: #c9d4e8;
    border-radius: 10px; padding: 12px;
    font-size: 11px; line-height: 1.5;
    max-height: 320px; overflow: auto;
    white-space: pre-wrap; word-break: break-all;
}
.logs-empty { font-size: 12px; color: #9aa0b0; }

/* ========== 右栏 ========== */
.rightbar {
    padding: 26px 26px 22px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow-y: auto;
}

.right-title { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 2px; }

.quick-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    transition: .15s;
}
.quick-card:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(30, 32, 64, .08); }
.quick-text { flex: 1; min-width: 0; }
.quick-text b { display: block; font-size: 14px; }
.quick-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.quick-chev { width: 16px; height: 16px; color: #c2c6d2; }

.host-card {
    margin-top: 6px;
    display: flex; align-items: center; gap: 13px;
    background: #f4f5f9;
    border-radius: 16px;
    padding: 15px 14px;
}
.host-diamond {
    width: 11px; height: 11px;
    border-radius: 2.5px;
    transform: rotate(45deg);
    background: #c9ccd8;
    flex-shrink: 0;
}
.host-card.ok { background: #eafaf1; }
.host-card.ok .host-diamond { background: var(--ok); box-shadow: 0 0 0 4px rgba(34, 181, 115, .15); }
.host-text b { display: block; font-size: 14px; color: #4a4e5e; }
.host-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.host-card.ok .host-text b { color: #17945c; }

/* ========== 轻提示 ========== */
.toast {
    position: fixed;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 30, 40, .92);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 100;
    animation: toast-in .2s ease-out;
    max-width: 82vw;
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #dcdee8; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== 响应式 ========== */
@media (max-width: 1179px) {
    #app { grid-template-columns: 236px minmax(0, 1fr); }
    .rightbar { display: none; }
}

@media (max-width: 768px) {
    #app { display: flex; flex-direction: column; }

    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 262px;
        z-index: 50;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 6px 0 30px rgba(20, 22, 40, .12);
    }
    .sidebar.open { transform: translateX(0); }

    .main { padding: 18px 16px 14px; }
    .page-head h1 { font-size: 21px; }
    .chat-card { padding: 16px; border-radius: 16px; }
    .message-content { max-width: 86%; }
    .life-grid { grid-template-columns: 1fr; }
    .chat-input input { height: 44px; }
    .mic-btn, .send-btn { width: 44px; height: 44px; }
}

/* ===== 助手设置页（OpenClaw 原生界面）===== */
.oc-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.oc-form label { font-size: 12px; color: var(--muted, #888); }
.oc-form input {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid var(--border, #ddd); border-radius: 8px;
    font-size: 13px; background: var(--input-bg, #fff); color: var(--text, #222);
}
.oc-btns { display: flex; gap: 8px; margin-top: 4px; }
.oc-btn {
    padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--accent, #4f7cff); color: #fff; font-size: 13px;
}
.oc-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.oc-reply {
    margin: 8px 0 0; padding: 10px; border-radius: 8px; white-space: pre-wrap;
    background: var(--reply-bg, #f4f6fa); border: 1px solid var(--border, #e2e6ee);
    font-size: 13px; color: var(--text, #333); max-height: 300px; overflow: auto;
}

/* ===== 历史会话列表 ===== */
.chat-toolbar { display: flex; gap: 8px; padding: 8px 14px 0; }
.tool-btn {
    padding: 5px 10px; font-size: 12px; border: 1px solid var(--border, #ddd);
    border-radius: 14px; background: var(--tool-btn-bg, #f4f6fa); color: var(--text, #555);
    cursor: pointer;
}
.tool-btn:hover { background: var(--accent, #4f7cff); color: #fff; border-color: transparent; }
.session-list {
    margin: 8px 14px 0; padding: 6px; border: 1px solid var(--border, #e2e6ee);
    border-radius: 10px; background: var(--card-bg, #fff);
    max-height: 40vh; overflow: auto;
}
.session-empty { padding: 12px; text-align: center; color: var(--muted, #999); font-size: 12px; }
.session-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 8px; cursor: pointer;
}
.session-item:hover { background: var(--hover-bg, #f4f6fa); }
.session-item.active { background: var(--accent-soft, #eef3ff); }
.session-body { flex: 1; min-width: 0; }
.session-title { font-size: 13px; color: var(--text, #333); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { font-size: 11px; color: var(--muted, #999); margin-top: 2px; }
.session-del {
    border: 0; background: transparent; color: var(--muted, #999); cursor: pointer;
    font-size: 12px; padding: 4px 6px; border-radius: 6px;
}
.session-del:hover { background: #fee2e2; color: #d33; }

/* ===== 打车面板 ===== */
.ride-panel { margin-top: 10px; border-top: 1px dashed var(--border, #e2e6ee); padding-top: 8px; }
.ride-route {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border: 1px solid var(--border, #e2e6ee); border-radius: 8px; margin-bottom: 6px;
    cursor: pointer;
}
.ride-route:hover { background: var(--hover-bg, #f4f6fa); }
.ride-route.active { background: var(--accent-soft, #eef3ff); border-color: var(--accent, #4f7cff); }
.ride-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ride-body span { font-size: 12px; color: var(--muted, #888); }
.ride-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ride-add input {
    flex: 1; min-width: 120px; padding: 7px 10px; font-size: 13px;
    border: 1px solid var(--border, #ddd); border-radius: 8px;
}
.ride-item { padding: 7px 10px; border-radius: 8px; }
.ride-item:hover { background: var(--hover-bg, #f4f6fa); }
.ride-item label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.ride-item b { min-width: 72px; }
.ride-item span { color: var(--text, #333); }
.ride-discount { color: #e8590c; font-size: 12px; }
.ride-btns { margin: 10px 0 4px; }

/* ===== 摄像头操作（拍照/云台） ===== */
.cam-ops { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.cam-btn { min-width: 36px; padding: 6px 8px; }
.cam-ptz { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cam-row { display: flex; gap: 2px; }
.cam-arrow {
    width: 26px; height: 26px; border: 1px solid var(--border, #ddd);
    border-radius: 6px; background: var(--card-bg, #fff); color: var(--text, #555);
    font-size: 11px; cursor: pointer; line-height: 1;
}
.cam-arrow:hover { background: var(--accent, #4f7cff); color: #fff; }
.cam-shot { margin-top: 10px; text-align: center; }
.cam-shot img { max-width: 100%; max-height: 55vh; border-radius: 10px; }
.cam-shot .oc-btn { margin-top: 8px; }

/* 手机控制（准流式接管） */
.phone-control { max-width: 420px; }
.phone-screen {
    position: relative; margin: 10px 0; border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden; background: #111;
    cursor: crosshair; user-select: none;
}
.phone-screen img { display: block; width: 100%; height: auto; }
.phone-screen.swipe-mode { cursor: grab; outline: 2px dashed var(--brand, #4f6ef7); }
.phone-screen-empty {
    display: flex; align-items: center; justify-content: center;
    height: 220px; color: #888; font-size: 13px;
}
.phone-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.phone-toolbar .oc-btn.active { background: var(--brand, #4f6ef7); color: #fff; }
.phone-input-row { display: flex; gap: 6px; flex: 1 1 100%; margin-top: 2px; }
.phone-input-row input {
    flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
    font-size: 13.5px; background: var(--input-bg, #fff);
}

/* OpenClaw 原生格式对齐（2026-10-19）：markdown 表格/列表/代码 + 完成统计 */
.message-bubble table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.message-bubble th, .message-bubble td { border: 1px solid #e5e5ea; padding: 6px 8px; text-align: left; }
.message-bubble th { background: #f5f5f7; font-weight: 600; }
.message-bubble ul, .message-bubble ol { margin: 6px 0; padding-left: 20px; }
.message-bubble li { margin: 2px 0; }
.message-bubble code { background: #f5f5f7; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.message-bubble pre { background: #f5f5f7; padding: 10px; border-radius: 8px; overflow-x: auto; margin: 8px 0; }
.message-bubble pre code { background: none; padding: 0; }
.message-bubble h1, .message-bubble h2, .message-bubble h3 { margin: 10px 0 6px; font-size: 15px; }
.msg-stats { font-size: 11px; color: #999; margin: 4px 0 2px 6px; }

/* ===== 量化研究页 ===== */
.quant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.quant-stat b { display: block; font-size: 14px; }
.quant-stat span { font-size: 12.5px; color: var(--muted); }
.quant-block { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; background: #fcfcfe; }
.quant-input {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.6;
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical;
    background: #fff; margin-top: 8px;
}
.quant-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.quant-inline { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 200px; }
.quant-err { color: #d23f31; font-size: 12.5px; margin-top: 10px; }
.quant-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.quant-table, .quant-periods { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.quant-tr { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 1fr 1fr 1fr; gap: 6px; padding: 8px 12px; font-size: 12.5px; border-top: 1px solid var(--line); }
.quant-tr:first-child { border-top: none; }
.quant-th { background: #f4f5f9; color: #66708a; font-weight: 600; }
.quant-periods .quant-tr { grid-template-columns: 1.2fr 1.2fr .6fr 1fr 1fr 1fr; }
.quant-digest {
    white-space: pre-wrap; font-size: 12.5px; line-height: 1.65; margin-top: 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 460px; overflow: auto;
}
/* 决策卡 */
.quant-picks { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.pick-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.pick-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pick-top b { font-size: 14px; }
.pick-code { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.pick-score { font-size: 18px; font-weight: 700; color: #2f6fed; }
.pick-price { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: #46506a; }
.pick-price b { color: #1f2740; }
.pick-stop { color: #d23f31; }
.pick-reasons { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.pick-reasons li { margin: 0; }
