/* ==============================================================
 * 招生智能助手 · 视觉系统
 * 主色调：深海军蓝 → 宝蓝 → 天蓝（高端学术感）
 * ============================================================== */

:root {
    /* 主色阶 */
    --blue-50:  #eef4ff;
    --blue-100: #dbe7ff;
    --blue-200: #b8d0ff;
    --blue-300: #8ab3ff;
    --blue-400: #5d92ff;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e3a8a;
    --blue-900: #0a2463;
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;

    /* 中性色 */
    --ink-900: #0b1428;
    --ink-700: #1f2a44;
    --ink-500: #475569;
    --ink-400: #64748b;
    --ink-300: #94a3b8;
    --ink-200: #cbd5e1;
    --ink-100: #e2e8f0;
    --ink-50:  #f1f5f9;

    /* 语义 */
    --primary:        var(--blue-600);
    --primary-soft:   var(--blue-100);
    --primary-deep:   var(--blue-800);
    --accent:         var(--cyan-500);
    --bg:             #f3f6fc;
    --surface:        #ffffff;
    --line:           rgba(15, 36, 76, 0.08);
    --line-strong:    rgba(15, 36, 76, 0.14);

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(10, 36, 99, 0.06);
    --shadow-md: 0 6px 18px rgba(10, 36, 99, 0.08);
    --shadow-lg: 0 20px 40px rgba(10, 36, 99, 0.10);
    --shadow-xl: 0 30px 60px rgba(10, 36, 99, 0.16);

    /* 圆角 */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* 渐变 */
    --grad-primary:   linear-gradient(135deg, #0a2463 0%, #1d4ed8 50%, #3b82f6 100%);
    --grad-soft:      linear-gradient(135deg, #eef4ff 0%, #f5f9ff 100%);
    --grad-bubble:    linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --grad-accent:    linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);

    /* 字体 */
    --font: "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink-700);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
}

/* 背景柔光（让大屏有层次感） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, rgba(34, 211, 238, 0.14), transparent 60%),
        linear-gradient(180deg, #eaf1ff 0%, #f5f8ff 60%, #f3f6fc 100%);
    z-index: -1;
    pointer-events: none;
}

button { font-family: inherit; }
input { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(10, 36, 99, 0.15); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(10, 36, 99, 0.25); }
::-webkit-scrollbar-track { background: transparent; }

/* =====================================================
 * 顶部 Header
 * ===================================================== */
.app-header {
    position: relative;
    height: 64px;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 24px rgba(10, 36, 99, 0.18);
    z-index: 50;
    overflow: hidden;
}

.header-inner {
    width: 100%;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    height: 46px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    flex-shrink: 0;
}

.brand-text { min-width: 0; flex: 1; }
.brand-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ghost-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-1px);
}
.ghost-btn:active { transform: translateY(0); }

.menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.2); }

.header-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(400px 80px at 20% 0%, rgba(125, 211, 252, 0.35), transparent 70%),
        radial-gradient(500px 100px at 80% 100%, rgba(59, 130, 246, 0.30), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* =====================================================
 * 主体布局
 * ===================================================== */
.app-main {
    height: calc(100vh - 64px);
    overflow: hidden;
}

.main-grid {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* =====================================================
 * 聊天面板
 * ===================================================== */
.chat-panel {
    min-width: 0;
    display: flex;
    min-height: 0;
}

.chat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    min-height: 0;
}

.chat-stream {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 32px;
    background:
        radial-gradient(800px 400px at 50% 0%, rgba(59, 130, 246, 0.04), transparent 60%),
        #fff;
    scroll-behavior: smooth;
}

/* ===== 欢迎页 ===== */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 32px 0 12px;
    animation: fadeInUp 0.5s ease;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.welcome-hero {
    text-align: center;
    margin-bottom: 28px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.welcome-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
}
.welcome-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.25);
    position: relative;
    z-index: 2;
}
.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--blue-400);
    animation: pulse 2.4s ease-out infinite;
    z-index: 1;
}
@keyframes pulse {
    0%   { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.4);  opacity: 0; }
}

.welcome-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 8px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
    line-height: 1.4;
    padding: 0 8px;
}

.welcome-desc {
    font-size: 14px;
    color: var(--ink-400);
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    display: block;
    line-height: 1.7;
}

/* 快捷问题 */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.qa-item {
    padding: 14px 16px;
    background: linear-gradient(135deg, #f4f8ff 0%, #eaf2ff 100%);
    border: 1px solid #dfe9fb;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13.5px;
    color: var(--ink-700);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}
.qa-item::before {
    content: "✦";
    color: var(--blue-500);
    font-size: 12px;
    margin-top: 1px;
    flex-shrink: 0;
}
.qa-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    border-color: var(--blue-300);
    color: var(--blue-700);
}

/* ===== 猜你想问 ===== */
.guess-block {
    width: 100%;
    max-width: 760px;
    margin: 4px auto 0;
    text-align: left;
}

.guess-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-500);
    margin: 8px 4px 10px;
    letter-spacing: 0.5px;
}

.guess-ico {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.guess-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.guess-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    min-width: 0;
}

.guess-item:hover {
    border-color: var(--blue-300);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.guess-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--blue-700);
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.guess-text {
    font-size: 13px;
    color: var(--ink-700);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* ===== 消息气泡 ===== */
.msg {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user { justify-content: flex-end; }
.bot  { justify-content: flex-start; }

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--grad-primary);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    overflow: hidden;
}
.msg-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.msg-avatar.user-avatar {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.25);
}

.bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.7;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.user .bubble {
    background: var(--grad-bubble);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}
.bot .bubble {
    background: #f1f5fb;
    color: var(--ink-700);
    border-bottom-left-radius: 6px;
    border: 1px solid #e6edf8;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-400);
    min-width: 84px;
}
.loading::after {
    content: "";
    width: 4px; height: 4px;
    border-radius: 50%;
    background: currentColor;
    margin-left: 4px;
    animation: dots 1.2s infinite;
    box-shadow: 8px 0 0 currentColor, 16px 0 0 currentColor;
}
@keyframes dots {
    0%, 20%   { opacity: 0.2; }
    50%       { opacity: 1; }
    80%, 100% { opacity: 0.2; }
}

/* =====================================================
 * 输入区
 * ===================================================== */
.composer {
    padding: 14px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.composer-inner {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: #f4f7fc;
    border: 1.5px solid #e3eaf5;
    border-radius: 22px;
    padding: 6px;
    transition: all 0.2s;
    min-height: 56px;
}
.composer-inner:focus-within {
    background: #fff;
    border-color: var(--blue-400);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

#inputMsg {
    flex: 1;
    min-height: 40px;
    max-height: 160px;
    height: auto;
    padding: 8px 4px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-900);
    min-width: 0;
    resize: none;
    font-family: inherit;
    align-self: center;
    overflow-y: auto;
}
#inputMsg::placeholder { color: var(--ink-300); }

.btn-send, .btn-stop {
    height: 44px;
    min-width: 76px;
    padding: 0 20px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
}

.btn-send {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
}
.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.40);
}
.btn-send:active { transform: translateY(0); }

.btn-stop {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    display: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-stop:hover { box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35); }

.composer-tip {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--ink-300);
    text-align: center;
    letter-spacing: 0.3px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* =====================================================
 * 右侧功能区
 * ===================================================== */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    transition: transform 0.3s ease;
}

.side-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
}

.card-head { margin-bottom: 12px; }
.card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-ico {
    width: 22px; height: 22px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
}

/* ===== 轮播 ===== */
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 170px;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--ink-100);
}

.carousel-zoom-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(10, 36, 99, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    display: grid;
    place-items: center;
    z-index: 2;
    pointer-events: none;
    opacity: 0.85;
}
.carousel {
    width: 100%;
    height: 100%;
    position: relative;
}
.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    position: absolute;
    inset: 0;
    transition: opacity 0.5s ease;
    cursor: zoom-in;
}
.carousel-img.active {
    display: block;
    animation: fadeIn 0.6s ease;
}
@keyframes fadeIn {
    from { opacity: 0.3; }
    to   { opacity: 1; }
}
.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}
.carousel-dots .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.carousel-dots .dot.active {
    width: 22px;
    border-radius: 4px;
    background: #fff;
}

/* ===== 自助服务 ===== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px 8px;
    border-radius: var(--r-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--ink-700);
    transition: all 0.2s;
    background: transparent;
    border: 1px solid transparent;
}
.service-item:hover {
    background: var(--primary-soft);
    border-color: var(--blue-200);
    transform: translateY(-2px);
}
.service-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
    color: var(--blue-600);
    display: grid;
    place-items: center;
    transition: all 0.25s;
}
.service-item:hover .service-icon {
    background: var(--grad-primary);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}
.service-item span {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

/* ===== 热点问题 ===== */
.hot-menu {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.hot-menu::-webkit-scrollbar { display: none; }

.hot-tab {
    padding: 5px 12px;
    background: var(--ink-50);
    color: var(--ink-500);
    border-radius: var(--r-pill);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
    flex-shrink: 0;
}
.hot-tab:hover {
    color: var(--blue-600);
    background: var(--primary-soft);
}
.hot-tab.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hot-list li {
    padding: 9px 12px;
    font-size: 13px;
    color: var(--ink-700);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}
.hot-list li::before {
    content: "";
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--ink-200);
    flex-shrink: 0;
    transition: all 0.2s;
}
.hot-list li:hover {
    background: var(--primary-soft);
    color: var(--blue-700);
    transform: translateX(2px);
}
.hot-list li:hover::before {
    background: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* =====================================================
 * 引用弹窗
 * ===================================================== */
.ref-title {
    font-size: 12px;
    color: var(--ink-400);
    display: flex;
    align-items: center;
    line-height: 1.4;
    margin: 8px 0 4px;
    font-weight: 500;
}
.ref-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
    margin-left: 8px;
}
.ref-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}
.ref-list a {
    color: var(--primary);
    cursor: pointer;
    display: inline-block;
    padding: 2px 0;
}

.ref-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(10, 36, 99, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: maskIn 0.2s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.ref-modal {
    width: 820px;
    max-height: 85vh;
    background: #fff;
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--grad-soft);
}
.modal-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.modal-tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
    color: var(--ink-500);
    transition: all 0.2s;
}
.tab:hover { background: var(--primary-soft); color: var(--blue-700); }
.tab.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.modal-close {
    cursor: pointer;
    font-size: 22px;
    color: var(--ink-400);
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--ink-50);
    color: var(--ink-700);
}
.modal-toolbar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    background: #fafbfd;
}
.modal-toolbar button {
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink-500);
    transition: all 0.2s;
}
.modal-toolbar button:hover {
    border-color: var(--blue-300);
    color: var(--blue-600);
}
.modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    line-height: 1.8;
    color: var(--ink-700);
}

.hl { background: #fff3a8; padding: 0 2px; border-radius: 2px; }
.doc-h1 { font-size: 18px; font-weight: 600; margin: 12px 0 6px; color: var(--ink-900); }
.doc-h2 { font-size: 16px; font-weight: 600; margin: 10px 0 4px; color: var(--ink-700); }
.doc-li { margin-left: 18px; list-style: disc; }

.embed-preview {
    width: 100%;
    height: 500px;
    border: none;
    margin-top: 10px;
    border-radius: 8px;
}

/* =====================================================
 * 图片灯箱（点击轮播图放大）
 * ===================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 45, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-stage {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

.lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: var(--r-md);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: grid;
    place-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s;
    z-index: 2;
}
.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 575px) {
    .lightbox { padding: 16px; }
    .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
    .lightbox-nav { width: 42px; height: 42px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-img { max-height: calc(100vh - 80px); }
}

/* =====================================================
 * 招生咨询电话弹窗
 * ===================================================== */
.phone-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.phone-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.phone-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(10, 36, 99, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.phone-modal-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-modal-head {
    padding: 18px 20px;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.phone-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.phone-modal-ico {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
}

.phone-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s;
}
.phone-modal-close:hover { background: rgba(255, 255, 255, 0.22); }

.phone-modal-body {
    padding: 18px 20px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phone-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--ink-900);
    background: #fff;
    transition: all 0.2s;
    cursor: pointer;
}
.phone-option:hover {
    border-color: var(--blue-400);
    background: var(--primary-soft);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}
.phone-option-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
    color: var(--blue-600);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.phone-option-text {
    flex: 1;
    min-width: 0;
}
.phone-option-label {
    font-size: 12px;
    color: var(--ink-400);
    margin-bottom: 2px;
}
.phone-option-num {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-700);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.phone-option-arrow {
    color: var(--ink-300);
    flex-shrink: 0;
}

.phone-modal-tip {
    padding: 10px 20px 18px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-300);
    letter-spacing: 0.3px;
}

@media (max-width: 575px) {
    .phone-modal { padding: 12px; }
    .phone-modal-card { max-width: 100%; }
}

.drawer-mask {
    position: fixed;
    inset: 0;
    background: rgba(10, 36, 99, 0.45);
    backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drawer-mask.show {
    opacity: 1;
    pointer-events: auto;
}

/* =====================================================
 * 响应式 — 平板
 * ===================================================== */
@media (max-width: 1100px) {
    .main-grid { grid-template-columns: 1fr 320px; gap: 16px; padding: 16px; }
    .qa-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    body { overflow: hidden; }
    .app-main { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
    .main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        padding: 12px;
        gap: 12px;
        height: 100%;
    }
    .chat-panel { height: 100%; min-height: 0; }
    .chat-card { height: 100%; }
    .side-panel { display: none; }
    .side-panel.open {
        display: flex;
        position: fixed;
        top: 64px;
        right: 0;
        bottom: 0;
        width: 86%;
        max-width: 360px;
        background: var(--bg);
        padding: 16px;
        z-index: 70;
        overflow-y: auto;
        box-shadow: -8px 0 24px rgba(10, 36, 99, 0.18);
        animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes slideInRight {
        from { transform: translateX(100%); }
        to   { transform: translateX(0); }
    }
    .menu-btn { display: inline-flex; }
    .ghost-btn span { display: none; }
    .ghost-btn { padding: 0; width: 38px; justify-content: center; }
    .brand-title { font-size: 15px; }
    .chat-stream { padding: 20px 18px; }
    .welcome { padding: 20px 0 8px; }
    .welcome-title { font-size: 17px; padding: 0 6px; }
    .welcome-desc { font-size: 13px; padding: 0 12px; }
    .qa-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .qa-item { font-size: 13px; padding: 12px 12px; }
    .guess-grid { grid-template-columns: repeat(2, 1fr); }
    .guess-text { font-size: 12.5px; }
}

/* =====================================================
 * 响应式 — 手机
 * ===================================================== */
@media (max-width: 575px) {
    .header-inner { padding: 0 12px; }
    .brand { gap: 8px; }
    .brand-logo { height: 40px; max-width: 50px; }
    .brand-title { font-size: 15px; }
    .app-header { height: 56px; }
    .app-main { height: calc(100vh - 56px); height: calc(100dvh - 56px); }
    .main-grid { padding: 8px; gap: 8px; }
    .chat-card { border-radius: var(--r-lg); }
    .chat-stream { padding: 16px 14px; }
    .welcome-avatar { width: 80px; height: 80px; }
    .welcome-title { font-size: 15px; padding: 0 4px; }
    .welcome-desc { font-size: 12.5px; padding: 0 4px; }
    .qa-grid { grid-template-columns: 1fr; }
    .qa-item { font-size: 13px; padding: 11px 14px; }
    .guess-grid { grid-template-columns: 1fr; gap: 8px; }
    .guess-item { padding: 10px 12px; }
    .bubble { max-width: 82%; font-size: 13.5px; }
    .composer { padding: 10px 10px 12px; }
    .composer-tip { font-size: 10.5px; }
    .btn-send span, .btn-stop span { display: none; }
    .btn-send, .btn-stop { width: 48px; min-width: 48px; height: 48px; padding: 0; justify-content: center; }
    .composer-inner { gap: 6px; min-height: 52px; padding: 4px; }
    .ref-modal { width: 95vw; max-height: 90vh; }
    /* 抽屉宽度刚好放下 4 个热点 tab，不再多留 */
    .side-panel.open { width: 100%; max-width: 340px; padding: 12px 12px; }
    .side-card { padding: 16px 14px 14px; }
    /* 热点问题：保持单行 */
    .hot-menu { gap: 4px; }
    .hot-tab { padding: 4px 9px; font-size: 12px; }
}

/* ===== 滚动条细化 ===== */
.chat-stream::-webkit-scrollbar-thumb { background: rgba(10, 36, 99, 0.12); }
.chat-stream::-webkit-scrollbar-thumb:hover { background: rgba(10, 36, 99, 0.20); }
.side-panel::-webkit-scrollbar-thumb { background: rgba(10, 36, 99, 0.12); }

/* ===== 焦点可达性 ===== */
button:focus-visible, input:focus-visible {
    outline: 2px solid var(--blue-400);
    outline-offset: 2px;
}

/* ===== 减少动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
