/* Voice Chat AI - 统一设计系统 (Modern SaaS / Glassmorphism) */

:root {
    /* 品牌主色 */
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.2);
    --primary-bg: rgba(99, 102, 241, 0.12);
    /* 功能色 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    /* 背景与表面（深色宇宙主题） */
    --bg-body: #050511;
    --surface: rgba(15, 15, 35, 0.9);
    --surface-2: rgba(30, 30, 60, 0.85);
    --surface-glass: rgba(15, 15, 35, 0.85);
    /* 文字 */
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(226, 232, 240, 0.15);
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-card: 20px;
    --radius-btn: 12px;
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
    --shadow-float: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* 全局深色宇宙背景 */
body {
    margin: 0;
    font-family: var(--font);
    min-height: 100vh;
    height: 100vh;
    background-color: #050511;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 40%, rgba(76, 29, 149, 0.35), transparent 55%),
        radial-gradient(ellipse 60% 40% at 85% 15%, rgba(6, 182, 212, 0.25), transparent 45%),
        radial-gradient(ellipse 60% 40% at 15% 85%, rgba(236, 72, 153, 0.25), transparent 45%);
    background-attachment: fixed;
    color: #e2e8f0;
    overflow: hidden;
}

/* 动态星星层：三层不同大小的亮点，更明显 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.75) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.55) 0.5px, transparent 1.5px);
    background-size: 220px 220px, 340px 340px, 180px 180px;
    background-position: 0 0, 60px 90px, 120px 40px;
    background-repeat: repeat;
    opacity: 1;
    z-index: -1;
    animation: star-move 120s linear infinite;
}

@keyframes star-move {
    from { background-position: 0 0, 60px 90px, 120px 40px; }
    to { background-position: -220px -220px, -280px -250px, -60px -140px; }
}

/* ========== 开口即启 Say Hello 欢迎屏 (Cyber Mode) ========== */
/* Say Hello 内嵌星空层：保证在 overlay 内可见（z-index 0，在背景与内容之间） */
.say-hello-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.75) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.55) 0.5px, transparent 1.5px);
    background-size: 220px 220px, 340px 340px, 180px 180px;
    background-position: 0 0, 60px 90px, 120px 40px;
    background-repeat: repeat;
    opacity: 1;
    animation: star-move 120s linear infinite;
}
.say-hello-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    background: rgba(5, 5, 17, 0.82);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2147483647;
    pointer-events: auto;
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    animation: sayHelloFadeIn 0.4s ease-out;
    box-sizing: border-box;
    cursor: pointer;
}

.say-hello-overlay.hidden {
    display: none !important;
}

.say-hello-overlay.success-mode {
    background-color: #fff;
    transition: background-color 0.6s ease-out;
}
.say-hello-overlay.success-mode::before {
    opacity: 0;
    pointer-events: none;
}

.say-hello-overlay.success-mode .say-hello-ambient-light,
.say-hello-overlay.success-mode .say-hello-canvas,
.say-hello-overlay.success-mode .say-hello-ui-layer,
.say-hello-overlay.success-mode .say-hello-tap-hint,
.say-hello-overlay.success-mode .manual-btn {
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

@keyframes sayHelloFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.say-hello-ambient-light {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.say-hello-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.say-hello-ui-layer {
    position: relative;
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.say-hello-cyber-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
    background: linear-gradient(to right, #fff, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.9;
    text-shadow: 0 0 30px rgba(165, 243, 252, 0.3);
}

.say-hello-subtitle {
    font-size: 1rem;
    color: #94a3b8;
    margin-top: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
}

.say-hello-overlay .status-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 10px #ef4444;
    transition: all 0.3s;
}

.say-hello-overlay .status-dot.active {
    background-color: #22c55e;
    box-shadow: 0 0 15px #22c55e;
}

.say-hello-instruction {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #475569;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.say-hello-tap-hint {
    position: absolute;
    bottom: 15%;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    animation: say-hello-pulse-text 2s infinite;
    z-index: 10;
}

@keyframes say-hello-pulse-text {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.say-hello-overlay .manual-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    pointer-events: auto;
}

.say-hello-overlay .manual-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* ========== 账号登录界面 ========== */
/* 登录页内嵌星空层：与 Say Hello 一致，保证在 overlay 内可见 */
.login-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.75) 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.55) 0.5px, transparent 1.5px);
    background-size: 220px 220px, 340px 340px, 180px 180px;
    background-position: 0 0, 60px 90px, 120px 40px;
    background-repeat: repeat;
    opacity: 1;
    animation: star-move 120s linear infinite;
}
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 17, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    pointer-events: auto;
    animation: fadeIn 0.3s ease-out;
}

.login-overlay.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-container {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.login-header p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.username-input {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
}

.username-input::placeholder {
    color: var(--text-muted);
}

.username-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-hint {
    text-align: center;
    margin-top: 8px;
}

.login-hint p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--primary-bg);
    border-radius: 16px;
    margin-right: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #a5b4fc;
}

#current-username {
    white-space: nowrap;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 92vh;
    width: 100%;
    max-width: min(1000px, 94vw);
    margin: 4vh auto;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-float);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

/* 头部样式 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--surface-2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.header-info h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.status-text {
    font-size: 12px;
    color: var(--text-muted);
}

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

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface-2);
    position: relative;
    z-index: 1;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* 消息气泡样式 */
.message {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    animation: messageSlideIn 0.3s ease-out;
    position: relative;
    z-index: 1;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.message.user .message-content-wrapper {
    align-items: flex-end;
}

.message.ai .message-content-wrapper {
    align-items: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    position: relative;
    transition: box-shadow 0.2s ease;
}

/* 音频消息覆盖默认padding */
.audio-message {
    padding: 8px 12px !important;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.message.ai .message-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
}

.message.ai .text-message {
    color: var(--text) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* 语音消息样式 */
.voice-message {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    padding: 8px 12px;
}

.voice-waveform {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 8px;
}

.wave-bar {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    animation: waveAnimation 1s ease-in-out infinite;
    opacity: 0.6;
}

.message.user .wave-bar {
    background: white;
}

.message.ai .wave-bar {
    background: #667eea;
}

.wave-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 8px; }

@keyframes waveAnimation {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.4;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.play-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: currentColor;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.message.user .play-button {
    background: rgba(255, 255, 255, 0.2);
}

.message.ai .play-button {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

.message.ai .play-button:hover {
    background: rgba(102, 126, 234, 0.2);
}

.play-icon {
    width: 16px;
    height: 16px;
}

/* 消息时间戳 */
.message-timestamp {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
}

.message.user .message-timestamp {
    text-align: right;
}

/* 文本消息样式 */
.text-message {
    line-height: 1.4;
    font-size: 14px;
}

/* 录音指示器 */
.recording-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: #ff4444;
    color: white;
    position: sticky;
    bottom: 80px;
    margin: 0 16px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
    animation: slideUp 0.3s ease-out;
}

.recording-indicator.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recording-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.recording-waveform .wave-bar {
    width: 4px;
    background: white;
    border-radius: 2px;
    animation: recordingWave 0.8s ease-in-out infinite;
}

.recording-waveform .wave-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.recording-waveform .wave-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.recording-waveform .wave-bar:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.recording-waveform .wave-bar:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.recording-waveform .wave-bar:nth-child(5) { animation-delay: 0.4s; height: 8px; }

@keyframes recordingWave {
    0%, 100% {
        transform: scaleY(0.3);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.recording-text {
    font-size: 14px;
    font-weight: 500;
}

/* 输入区域 */
.input-area {
    padding: 14px 20px;
    margin: 0 12px 12px 12px;
    background: var(--surface-2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* 文字输入框样式 */
.text-input {
    flex: 1;
    padding: 12px 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.text-input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.text-input::placeholder {
    color: var(--text-muted);
}

/* 输入模式切换按钮 */
.input-mode-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.input-mode-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    transform: scale(1.05);
}

.input-mode-btn:active {
    transform: scale(0.95);
}

.record-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.record-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.record-button.recording {
    background: #ff4444;
    animation: pulse 1s infinite;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.mic-icon {
    width: 24px;
    height: 24px;
}

.input-hint {
    flex: 1;
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px 18px;
    background: var(--surface-2);
    border-radius: var(--radius-xl);
    text-align: center;
}

/* 发送按钮样式 */
.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 结束对话按钮 */
.end-conversation-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.end-conversation-btn:hover {
    background-color: #ff6666;
    transform: scale(1.05);
}

.end-conversation-btn:active {
    transform: scale(0.95);
}

.end-conversation-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.end-conversation-btn svg {
    width: 20px;
    height: 20px;
}

/* 设置面板 */
.settings-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.settings-panel.active {
    display: flex;
}

.settings-content {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.settings-content h3 {
    margin-bottom: 20px;
    color: var(--text);
}

.setting-group {
    margin-bottom: 16px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface-2);
    color: var(--text);
}

.close-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.close-btn:hover {
    background: var(--primary-dark);
}

/* 场景入口按钮（与主色统一） */
.enter-scenes-btn {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    z-index: 999;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
}

.enter-scenes-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: var(--surface-2);
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .chat-container {
        max-width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .input-area {
        margin: 0;
        border-radius: 0;
    }
    
    .message-content-wrapper {
        max-width: 80%;
    }
}

/* 加载动画（深色宇宙风格） */
.loading-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: loadingDot 1.4s infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 英文学习对话卡片样式（白底 + 主色点缀） */
.english-dialogue-card {
    background: var(--surface);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-card);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-card);
    color: var(--text);
    animation: cardSlideIn 0.4s ease-out;
}

.english-dialogue-card.modern-card {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.06), transparent);
    border-bottom: none;
    padding: 16px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.dialogue-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dialogue-icon {
    font-size: 20px;
}

.dialogue-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.collapse-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.collapse-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.collapse-btn svg {
    transition: transform 0.3s;
}

.dialogue-content {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 16px;
}

/* 优化对话内容的第一项和最后一项的间距 */
.dialogue-content .dialogue-item:first-child {
    margin-top: 0;
}

.dialogue-content .dialogue-item:last-child {
    margin-bottom: 0;
}

.dialogue-content::-webkit-scrollbar {
    width: 6px;
}

.dialogue-content::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 3px;
}

.dialogue-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.dialogue-content::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

/* 对话项容器 */
.dialogue-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px 0; /* 减少间距，让对话更紧凑 */
    width: 100%; /* 确保占满宽度，让B可以靠右显示 */
    box-sizing: border-box; /* 确保宽度计算正确 */
}

/* A说话者：标签在左，气泡在右 */
.speaker-a-item {
    justify-content: flex-start;
    flex-direction: row; /* 明确指定方向 */
}

.speaker-a-label {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

/* A说话者的气泡：浅灰底 */
.speaker-a-bubble {
    position: relative;
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 12px 16px;
    border-radius: 20px 20px 20px 6px;
    max-width: 75%;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}

/* A气泡的左侧尖角 */
.bubble-tail-left {
    position: absolute;
    left: -8px;
    top: 16px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f1f5f9;
}

.bubble-tail-left::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #e2e8f0;
}

/* B说话者：气泡在左，标签在右 */
.speaker-b-item {
    justify-content: flex-end;
    flex-direction: row-reverse;
    width: 100%; /* 确保占满宽度 */
}

/* 更具体的选择器，确保B说话者样式生效 */
.dialogue-content .dialogue-item.speaker-b-item {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.speaker-b-label {
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

/* B说话者的气泡：淡主色 */
.speaker-b-bubble {
    position: relative;
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid rgba(99, 102, 241, 0.12);
    padding: 12px 16px;
    border-radius: 20px 6px 20px 20px;
    max-width: 75%;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
    margin-left: auto;
    margin-right: 0;
    word-wrap: break-word;
}

/* B气泡的右侧尖角 */
.bubble-tail-right {
    position: absolute;
    right: -8px;
    top: 16px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--primary-light);
}

.bubble-tail-right::after {
    content: '';
    position: absolute;
    right: 2px;
    top: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid rgba(99, 102, 241, 0.15);
}

/* 气泡内容 */
.speaker-a-bubble .bubble-content {
    color: #334155;
}
.speaker-b-bubble .bubble-content {
    color: var(--primary-hover);
}
.neutral-bubble .bubble-content,
.bubble-content {
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 添加轻微文字阴影，提升可读性 */
}

/* 悬停效果 */
.dialogue-bubble {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dialogue-bubble:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 可点击的对话行 */
.dialogue-line-clickable {
    position: relative;
}

.dialogue-line-clickable:hover {
    opacity: 0.9;
}

.dialogue-line-playing {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    animation: pulse-playing 1.5s ease-in-out infinite;
}

@keyframes pulse-playing {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    }
}

.play-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* 中性气泡（没有标签的行） */
.neutral-bubble {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    margin: 0 auto;
}

.dialogue-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.action-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.18s ease, transform 0.12s ease, color 0.18s;
}

.action-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 练习页加载提示动画 */
@keyframes practice-spin {
    to { transform: rotate(360deg); }
}

/* 英语卡片生成中全屏提示（5 秒倒计时） */
.english-card-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}
.english-card-loading-tip {
    text-align: center;
    padding: 48px 32px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 280px;
    color: var(--text);
}

/* 练习模式样式 */
.practice-mode-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-card);
}

/* 练习页内录音按钮：未录音 / 录音中 状态区分明显 */
.practice-scene-record-btn {
    min-width: 56px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.practice-scene-record-btn.recording {
    background: #b71c1c !important;
    color: #fff !important;
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.4);
    animation: practice-record-pulse 1.2s ease-in-out infinite;
}
@keyframes practice-record-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(183, 28, 28, 0.2); }
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.practice-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.practice-progress {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.practice-hints-panel {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.hints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hints-header h4 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.hint-toggle-btn {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.hint-toggle-btn:hover {
    background: #0056b3;
}

.hints-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hint-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.hint-section:last-child {
    border-bottom: none;
}

.hint-section strong {
    color: var(--text);
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.hint-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.hint-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.hint-text {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* 重点词组容器 */
.hint-phrases-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
}

/* 重点词组气泡样式 */
.hint-phrase-box {
    display: inline-block;
    background: var(--surface-2);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0;
}

.hint-phrase-box:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.hint-phrase-box-empty {
    display: inline-block;
    color: #999;
    font-size: 14px;
    font-style: italic;
    padding: 10px 18px;
}

/* 音频消息样式（Instagram风格） */
.audio-message {
    padding: 8px 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    max-width: 280px;
}

.audio-message:hover {
    opacity: 0.9;
}

.message.ai .audio-message {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.message.user .audio-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.message.ai .audio-play-btn {
    background: var(--primary-bg);
    color: var(--primary);
}

.message.ai .audio-play-btn:hover {
    background: var(--primary-bg);
    filter: brightness(1.2);
}

.message.user .audio-play-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.message.user .audio-play-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    flex: 1;
    min-width: 60px;
}

.waveform-bar {
    width: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: height 0.3s ease;
    opacity: 0.6;
}

.message.ai .waveform-bar {
    background: var(--text);
}

.message.user .waveform-bar {
    background: white;
}

.audio-waveform.playing .waveform-bar {
    animation: waveform-animation 1s ease-in-out infinite;
}

.audio-waveform.playing .waveform-bar:nth-child(1) {
    animation-delay: 0s;
}

.audio-waveform.playing .waveform-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.audio-waveform.playing .waveform-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.audio-waveform.playing .waveform-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.audio-waveform.playing .waveform-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes waveform-animation {
    0%, 100% {
        height: 6px;
    }
    50% {
        height: 18px;
    }
}

.audio-duration {
    font-size: 11px;
    font-weight: 500;
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.message.ai .audio-duration {
    color: var(--text-muted);
}

.message.user .audio-duration {
    color: white;
}

.audio-text-content {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.ai .audio-text-content {
    border-color: var(--border);
    color: var(--text);
}

.message.user .audio-text-content {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.audio-message.text-expanded {
    padding-bottom: 8px;
}

.practice-dialogue-area {
    min-height: 100px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.practice-input-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.end-practice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.end-practice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.end-practice-btn:active {
    transform: translateY(0);
}

.action-btn svg {
    flex-shrink: 0;
}

/* 复习笔记卡片样式 */
.review-notes-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(20, 25, 45, 0.95) 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    color: var(--text);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.review-card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.review-card-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
}

.review-card-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-mastery-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.review-mastery-label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.review-mastery-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.review-mastery-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.review-mastery-btn.mastered-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.review-mastery-btn.mastered-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.review-mastery-btn.not-mastered-btn {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.4);
}

.review-mastery-btn.not-mastered-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.25);
}

.review-section {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--primary);
}

.review-section h4 {
    margin: 0 0 12px 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.vocab-category {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.grammar-item {
    margin: 12px 0;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--text);
}

.grammar-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 8px;
}

.error-usage {
    color: #e74c3c;
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    font-size: 13px;
}

.correct-usage {
    color: #27ae60;
    margin: 6px 0;
    padding: 6px 10px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    font-size: 13px;
}

.explanation {
    color: var(--text-muted);
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 6px;
    font-size: 13px;
    font-style: italic;
}

.correction-item {
    margin: 12px 0;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--text);
}

.error-text {
    color: #e74c3c;
    margin-bottom: 8px;
    font-size: 14px;
}

.correct-text {
    color: #27ae60;
    margin-bottom: 8px;
    font-size: 14px;
}

.correction-explanation {
    color: var(--text-muted);
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 6px;
}

.review-no-corrections {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.suggestions-list {
    margin: 8px 0;
    padding-left: 20px;
}

.suggestions-list li {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* 场景拓展卡片样式（深色宇宙风格） */
.expansion-materials-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(30, 25, 45, 0.95) 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(250, 112, 154, 0.25);
    color: var(--text);
}

.expansion-card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(250, 112, 154, 0.3);
}

.expansion-card-header h3 {
    margin: 0;
    color: #fa709a;
    font-size: 18px;
    font-weight: 600;
}

.expansion-card-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.expansion-section {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #fa709a;
}

.expansion-section h4 {
    margin: 0 0 12px 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.dialogue-example {
    margin: 16px 0;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid rgba(250, 112, 154, 0.25);
    color: var(--text);
}

.dialogue-scene {
    font-weight: 600;
    color: #fa709a;
    margin-bottom: 12px;
    font-size: 14px;
}

.dialogue-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dialogue-line {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.dialogue-line.speaker-a {
    background: rgba(102, 126, 234, 0.1);
    align-self: flex-start;
    max-width: 80%;
}

.dialogue-line.speaker-b {
    background: rgba(250, 112, 154, 0.1);
    align-self: flex-end;
    max-width: 80%;
}

.speaker-label {
    font-weight: 600;
    margin-right: 8px;
    color: #667eea;
}

.dialogue-line.speaker-b .speaker-label {
    color: #fa709a;
}

.expressions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expression-item {
    padding: 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid rgba(250, 112, 154, 0.25);
    color: var(--text);
}

.expression-phrase {
    color: #fa709a;
    font-size: 15px;
    margin-bottom: 6px;
}

.expression-meaning {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 6px;
}

.expression-example {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(250, 112, 154, 0.08);
    border-radius: 6px;
}

/* 生成按钮样式 */
.practice-complete-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.generate-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.generate-review-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========== 英语学习入口卡片（与主 UI 统一） ========== */
.english-learning-card {
    margin: 16px 20px;
    padding: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: cardEntrance 0.4s ease-out;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.english-learning-card:hover {
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-dark);
}

.english-card-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: var(--primary-bg);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.english-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 20px;
}

.english-card-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.english-card-icon-wrapper {
    width: 56px;
    height: 56px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.english-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.english-card-text {
    flex: 1;
}

.english-card-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.english-card-desc {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.english-card-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-tag {
    display: inline-block;
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.english-card-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.english-card-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.english-card-btn:active {
    transform: scale(0.98);
}

.btn-icon,
.btn-text,
.btn-arrow {
    color: inherit;
}

.btn-arrow {
    transition: transform 0.2s;
}

.english-card-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* 当进入英语学习模式后，隐藏卡片 */
.english-learning-card.hidden {
    display: none;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .english-card-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .english-card-left {
        flex-direction: column;
        text-align: center;
    }
    
    .english-card-btn {
        width: 100%;
        justify-content: center;
    }
    
    .english-card-text h3 {
        font-size: 20px;
        justify-content: center;
    }
}

/* ---------- 主内容区（单栏：对话 + 学习卡片 + 复习笔记 同页顺序展示） ---------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.main-content .messages-container {
  flex: 0 0 auto;
  min-height: 200px;
}
.main-content .cards-section {
  padding: 16px;
  border-top: 1px solid var(--border, #eee);
}
.main-content .review-section {
  padding: 16px;
  border-top: 1px solid var(--border, #eee);
}

/* ---------- 子页面：练习页 / 复习笔记页（全屏覆盖主内容） ---------- */
.sub-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--surface-2, #f5f5f5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-container {
  position: relative;
}
.sub-page-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sub-page-back-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.sub-page-back-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}
.sub-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.sub-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ========== 转场动画核心 (Transition Core) ========== */

/* 1. 退场状态：Say Hello 界面 */
.say-hello-overlay.exit-mode {
    background-color: var(--bg-body, #050511) !important;
    pointer-events: none;
    transition: background-color 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

.say-hello-overlay.exit-mode .say-hello-ui-layer,
.say-hello-overlay.exit-mode canvas,
.say-hello-overlay.exit-mode .say-hello-ambient-light {
    opacity: 0;
    transform: scale(3) translateZ(0);
    filter: blur(10px);
    transition: all 0.6s ease-in;
}

.say-hello-overlay.exit-mode .say-hello-tap-hint,
.say-hello-overlay.exit-mode .manual-btn {
    opacity: 0;
    transform: scale(3) translateZ(0);
    filter: blur(10px);
    transition: all 0.6s ease-in;
}

/* 2. 进场状态：登录界面（从 Say Hello 转场时先置为透明再弹性浮现） */
.login-overlay.entry-ready {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex !important;
    pointer-events: none;
}

.login-overlay.entry-ready.active-mode {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    transition-delay: 0.4s;
}

/* 3. 点击波纹特效 */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0);
    animation: ripple-expand 0.6s linear forwards;
    pointer-events: none;
    z-index: 2147483647;
}

@keyframes ripple-expand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========== JS 弹窗深色宇宙风格（推荐/自选场景/难度/练习场景选择等） ========== */
.scene-npc-dialog,
.scene-selection-dialog,
.second-level-choice-dialog,
.dialogue-options-dialog {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

