/* ==========================================
   智胜高考 · AI 志愿规划师 — Premium Theme
   ========================================== */

/* ====== 全局重置 ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0c1220;
    --panel: #111d35;
    --panel-soft: rgba(22,37,68,0.62);
    --gold: #c9a227;
    --gold-2: #e6c84a;
    --blue: #3b82f6;
    --green: #22c55e;
    --text: #e2e8f0;
    --muted: #7b8fa8;
    --muted-2: #5a6d84;
    --line: rgba(255,255,255,0.07);
}

html {
    background: var(--bg);
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
textarea {
    font: inherit;
}

.app-shell {
    background:
        radial-gradient(circle at 14% 8%, rgba(201,162,39,0.11), transparent 28%),
        radial-gradient(circle at 88% 20%, rgba(59,130,246,0.10), transparent 30%),
        linear-gradient(180deg, #0a0f1e 0%, #0c1220 44%, #09101d 100%);
}

.premium-app {
    min-height: 100vh;
}

.hero-inner,
.workspace {
    width: min(100%, 980px);
    margin: 0 auto;
}

/* ====== Hero 区域 ====== */
.hero {
    position: relative;
    text-align: center;
    padding: 52px 24px 44px;
    background: linear-gradient(160deg, #0a0f1e 0%, #111d35 40%, #162544 100%);
    overflow: hidden;
    border-bottom: 1px solid rgba(201,162,39,0.08);
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(ellipse at 25% 15%, rgba(201,162,39,0.07) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 85%, rgba(59,130,246,0.04) 0%, transparent 45%);
    pointer-events: none;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(201,162,39,0.12), rgba(201,162,39,0.06));
    border: 1px solid rgba(201,162,39,0.2);
    color: #d4a828;
    font-size: 0.76em;
    font-weight: 600;
    margin-bottom: 22px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.app-shell .hero-badge::before {
    content: "✦";
    font-size: 0.9em;
}
.hero h1 {
    font-size: 2.4em;
    font-weight: 700;
    color: #f0f4f8;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.hero h1 span {
    background: linear-gradient(135deg, #c9a227, #e6c84a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .sub {
    font-size: 1em;
    color: #7b8fa8;
    margin: 0 0 32px 0;
    font-weight: 300;
    line-height: 1.7;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.stat {
    text-align: center;
    min-width: 80px;
}
.stat-num {
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #c9a227, #e6c84a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 0.72em;
    color: #5a6d84;
    margin-top: 6px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ====== 信任条 ====== */
.trust-bar {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 14px 20px;
    background: rgba(10,15,30,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76em;
    color: #5a6d84;
    font-weight: 400;
}
.trust-item .dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(34,197,94,0.3);
}

/* ====== 示例卡片 ====== */
.intake-panel {
    width: min(calc(100% - 48px), 860px);
    margin: 34px auto 0;
    border: 1px solid rgba(201,162,39,0.12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(201,162,39,0.08), transparent 34%),
        rgba(17,29,53,0.74);
    box-shadow: 0 22px 70px rgba(0,0,0,0.24);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.intake-panel.is-collapsed,
.intake-panel.is-complete {
    display: none;
}

.intake-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.intake-title {
    margin: 0;
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 800;
}

.intake-subtitle {
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 0.8rem;
}

.ghost-btn {
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: #9fb3ca;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ghost-btn:hover {
    border-color: rgba(201,162,39,0.34);
    color: #f2d36b;
    background: rgba(201,162,39,0.06);
}

.intake-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 18px 20px 20px;
}

.intake-form label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.intake-form label.wide {
    grid-column: span 2;
}

.intake-form span {
    color: #9fb3ca;
    font-size: 0.75rem;
    font-weight: 700;
}

.intake-form input,
.intake-form textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    outline: none;
    background: rgba(10,15,30,0.46);
    color: #f1f5f9;
    padding: 11px 12px;
    line-height: 1.45;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.intake-form input:focus,
.intake-form textarea:focus {
    border-color: rgba(201,162,39,0.45);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.08);
    background: rgba(10,15,30,0.64);
}

.intake-form input::placeholder,
.intake-form textarea::placeholder {
    color: #526780;
}

.intake-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 2px;
}

.intake-actions span {
    color: var(--muted-2);
    font-weight: 400;
}

.intake-submit {
    min-width: 142px !important;
}

.ex-section {
    max-width: 860px;
    margin: 0 auto;
    padding: 34px 24px 0;
}
.ex-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.ex-subtitle {
    font-size: 0.78em;
    color: #5a6d84;
    margin-bottom: 18px;
}
.ex-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.ex-card {
    background: rgba(22,37,68,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 20px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(8px);
    appearance: none;
    color: inherit;
}
.ex-card:hover {
    border-color: rgba(201,162,39,0.35);
    background: rgba(22,37,68,0.8);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(201,162,39,0.1);
}
.ex-icon {
    font-size: 1.8em;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.ex-label {
    font-size: 0.8em;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.3;
}

/* ====== 聊天区 ====== */
.chat-wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 24px;
}

.chat-panel {
    width: min(calc(100% - 48px), 860px);
    margin: 26px auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(17,29,53,0.72);
    box-shadow: 0 22px 70px rgba(0,0,0,0.26);
    backdrop-filter: blur(14px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(10,15,30,0.42);
}

.chat-title {
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 700;
}

.chat-subtitle {
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 0.78rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid rgba(34,197,94,0.18);
    border-radius: 999px;
    padding: 6px 11px;
    color: #9ae6b4;
    font-size: 0.75rem;
    background: rgba(34,197,94,0.06);
}

.status-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 10px rgba(34,197,94,0.5);
}

.messages {
    height: 480px;
    overflow-y: auto;
    padding: 20px 18px;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.message-row.user {
    justify-content: flex-end;
}

.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: #9fb3ca;
    font-size: 0.68rem;
    font-weight: 700;
}

.message-row.user .avatar {
    border-color: rgba(201,162,39,0.24);
    background: rgba(201,162,39,0.10);
    color: #f2d36b;
}

.message-bubble {
    max-width: min(72%, 620px);
    border-radius: 14px;
    padding: 12px 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #dbe7f5;
    background: rgba(22,37,68,0.82);
    border: 1px solid rgba(255,255,255,0.06);
    line-height: 1.72;
    font-size: 0.93rem;
}

.message-row.user .message-bubble {
    color: #fff;
    background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(30,64,175,0.94));
    border-color: rgba(96,165,250,0.20);
}

.typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 58px;
    min-height: 42px;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(226,232,240,0.7);
    animation: typing-pulse 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typing-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* ====== 输入区 ====== */
.input-bar {
    max-width: 740px;
    margin: 0 auto;
    padding: 14px 24px 24px;
}

.composer {
    display: flex;
    width: min(calc(100% - 48px), 860px);
    margin: 14px auto 0;
    gap: 12px;
    align-items: flex-end;
}

.composer textarea {
    min-height: 52px;
    max-height: 132px;
    flex: 1;
    border-radius: 14px;
    border: 1.5px solid rgba(255,255,255,0.06);
    outline: none;
    background: rgba(22,37,68,0.6);
    color: #f1f5f9;
    padding: 15px 17px;
    resize: none;
    line-height: 1.55;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(8px);
}

.composer textarea:focus {
    border-color: rgba(201,162,39,0.45);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.09), 0 10px 30px rgba(0,0,0,0.15);
    background: rgba(22,37,68,0.78);
}

.composer textarea::placeholder {
    color: #526780;
}
.input-bar textarea {
    border-radius: 14px !important;
    border: 1.5px solid rgba(255,255,255,0.06) !important;
    background: rgba(22,37,68,0.6) !important;
    color: #f1f5f9 !important;
    padding: 14px 18px !important;
    font-size: 0.9em !important;
    resize: none !important;
    transition: all 0.25s ease !important;
    backdrop-filter: blur(8px) !important;
}
.input-bar textarea:focus {
    border-color: rgba(201,162,39,0.4) !important;
    box-shadow: 0 0 0 3px rgba(201,162,39,0.08), 0 4px 12px rgba(0,0,0,0.1) !important;
}
.input-bar textarea::placeholder {
    color: #3d4f66 !important;
    font-weight: 300 !important;
}
.send-btn {
    border-radius: 14px !important;
    background: linear-gradient(135deg, #c9a227, #a8841a) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    font-size: 0.88em !important;
    min-width: 100px !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 2px 8px rgba(201,162,39,0.2) !important;
    letter-spacing: 0.03em !important;
}
.send-btn:disabled,
.reset-btn:disabled {
    cursor: wait !important;
    opacity: 0.62 !important;
    transform: none !important;
}
.send-btn:hover {
    background: linear-gradient(135deg, #d4ad30, #b8911f) !important;
    box-shadow: 0 4px 20px rgba(201,162,39,0.3) !important;
    transform: translateY(-1px) !important;
}

/* ====== 底栏 ====== */
.footer-bar {
    width: min(calc(100% - 48px), 860px);
    max-width: 860px;
    margin: 0 auto;
    padding: 14px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.reset-btn {
    border-radius: 8px !important;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    color: #5a6d84 !important;
    font-size: 0.76em !important;
    padding: 6px 14px !important;
    transition: all 0.2s ease !important;
}
.reset-btn:hover {
    border-color: rgba(239,68,68,0.4) !important;
    color: #ef4444 !important;
    background: rgba(239,68,68,0.05) !important;
}
.footer-hint {
    font-size: 0.72em;
    color: #3d4f66;
    font-weight: 300;
}

/* ====== 底部品牌 ====== */
.brand-footer {
    text-align: center;
    padding: 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.03);
    margin-top: 8px;
}
.brand-footer p {
    font-size: 0.7em;
    color: #2a3a50;
    margin: 3px 0;
    font-weight: 300;
}

/* ====== 聊天气泡美化 ====== */
.message-wrap {
    border-radius: 12px !important;
}
.bubble-wrap {
    border-radius: 14px !important;
}

/* ====== 隐藏 Gradio 默认 ====== */
.gradio-container footer { display: none !important; }
.app-shell footer { display: block !important; }
.gradio-container { max-width: 100% !important; padding: 0 !important; }

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}

/* ====== 响应式 ====== */
@media (max-width: 640px) {
    .hero { padding: 42px 18px 34px; }
    .hero h1 { font-size: 1.6em; }
    .hero .sub { font-size: 0.88em; }
    .hero-stats { gap: 20px; }
    .stat-num { font-size: 1.3em; }
    .ex-grid { grid-template-columns: repeat(2, 1fr); }
    .trust-bar { gap: 12px; }
    .trust-item { font-size: 0.7em; }
    .intake-panel {
        width: calc(100% - 28px);
        margin-top: 24px;
    }
    .intake-head {
        flex-direction: column;
    }
    .intake-form {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px 14px 18px;
    }
    .intake-form label.wide {
        grid-column: 1 / -1;
    }
    .intake-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .chat-panel,
    .composer,
    .footer-bar {
        width: calc(100% - 28px);
    }
    .chat-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .messages {
        height: 430px;
        padding: 16px 12px;
    }
    .message-bubble {
        max-width: 82%;
        font-size: 0.88rem;
    }
    .composer {
        flex-direction: column;
        align-items: stretch;
    }
    .send-btn {
        width: 100%;
        min-height: 48px;
    }
    .footer-bar {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .hero h1 { font-size: 1.42em; }
    .hero .sub { font-size: 0.82em; }
    .hero-stats { gap: 14px; }
    .stat { min-width: 68px; }
    .intake-form {
        grid-template-columns: 1fr;
    }
    .ex-section { padding-inline: 14px; }
    .ex-card { padding: 16px 10px; }
}
