:root {
    --bg-dark: #0f111a;
    --glass-bg: rgba(25, 28, 41, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-glow: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #60a5fa, #c084fc);
    --error-color: #ef4444;
    --radius: 16px;
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

/* 背景光效营造氛围 */
.background-glow {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(15,17,26,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 核心毛玻璃面板样式 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

header h1 {
    margin: 0 0 12px 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.instruction {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.icon {
    color: var(--text-muted);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    padding: 6px 0;
}

.security-notice {
    font-size: 0.75rem;
    color: #4ade80;
    margin: 12px 0 0 0;
    opacity: 0.8;
}

.error-banner {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

.chat-container {
    min-height: 400px;
    max-height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 自定义滚动条 */
.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.message {
    padding: 16px 20px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.7;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.message.user {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.bot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    color: var(--accent-glow);
    font-size: 0.9rem;
    padding: 10px;
}

.ai-pulse {
    width: 12px;
    height: 12px;
    background: var(--accent-glow);
    border-radius: 50%;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); box-shadow: 0 0 10px var(--accent-glow); }
}

textarea {
    width: 100%;
    height: 130px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.1);
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}