:root {
    --primary-color: #d63031; /* 更加深沉优雅的彼岸花红 */
    --primary-light: #ff7675;
    --primary-dark: #b22222;
    --secondary-color: #2d3436;
    --bg-color: #fcf8f8; /* 带一点点红润的白色背景 */
    --text-color: #2d3436;
    --text-light: #636e72;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 45px rgba(214, 48, 49, 0.1);
    --radius: 16px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; /* 使用现代黑体/无衬线体，视觉更清爽 */
    --chat-bg-user: #fab1a0;
    --chat-bg-bot: #ffffff;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: radial-gradient(#d6303105 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh; /* 恢复正常高度 */
}

/* 聊天页面专用锁定，不影响其他页面 */
body.chat-page {
    height: 100vh;
    overflow: hidden;
}

/* 全局美化 */
.navbar {
    background: white;
    box-shadow: 0 2px 20px rgba(0,0,0,0.03);
    padding: 0 2rem;
    padding-top: env(safe-area-inset-top); /* 适配移动端安全区域 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(214, 48, 49, 0.1);
    min-height: calc(70px + env(safe-area-inset-top)); /* 动态增加高度 */
}

.navbar-brand {
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0; /* 导航菜单不应缩小 */
}

/* 用户资产展示 */
.user-assets {
    display: flex;
    align-items: center;
    background: #fff5f5;
    padding: 5px 15px;
    border-radius: 50px;
    border: 1px solid rgba(214, 48, 49, 0.1);
    gap: 15px;
    margin-right: 10px;
}

.asset-item {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.asset-item strong {
    color: var(--primary-color);
    font-weight: 700;
}

.btn-recharge {
    background: var(--primary-color);
    color: white !important;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 20px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-recharge:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.btn {
    letter-spacing: 1px;
    font-weight: 600;
}

.card {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: #fff5f5;
    color: #e74c3c;
    border: 1px solid #ffebeb;
}

.alert-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

/* 全局容器 */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit; /* 强制继承全局宋体，防止 button 标签默认黑体 */
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white !important;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 48, 49, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white !important;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(214, 48, 49, 0.05);
}

/* 主页亲人卡片网格 */
.relatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.notice-card {
    padding: 16px;
    border-radius: 12px;
}
.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.notice-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.notice-badge {
    padding: 2px 8px;
    border-radius: 12px;
    background: #f1f1f1;
    font-size: .85rem;
}
.notice-title {
    font-weight: 600;
    color: var(--text-color);
}
.notice-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.notice-date {
    color: #999;
    font-size: .85rem;
}
.notice-content {
    margin-top: 8px;
}
.notice-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.notice-delete {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 4px;
}
.notice-delete:hover {
    color: #888;
}
@media (max-width: 600px) {
    .notice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .notice-right {
        align-self: flex-start;
    }
    .notice-content {
        font-size: .95rem;
        line-height: 1.7;
    }
}

.relative-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

.relative-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.relative-cover {
    height: 120px;
    width: 100%;
    opacity: 0.6;
}

.relative-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 2;
}

.relative-info {
    padding: 65px 30px 30px;
    text-align: center;
}

.relative-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.relative-relation {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
    background: rgba(214, 48, 49, 0.08);
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
}

/* 聊天布局 */

.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-color);
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0,0,0,0.05);
    position: relative;
}

.chat-main {
    display: flex;
    flex: 1;
    overflow: hidden; /* 关键：让主区域不撑开高度 */
    background: #fdfafb;
}

.chat-container {
    flex: 1;
    padding: 20px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
    overflow-y: auto; /* 消息区域独立滚动 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 语音播放按钮（消息中） */
.voice-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 8px;
    border-radius: 12px;
    transition: all 0.2s;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    color: var(--primary-color);
    background: rgba(214, 48, 49, 0.05);
}

.voice-play-btn:hover {
    background: rgba(214, 48, 49, 0.15);
    transform: scale(1.1);
}

.voice-play-btn.playing {
    animation: voice-pulse 1.5s infinite;
}

@keyframes voice-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* 隐藏原本的语音按钮区域，因为现在是手动触发 */
.voice-controls {
    display: none !important;
}

.chat-sidebar {
    width: 280px;
    background: transparent;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: none;
    overflow-y: auto;
}

.relative-profile-card {
    text-align: center;
    width: 100%;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background-size: cover;
    background-position: center;
    border: none;
    box-shadow: none;
}

.relative-profile-card h4 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.relative-profile-card p {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    text-align: left;
    background: transparent;
    padding: 15px;
    border-radius: 12px;
    border-left: none;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.message.sent {
    align-self: flex-end;
    background: var(--chat-bg-user);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--chat-bg-bot);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0,0,0,0.03);
}

/* 消息行（用于左侧头像 + 气泡） */
.message-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 6px 0;
}
.message-row.received {
    align-self: flex-start;
}
.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex: 0 0 36px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
/* 右侧头像 + 左侧气泡（用户消息） */
.message-row.sent {
    justify-content: flex-end;
}
.message-row.sent .message.sent {
    order: 0;
    margin-left: auto;
}
.message-row.sent .msg-avatar {
    order: 1;
    margin-left: 8px;
}

/* 移除 Live2D 容器 */
#live2d-container {
    display: none;
}

/* 登录/注册页特定样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-logo {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-weight: bold;
}

/* 首页 Hero 区域 */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    padding: 20px;
    margin-top: -70px; /* 抵消掉 header 可能带来的位移（如果没隐藏的话） */
}

/* 解决其他页面内容被导航栏遮挡或位移的问题 */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
}

/* 针对非 100vh 的页面，如果有导航栏，自动增加 padding */
body:not(.chat-page):not(.auth-container) {
    padding-top: 0;
}

/* 相册页 (如果存在 gallery.php) 样式统筹 */
.gallery-container {
    padding: 40px 0;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
    font-weight: 700 !important;
}
@media (max-width: 600px) {
    .hero-title {
        font-size: 3rem;
        color: var(--primary-color) !important;
        font-weight: 700 !important;
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.6;
}

.flower-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.chat-header {
    background: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    z-index: 100;
    height: auto;
    min-height: 70px;
    padding-top: env(safe-area-inset-top);
}

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

.header-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.header-text h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.header-text p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
}
 
 /* 美观返回按钮 */
 .back-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 6px 8px;
     border-radius: 8px;
     background: transparent;
     border: none;
     color: var(--secondary-color);
     text-decoration: none;
     font-size: 0.95rem;
     font-weight: 600;
     transition: color 0.2s ease;
 }
 .back-btn::before {
     content: "❮";
     font-size: 1.1rem;
     line-height: 1;
     color: currentColor;
     transition: transform 0.2s ease;
 }
 .back-btn:hover {
     color: var(--primary-color);
 }
 .back-btn:hover::before {
     transform: translateX(-2px);
 }

.input-area {
    background: white;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.02);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    height: auto;
    min-height: 80px;
}

.input-box {
    flex: 1;
    padding: 14px 25px;
    border: 2px solid #f1f2f6;
    border-radius: 30px;
    font-size: 1rem;
    background: #f8f9fa;
    transition: all 0.3s;
}

.input-area .btn,
.input-area button {
    flex-shrink: 0;
}

.input-box:focus {
    outline: none;
    background: white;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(214, 48, 49, 0.05);
}

/* 语音通话界面 (Voice Call) */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
    z-index: 2000;
    display: none; /* 默认隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 20px;
}

.call-overlay.active {
    display: flex;
}

.call-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 5px solid rgba(214, 48, 49, 0.5);
    margin-bottom: 30px;
    box-shadow: 0 0 50px rgba(214, 48, 49, 0.3);
    animation: callPulse 2s infinite ease-in-out;
}

@keyframes callPulse {
    0% { transform: scale(1); box-shadow: 0 0 50px rgba(214, 48, 49, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px rgba(214, 48, 49, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 50px rgba(214, 48, 49, 0.3); }
}

.call-name {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.call-status {
    font-size: 1.2rem;
    color: #bdc3c7;
    margin-bottom: 50px;
}

.call-visualizer {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 40px;
    margin-bottom: 80px;
}

.visual-bar {
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
}

.call-overlay.active.speaking .visual-bar {
    animation: visualBar 1.2s infinite ease-in-out;
}

@keyframes visualBar {
    0%, 100% { height: 10px; }
    50% { height: 40px; }
}

.visual-bar:nth-child(2) { animation-delay: 0.2s; }
.visual-bar:nth-child(3) { animation-delay: 0.4s; }
.visual-bar:nth-child(4) { animation-delay: 0.6s; }
.visual-bar:nth-child(5) { animation-delay: 0.8s; }

.call-controls {
    display: flex;
    gap: 30px;
}

.call-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s;
}

.call-btn-end {
    background: #e74c3c;
    color: white;
}

.call-btn-end:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.call-btn-mic {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.call-btn-mic.active {
    background: #27ae60;
}

/* 响应式断点设置为 1024px，确保 PC 端即使窗口稍窄也能看到完整菜单 */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 1.5rem;
    }
    
    .navbar-menu {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
        z-index: 1000;
        gap: 10px;
        border-top: none;
        overflow: visible;
    }

    .user-assets {
        width: 100%;
        margin: 0;
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #fff5f5;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
    }

    .menu-toggle {
        display: none;
        cursor: pointer;
    }

    .menu-toggle .bar {
        display: none;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background: var(--primary-color);
        border-radius: 2px;
    }

    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-link {
        padding: 15px 25px;
        border-bottom: 1px solid #f9f9f9;
        display: block;
        width: 100%;
    }

    .navbar-brand {
        font-size: 1.3rem;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.menu-toggle {
    display: none;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.4);
}

/* 模态框样式 (通用) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* 礼物面板样式 */
.gift-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
}

.gift-item {
    flex: 0 0 100px; /* 固定宽度，不拉伸 */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.gift-item:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 48, 49, 0.1);
}

.gift-icon {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.gift-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.gift-price {
    font-size: 0.85rem;
    color: #f39c12;
    font-weight: bold;
}

/* 相册样式 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.photo-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.photo-card:hover {
    transform: translateY(-5px);
}

.photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-info {
    padding: 10px;
}

.photo-caption {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

.ai-comment {
    font-size: 0.8rem;
    color: #7f8c8d;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    border-left: 3px solid var(--secondary-color);
}

/* 情感报告样式 */
.report-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    width: 100%;
    margin: 0;
}

.report-header {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 15px auto;
    color: white;
}

.score-circle.positive {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.score-circle.negative {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.keyword-section .tag {
    display: inline-block;
    padding: 5px 12px;
    background: #e8f4f8;
    color: #2980b9;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9rem;
}

.summary-section, .advice-section {
    margin-top: 20px;
    padding: 15px;
    background: #fcfcfc;
    border-radius: 8px;
    border: 1px solid #eee;
}

.summary-section h4, .advice-section h4 {
    margin-bottom: 10px;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 3px;
}

/* 表单按钮容器，支持响应式堆叠 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .navbar {
        padding: 0 1rem;
        padding-top: env(safe-area-inset-top);
    }
    
    .navbar-brand {
        font-size: 1.4rem;
    }

    .chat-header {
        gap: 10px;
    }
    .header-avatar {
        width: 44px;
        height: 44px;
    }
    .header-text h3 {
        font-size: 1rem;
    }
    .header-text p {
        font-size: 0.75rem;
    }
    .input-area {
        gap: 10px;
        padding: 12px 16px;
        min-height: 72px;
    }
    .btn-primary#sendBtn {
        padding: 0.5rem 1rem !important;
        border-radius: 18px !important;
    }


    .form-row-mobile {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        margin-left: 0 !important; /* 覆盖 inline-style 的 margin-left */
    }

    .recharge-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 小屏设备进一步优化输入栏，避免按钮被裁切 */
@media (max-width: 520px) {
    .chat-container {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
    .input-area {
        padding: 8px 12px;
        min-height: 56px;
        gap: 6px;
    }
    .input-box {
        padding: 9px 12px;
        font-size: 0.94rem;
        border-radius: 22px;
        border-width: 1px;
    }
    .btn-primary#sendBtn {
        padding: 0.4rem 0.9rem !important;
        border-radius: 16px !important;
        font-size: 0.92rem !important;
        line-height: 1 !important;
        height: 36px !important;
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
