/* 时光回音 MVP - 电话通话界面样式 */

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

:root {
    --bg: #1a1a2e;
    --bg-gradient: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-bg: rgba(255,255,255,0.08);
    --accent: #e94560;
    --accent-soft: #e9456044;
    --text: #eee;
    --text-dim: #999;
    --ai-speaking: #00d9ff;
    --user-talking: #ff6b6b;
    --thinking: #ffd93d;
    --green: #4ecca3;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    font-size: 18px;
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ============ 页面切换 ============ */

.page {
    display: none;
    width: 100%;
    height: 100vh;
}
.page.active {
    display: flex;
    flex-direction: column;
}

/* ============ 性别选择页 ============ */

.gender-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
}

.logo-area {
    text-align: center;
    margin-bottom: 60px;
}

.logo-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.logo-text {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #e94560, #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 18px;
    color: var(--text-dim);
    margin-top: 8px;
    letter-spacing: 6px;
}

.gender-hint {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 30px;
}

.gender-buttons {
    display: flex;
    gap: 24px;
}

.gender-btn {
    width: 140px;
    height: 180px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.gender-btn:hover, .gender-btn:active {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-4px);
}

.gender-icon {
    font-size: 56px;
}

/* ============ 模式选择器 ============ */

.mode-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.mode-btn {
    flex: 1;
    max-width: 200px;
    padding: 16px 20px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.mode-btn.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.mode-btn:hover, .mode-btn:active {
    border-color: rgba(233, 69, 96, 0.5);
    transform: translateY(-2px);
}

.mode-label {
    font-size: 20px;
    font-weight: 600;
}

.mode-desc {
    font-size: 14px;
    opacity: 0.7;
}

/* ============ 通话界面 ============ */

.call-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 顶部状态栏 */
.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    flex-shrink: 0;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}

.header-btn:hover {
    background: rgba(255,255,255,0.15);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.call-timer {
    font-size: 16px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* 中间主体 */
.call-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* AI头像 */
.ai-avatar-wrap {
    margin-bottom: 24px;
}

.ai-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #0f3460);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
}

/* 用户摄像头（默认隐藏，视频模式时显示） */
.user-video {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: #000;
    transform: scaleX(-1);
}

/* 视频通话切换按钮 */
.video-toggle-btn {
    position: absolute;
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.video-toggle-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.video-toggle-btn.active { background: rgba(233,69,96,0.2); border-color: var(--accent); color: var(--accent); }

/* ============ 视频通话模式（左右分列） ============ */

/* 视频分列容器：语音模式纵向，视频模式横向 */
.video-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ai-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 视频模式：左右分列 */
.call-container.video-mode .video-split {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    flex: 1;
    width: 100%;
    max-width: 500px;
}

.call-container.video-mode .ai-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.call-container.video-mode .ai-avatar {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 3/4;
    border-radius: 16px;
}

.call-container.video-mode .ai-avatar img {
    border-radius: 16px;
}

.call-container.video-mode .avatar-ring {
    border-radius: 16px;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
}

.call-container.video-mode .user-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.call-container.video-mode .user-video-frame {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 3/4;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
    background: #000;
}

.call-container.video-mode .user-video-frame .user-video {
    display: block;
}

.call-container.video-mode .user-label {
    font-size: 16px;
    color: var(--text-dim);
}

/* 视频模式下隐藏声波（用头像光晕代替） */
.call-container.video-mode .wave-container { display: none; }

/* 移动端：视频模式改为上下排列 */
@media (max-width: 600px) {
    .call-container.video-mode .video-split {
        flex-direction: column;
        gap: 12px;
    }
    .call-container.video-mode .ai-avatar,
    .call-container.video-mode .user-video-frame {
        max-width: 140px;
    }
}

.avatar-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.avatar-ring.active {
    border-color: var(--ai-speaking);
    animation: ringPulse 1.5s ease-in-out infinite;
}

.ai-avatar.speaking {
    box-shadow: 0 0 40px var(--ai-speaking);
    transform: scale(1.05);
}

.ai-avatar.listening {
    box-shadow: 0 0 40px var(--user-talking);
}

.ai-avatar.thinking {
    animation: thinkingPulse 1s ease-in-out infinite;
}

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

@keyframes thinkingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.call-status {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 24px;
    min-height: 27px;
}

/* 声波动画 */
.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 50px;
    margin-bottom: 20px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.wave-container.active {
    opacity: 1;
}

.wave-bar {
    width: 5px;
    height: 12px;
    background: var(--ai-speaking);
    border-radius: 3px;
    transition: height 0.2s;
}

.wave-container.active .wave-bar {
    animation: waveBounce 0.8s ease-in-out infinite;
}

.wave-container.active.listening .wave-bar {
    background: var(--user-talking);
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.2s; }
.wave-bar:nth-child(6) { animation-delay: 0.1s; }
.wave-bar:nth-child(7) { animation-delay: 0s; }

@keyframes waveBounce {
    0%, 100% { height: 12px; }
    50% { height: 40px; }
}

/* 字幕区 */
.subtitle-area {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
    margin-bottom: 8px;
}

.subtitle-area.show {
    max-height: 200px;
    overflow-y: auto;
}

.subtitle-content {
    padding: 12px 20px;
}

.subtitle-line {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 8px;
    opacity: 0.9;
}

.subtitle-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-dim);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 16px;
}

/* 底部操作区 */
.call-footer {
    flex-shrink: 0;
    padding: 30px 20px 50px;
    display: flex;
    justify-content: center;
}

.talk-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.4);
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.talk-btn:active, .talk-btn.listening {
    transform: scale(1.12);
    box-shadow: 0 8px 40px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ff6b6b, #e94560);
}

.talk-btn.thinking {
    background: linear-gradient(135deg, #ffd93d, #f0a500);
    box-shadow: 0 8px 30px rgba(255, 217, 61, 0.3);
}

.talk-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.talk-btn-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.talk-icon {
    font-size: 40px;
}

.talk-text {
    font-size: 16px;
    font-weight: 600;
}

/* ============ 记忆面板 ============ */

.memories-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: #1a1a2e;
    box-shadow: -4px 0 30px rgba(0,0,0,0.4);
    transition: right 0.3s;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.memories-panel.open { right: 0; }

.memories-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memories-header h2 {
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}

.memories-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.empty-hint {
    text-align: center;
    color: var(--text-dim);
    margin-top: 40px;
}

.memory-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
}

.memory-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.memory-content {
    font-size: 16px;
    line-height: 1.6;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.overlay.show { opacity: 1; visibility: visible; }

/* ============ 音色选择器 ============ */

.voice-selector {
    margin-top: 32px;
    width: 100%;
    max-width: 360px;
    animation: fadeIn 0.3s ease;
}

.voice-hint {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 12px;
}

.voice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-item.selected {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.15);
}

.voice-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.voice-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.voice-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    min-width: 60px;
}

.voice-desc {
    font-size: 14px;
    color: var(--text-dim);
}

.voice-preview-btn {
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.voice-preview-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

.start-call-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.start-call-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

.start-call-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ 文字输入fallback ============ */

/* 音色切换按钮（左下角浮动小按钮） */
.voice-float-btn {
    position: absolute;
    bottom: 24px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.voice-float-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text);
}
.voice-float-icon { font-size: 14px; }
.voice-float-name { font-size: 13px; }

/* 音色面板（弹出层） */
.voice-panel {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 20px;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
    z-index: 50;
    overflow: hidden;
}
.voice-panel.show { display: block; }

.voice-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 16px;
    font-weight: 600;
}

.voice-panel-close {
    background: none; border: none; color: var(--text);
    font-size: 20px; cursor: pointer; padding: 0 4px;
}

.voice-panel-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

/* 语速选择器 */
.voice-panel-speed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.speed-label { font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.speed-options { display: flex; gap: 6px; flex: 1; }
.speed-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.speed-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.speed-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.voice-panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.2s;
}
.voice-panel-item.active { background: rgba(233,69,96,0.15); }

.voice-panel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.voice-panel-name { font-size: 16px; font-weight: 600; color: var(--text); }
.voice-panel-desc { font-size: 13px; color: var(--text-dim); }

.voice-panel-preview, .voice-panel-use {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.voice-panel-preview:hover { background: rgba(255,255,255,0.1); }
.voice-panel-use { border-color: var(--accent); color: var(--accent); }
.voice-panel-use:hover { background: rgba(233,69,96,0.15); }

/* ============ 原文字输入区 ============ */

.text-input-area {
    display: none;
    width: 100%;
    max-width: 400px;
    margin-top: 12px;
    gap: 8px;
    align-items: center;
}

.text-input-area.show {
    display: flex;
}

.text-input-area input {
    flex: 1;
    padding: 12px 20px;
    font-size: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.text-input-area input:focus {
    border-color: var(--accent);
}

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

.text-input-area button {
    padding: 12px 24px;
    font-size: 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.text-input-area button:hover {
    background: #c23152;
}

/* ============ 移动端适配 ============ */

@media (max-width: 600px) {
    .logo-text { font-size: 34px; }
    .gender-btn { width: 120px; height: 160px; font-size: 22px; }
    .gender-icon { font-size: 48px; }
    .ai-avatar { width: 130px; height: 130px; }
    .ai-name { font-size: 24px; }
    .user-video { width: 90px; height: 120px; bottom: 160px; right: 12px; }
    .call-status { font-size: 16px; }
    .talk-btn { width: 120px; height: 120px; }
    .talk-icon { font-size: 34px; }
    .talk-text { font-size: 15px; }
    .gender-buttons { gap: 16px; }
}

@media (max-width: 380px) {
    .gender-btn { width: 100px; height: 140px; }
    .gender-icon { font-size: 40px; }
    .gender-btn span:last-child { font-size: 20px; }
}

/* ============ 主动关怀弹窗 ============ */

.care-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.care-popup-overlay.show { opacity: 1; visibility: visible; }

.care-popup {
    width: 90%;
    max-width: 380px;
    background: linear-gradient(160deg, #1e2a4a 0%, #1a1a2e 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}
.care-popup-overlay.show .care-popup { transform: translateY(0) scale(1); }

.care-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 12px;
}

.care-popup-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #00d9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    animation: carePulse 2s ease-in-out infinite;
}

@keyframes carePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233,69,96,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(233,69,96,0); }
}

.care-popup-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.care-popup-trigger {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.care-popup-body {
    padding: 0 20px 16px;
}

.care-popup-message {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}

.care-popup-footer {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.care-popup-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.care-popup-btn-reply {
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
}
.care-popup-btn-reply:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233,69,96,0.3); }

.care-popup-btn-dismiss {
    background: rgba(255,255,255,0.08);
    color: var(--text-dim);
    border: 1px solid rgba(255,255,255,0.12);
}
.care-popup-btn-dismiss:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.care-popup-timer {
    height: 3px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.care-popup-timer-bar {
    height: 100%;
    background: var(--accent);
    width: 100%;
    transition: width 0.1s linear;
}

/* ============ 仪表盘页面 ============ */

.dashboard-page {
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto 24px;
}

.dashboard-title {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #e94560, #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-back-btn {
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.dashboard-back-btn:hover { background: rgba(255,255,255,0.08); }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 24px;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.dashboard-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ai-speaking);
}

.dashboard-card-label {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 4px;
}

.dashboard-section {
    max-width: 900px;
    margin: 0 auto 24px;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
}

.dashboard-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-section-title-icon { font-size: 20px; }

/* 权重柱状图 */
.weight-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weight-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weight-bar-label {
    width: 120px;
    font-size: 14px;
    color: var(--text-dim);
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weight-bar-track {
    flex: 1;
    height: 24px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.weight-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 12px;
    color: #fff;
    font-weight: 600;
    min-width: 30px;
}

.weight-bar-positive { background: linear-gradient(90deg, #4ecca3, #2d9b7a); }
.weight-bar-neutral { background: linear-gradient(90deg, #555, #333); }
.weight-bar-negative { background: linear-gradient(90deg, #e94560, #c23152); }

/* 反馈记录表 */
.feedback-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.feedback-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
}

.feedback-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
}

.feedback-table tr:hover td { background: rgba(255,255,255,0.03); }

.feedback-score {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.feedback-score-high { background: rgba(78,204,163,0.2); color: #4ecca3; }
.feedback-score-mid { background: rgba(255,217,61,0.15); color: #ffd93d; }
.feedback-score-low { background: rgba(233,69,96,0.15); color: #e94560; }

/* 关怀历史 */
.care-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.care-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.care-history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,217,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.care-history-content { flex: 1; }
.care-history-msg { font-size: 15px; color: var(--text); line-height: 1.5; }
.care-history-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.dashboard-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-dim);
    font-size: 15px;
}

/* 六维评分权重展示 */
.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dimension-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.dimension-name {
    width: 160px;
    font-size: 14px;
    color: var(--text);
    flex-shrink: 0;
}

.dimension-weight-bar {
    flex: 1;
    height: 20px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.dimension-weight-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #00d9ff, #0099cc);
    transition: width 0.5s ease;
}

.dimension-weight-text {
    width: 50px;
    text-align: right;
    font-size: 14px;
    color: var(--text-dim);
    flex-shrink: 0;
}
