/* 全局样式 */
:root {
    --primary-color: #28a745;
    --secondary-color: #20c997;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

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

html {
    overflow-y: scroll; /* 始终显示滚动条，防止内容变化时页面水平抖动 */
    scrollbar-gutter: stable;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f5f5;
    padding-top: 76px; /* 为固定导航栏留出空间 */
}

/* 导航栏样式 */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* 语言切换下拉菜单 */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.dropdown-item {
    padding: 10px 20px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle::after {
    display: none;
}

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - 76px - 180px);
}

/* 页面切换区域 */
.section {
    padding: 40px 0;
    display: none;
    min-height: calc(100vh - 76px - 60px);
    background-attachment: fixed;
    background-size: 100% 100%, 280px 280px;
    position: relative;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-color);
    font-weight: 600;
}

.section-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 首页英雄区 */
.hero-section {
    padding: 60px 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* 功能卡片 */
.feature-cards {
    margin-top: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    border: 2px solid transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 2rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* 五色展示 */
.colors-showcase {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    box-shadow: var(--shadow-sm);
}

.color-name {
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.color-circle[style*="FFFFFF"] .color-name {
    color: #333;
}

/* 图像识别页面 */
.recognition-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(240, 255, 244, 0.92);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-content h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.upload-content p {
    color: var(--text-muted);
}

.preview-area {
    text-align: center;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.preview-area img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.result-area {
    margin-top: 30px;
}

.result-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.result-header h4 {
    margin: 0;
    color: var(--dark-color);
}

.result-body p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.cultural-info, .usage-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.cultural-info h5, .usage-info h5 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* 语音对话页面 */
.voice-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    height: 600px;
}

.avatar-section {
    flex: 0 0 250px;
}

.avatar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--primary-color);
}

.avatar-icon {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.avatar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-history {
    flex: 1;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
}

.user-message {
    margin-left: auto;
    text-align: right;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
    border-radius: 15px 15px 5px 15px;
    padding: 15px;
    display: inline-block;
    text-align: left;
}

.bot-message .message-content {
    background: #f0f0f0;
    border-radius: 15px 15px 15px 5px;
    padding: 15px;
    display: inline-block;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.input-section {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.input-group {
    display: flex;
    gap: 10px;
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* AR体验页面 */
.ar-container {
    max-width: 1000px;
    margin: 0 auto;
}

.instruction-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h5 {
    color: var(--dark-color);
    margin-bottom: 5px;
}

.step-content p {
    color: var(--text-muted);
    margin: 0;
}

.ar-marker-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
}

.ar-marker-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.marker-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.marker-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ar-marker-card h5 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.ar-marker-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.ar-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
}

.ar-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    font-size: 1.5rem;
    color: #333;
}

.ar-content {
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 600px;
}

#arScene {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    overflow: hidden;
}

/* 关于页面 */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
}

.about-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: 100%;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.about-card h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.tech-list, .highlight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-list li, .highlight-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tech-list li:last-child, .highlight-list li:last-child {
    border-bottom: none;
}

.team-roles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.role {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.role-title {
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.role p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.document-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 页脚 */
.footer {
    margin-top: auto;
}

/* ===== 各页面个性化壮族元素背景（增强版） ===== */

/* 首页：壮乡壮锦五色纹样 + 鲜明绿黄渐变（壮族元素最突出） */
#home.section {
    background-color: #c8e6c9;
    background-image:
        linear-gradient(135deg, rgba(200,230,201,0.85) 0%, rgba(255,248,225,0.90) 40%, rgba(200,230,201,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cg opacity='0.25'%3E%3Crect x='0' y='0' width='360' height='360' fill='none'/%3E%3Cpath d='M180 60 L300 180 L180 300 L60 180 Z' fill='none' stroke='%23E63946' stroke-width='2.5'/%3E%3Cpath d='M180 100 L260 180 L180 260 L100 180 Z' fill='none' stroke='%23F4A261' stroke-width='2.5'/%3E%3Cpath d='M180 140 L220 180 L180 220 L140 180 Z' fill='none' stroke='%239B5DE5' stroke-width='2.5'/%3E%3Ccircle cx='180' cy='180' r='30' fill='none' stroke='%232C2C2C' stroke-width='2.5'/%3E%3Ccircle cx='180' cy='180' r='18' fill='none' stroke='%232C2C2C' stroke-width='2'/%3E%3Ccircle cx='180' cy='180' r='6' fill='%23E63946' opacity='0.4'/%3E%3Cline x1='180' y1='60' x2='180' y2='100' stroke='%23E63946' stroke-width='2.5'/%3E%3Cline x1='180' y1='260' x2='180' y2='300' stroke='%23E63946' stroke-width='2.5'/%3E%3Cline x1='60' y1='180' x2='100' y2='180' stroke='%23E63946' stroke-width='2.5'/%3E%3Cline x1='260' y1='180' x2='300' y2='180' stroke='%23E63946' stroke-width='2.5'/%3E%3Cline x1='100' y1='100' x2='140' y2='140' stroke='%23F4A261' stroke-width='2'/%3E%3Cline x1='260' y1='260' x2='220' y2='220' stroke='%23F4A261' stroke-width='2'/%3E%3Cline x1='260' y1='100' x2='220' y2='140' stroke='%23F4A261' stroke-width='2'/%3E%3Cline x1='100' y1='260' x2='140' y2='220' stroke='%23F4A261' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* 植物识别：青绿叶片脉络 + 自然渐变 */
#recognition.section {
    background-color: #b2dfdb;
    background-image:
        linear-gradient(160deg, rgba(178,223,219,0.85) 0%, rgba(255,255,255,0.93) 50%, rgba(178,223,219,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg opacity='0.22'%3E%3Cpath d='M150 40 Q230 95 150 150 Q70 205 150 260' fill='none' stroke='%231B5E20' stroke-width='2.5'/%3E%3Cpath d='M150 40 Q70 95 150 150 Q230 205 150 260' fill='none' stroke='%231B5E20' stroke-width='2.5'/%3E%3Cline x1='150' y1='40' x2='150' y2='260' stroke='%232E7D32' stroke-width='1.5'/%3E%3Cline x1='55' y1='110' x2='150' y2='150' stroke='%232E7D32' stroke-width='1.5'/%3E%3Cline x1='245' y1='110' x2='150' y2='150' stroke='%232E7D32' stroke-width='1.5'/%3E%3Cline x1='55' y1='190' x2='150' y2='150' stroke='%232E7D32' stroke-width='1.5'/%3E%3Cline x1='245' y1='190' x2='150' y2='150' stroke='%232E7D32' stroke-width='1.5'/%3E%3Ccircle cx='150' cy='150' r='10' fill='%231B5E20' opacity='0.25'/%3E%3C/g%3E%3C/svg%3E");
}

/* 语音对话：暖橙声波 + 对话气泡纹理 */
#voice.section {
    background-color: #ffe0b2;
    background-image:
        linear-gradient(160deg, rgba(255,224,178,0.85) 0%, rgba(255,255,255,0.93) 50%, rgba(255,224,178,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg opacity='0.25'%3E%3Cpath d='M35 130 Q75 75 75 130 Q75 185 35 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Cpath d='M225 130 Q185 75 185 130 Q185 185 225 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Cpath d='M75 130 Q110 60 110 130 Q110 200 75 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Cpath d='M185 130 Q150 60 150 130 Q150 200 185 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Cpath d='M110 130 Q130 50 130 130 Q130 210 110 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Cpath d='M150 130 Q130 50 130 130 Q130 210 150 130' fill='none' stroke='%23EF6C00' stroke-width='2.5'/%3E%3Ccircle cx='130' cy='130' r='15' fill='%23EF6C00' opacity='0.2'/%3E%3C/g%3E%3C/svg%3E");
}

/* AR体验：科技蓝菱形网格 + 几何纹样 */
#ar.section {
    background-color: #90caf9;
    background-image:
        linear-gradient(160deg, rgba(144,202,249,0.85) 0%, rgba(255,255,255,0.93) 50%, rgba(144,202,249,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg opacity='0.22'%3E%3Cpath d='M150 40 L260 150 L150 260 L40 150 Z' fill='none' stroke='%23015679' stroke-width='2.5'/%3E%3Cpath d='M150 85 L215 150 L150 215 L85 150 Z' fill='none' stroke='%23015679' stroke-width='2.5'/%3E%3Cpath d='M150 130 L170 150 L150 170 L130 150 Z' fill='none' stroke='%23015679' stroke-width='2.5'/%3E%3Cline x1='150' y1='40' x2='150' y2='260' stroke='%23015679' stroke-width='2'/%3E%3Cline x1='40' y1='150' x2='260' y2='150' stroke='%23015679' stroke-width='2'/%3E%3Cline x1='70' y1='70' x2='230' y2='230' stroke='%23015679' stroke-width='2'/%3E%3Cline x1='230' y1='70' x2='70' y2='230' stroke='%23015679' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* 关于页面：壮锦紫菱纹 + 紫色渐变 */
#about.section {
    background-color: #ce93d8;
    background-image:
        linear-gradient(160deg, rgba(206,147,216,0.85) 0%, rgba(255,255,255,0.93) 50%, rgba(206,147,216,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg opacity='0.25'%3E%3Cpath d='M130 40 L220 130 L130 220 L40 130 Z' fill='none' stroke='%236A1B9A' stroke-width='2.5'/%3E%3Cpath d='M130 70 L190 130 L130 190 L70 130 Z' fill='none' stroke='%236A1B9A' stroke-width='2.5'/%3E%3Cpath d='M130 100 L160 130 L130 160 L100 130 Z' fill='none' stroke='%236A1B9A' stroke-width='2.5'/%3E%3Cpath d='M130 115 L140 130 L130 145 L120 130 Z' fill='none' stroke='%236A1B9A' stroke-width='2.5'/%3E%3Cline x1='130' y1='40' x2='130' y2='220' stroke='%236A1B9A' stroke-width='2'/%3E%3Cline x1='40' y1='130' x2='220' y2='130' stroke='%236A1B9A' stroke-width='2'/%3E%3Cline x1='70' y1='70' x2='190' y2='190' stroke='%236A1B9A' stroke-width='2'/%3E%3Cline x1='190' y1='70' x2='70' y2='190' stroke='%236A1B9A' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .voice-container {
        flex-direction: column;
        height: auto;
    }
    
    .avatar-section {
        flex: 0 0 auto;
    }
    
    .avatar {
        height: auto;
        padding: 20px;
    }
    
    .chat-history {
        min-height: 400px;
    }
    
    .team-roles {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    .feature-cards .col-lg,
    .feature-cards .col-md-6 {
        margin-bottom: 20px;
    }
    
    .colors-showcase .col-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }
    
    .color-circle {
        width: 50px;
        height: 50px;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .quick-questions {
        justify-content: center;
    }
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示框 */
.alert {
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}
/* 语音控制区域 */
.voice-controls {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.voice-controls .form-check {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.voice-controls .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.voice-controls .form-check-label {
    cursor: pointer;
}

/* 消息内语音播放按钮 */
.speak-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-top: 8px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1;
}

.speak-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0fff0;
}

.speak-btn.speaking {
    border-color: var(--primary-color);
    color: white;
    background: var(--primary-color);
    animation: speakPulse 1s ease-in-out infinite;
}

@keyframes speakPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
}

.speak-btn i {
    font-size: 0.85rem;
}

/* 打字机效果 */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* 头像说话动画 */
.avatar-image {
    transition: transform 0.3s ease;
}

.avatar-image.speaking {
    animation: avatarSpeak 0.8s ease-in-out infinite;
}

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

/* 壮语解说页面样式 */
#zhuangyu.section {
    background-color: #a5d6a7;
    background-image:
        linear-gradient(160deg, rgba(165,214,167,0.85) 0%, rgba(255,255,255,0.93) 50%, rgba(165,214,167,0.85) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg opacity='0.22'%3E%3Cpath d='M150 50 Q250 100 150 200 Q50 250 150 50' fill='none' stroke='%232E7D32' stroke-width='2.5'/%3E%3Cpath d='M150 80 Q220 120 150 180 Q80 220 150 80' fill='none' stroke='%232E7D32' stroke-width='2.5'/%3E%3Cpath d='M150 110 Q190 140 150 160 Q110 180 150 110' fill='none' stroke='%232E7D32' stroke-width='2.5'/%3E%3Ccircle cx='150' cy='150' r='20' fill='%232E7D32' opacity='0.2'/%3E%3Cline x1='150' y1='50' x2='150' y2='200' stroke='%232E7D32' stroke-width='2'/%3E%3Cline x1='50' y1='150' x2='250' y2='150' stroke='%232E7D32' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
}

.zhuangyu-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.zhuangyu-player {
    flex: 0 0 400px;
}

.zhuangyu-content {
    flex: 1;
}

.player-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

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

.player-header h3 {
    color: var(--dark-color);
    margin: 0;
    font-size: 1.2rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-progress {
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 8px;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.track-info {
    text-align: center;
    margin-bottom: 25px;
}

.track-info h4 {
    color: var(--dark-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.track-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.playlist {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.playlist h5 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1rem;
}

.playlist-items {
    max-height: 380px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 5px;
}

.playlist-item:hover {
    background: #f8f9fa;
}

.playlist-item.active {
    background: #e8f5e9;
    border-left: 3px solid var(--primary-color);
}

.playlist-item-number {
    width: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-title {
    font-size: 0.9rem;
    color: var(--dark-color);
    margin-bottom: 2px;
}

.playlist-item-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.content-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

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

.content-header h3 {
    color: var(--dark-color);
    margin: 0;
    font-size: 1.2rem;
}

.language-toggle {
    display: flex;
    gap: 5px;
}

.language-toggle .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.content-body {
    min-height: 400px;
}

.text-block {
    margin-bottom: 30px;
}

.text-block h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
}

.zhuangyu-paragraph {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-style: italic;
}

.chinese-paragraph {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 15px;
}

.pronunciation-guide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.guide-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zhuangyu-word {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.pronunciation {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.meaning {
    font-size: 0.9rem;
    color: var(--dark-color);
}

.bilingual-item {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.zhuangyu-side, .chinese-side {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.zhuangyu-side h5, .chinese-side h5 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.zhuangyu-side p {
    font-style: italic;
    color: var(--dark-color);
    margin: 0;
}

.chinese-side p {
    color: var(--text-color);
    margin: 0;
}

.quiz-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
    margin: 0 auto;
}

.quiz-card h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    text-align: center;
}

.quiz-question h4 {
    color: var(--dark-color);
    margin-bottom: 20px;
    text-align: center;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.quiz-option {
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option-label {
    font-weight: 600;
    margin-right: 10px;
}

.quiz-result {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.quiz-result.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quiz-result.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .zhuangyu-container {
        flex-direction: column;
    }
    
    .zhuangyu-player {
        flex: 0 0 auto;
    }
    
    .pronunciation-guide {
        grid-template-columns: 1fr;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .bilingual-item {
        flex-direction: column;
    }
}

/* 语言切换按钮样式 */
.voice-controls .btn-group .btn-check:checked + .btn-outline-success {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.voice-controls .btn-group .btn-outline-success {
    font-size: 12px;
    padding: 2px 10px;
    transition: all 0.2s ease;
}

.voice-controls .btn-group .btn-outline-success:hover {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

