/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding-bottom: 70px;
    overflow-x: hidden;
}

/* 顶部状态栏 */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.location-info i {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
}

.icon-btn:active {
    color: var(--primary-color);
}

/* 主要内容区 */
.main-content {
    padding: 0 16px 20px;
}

/* 欢迎区域 */
.welcome-section {
    text-align: center;
    padding: 32px 0 24px;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* 核心功能卡片 */
.feature-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.feature-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.feature-card:active {
    transform: scale(0.98);
}

.primary-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.card-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}

.primary-card .card-icon {
    background: rgba(255, 255, 255, 0.25);
}

.voice-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.feature-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 600;
}

.feature-card p {
    font-size: 12px;
    opacity: 0.8;
}

.primary-card h3,
.primary-card p {
    color: white;
}

.feature-card:not(.primary-card) .card-icon {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* 语音波形动画 */
.voice-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    height: 24px;
}

.voice-wave span {
    width: 3px;
    height: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }

@keyframes wave {
    0%, 100% { height: 12px; }
    50% { height: 24px; }
}

/* 自动讲解区域 */
.auto-guide-section {
    margin-bottom: 24px;
}

.auto-guide-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.auto-guide-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auto-guide-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    position: relative;
}

.icon-broadcast {
    width: 20px;
    height: 20px;
    color: white;
    animation: broadcast-pulse 2s ease-in-out infinite;
}

@keyframes broadcast-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.auto-guide-info {
    flex: 1;
}

.auto-guide-info h4 {
    font-size: 15px;
    margin-bottom: 2px;
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 景点搜索栏 */
.search-section {
    margin-top: 16px;
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 16px;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-clear-btn {
    background: var(--bg-secondary);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-left: 8px;
}

.search-clear-btn:active {
    background: var(--border-color);
}



/* 区域标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.more-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 推荐路线 */
.routes-section {
    margin-bottom: 24px;
}

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-card {
    background: var(--bg-primary);
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.route-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.route-icon.classic {
    background: linear-gradient(135deg, var(--accent-color), #d97706);
}

.route-icon.family {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.route-info {
    flex: 1;
}

.route-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.route-info p {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.route-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.route-btn:active {
    background: var(--primary-dark);
}

/* 附近景点 */
.nearby-section {
    margin-bottom: 24px;
}

.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nearby-item {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s;
}

.nearby-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.nearby-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.nearby-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nearby-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.spot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spot-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
    display: inline-block;
    width: fit-content;
}

.tag-5a {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border-color: #f59e0b;
}

.tag-temple {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    border-color: #8b5cf6;
}

.tag-history {
    background: rgba(6, 182, 212, 0.15);
    color: #0891b2;
    border-color: #06b6d4;
}

.spot-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item i {
    font-size: 11px;
}

.stat-divider {
    color: var(--border-color);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 16px;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary-color);
}

/* 播放器按钮特殊样式 */
.nav-player {
    position: relative;
    margin-top: -20px;
}

.nav-player i {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s;
}

.nav-player:active i {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 语音交互浮层 */
.voice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.voice-overlay.active {
    display: flex;
}

.voice-modal {
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 40px 24px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-secondary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
}

.voice-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.voice-icon-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.voice-modal h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.voice-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.quick-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-btn {
    background: var(--bg-secondary);
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.3s;
}

.quick-btn:active {
    background: var(--border-color);
}

/* 响应式调整 */
@media (max-width: 375px) {
    .app-title {
        font-size: 28px;
    }
    
    .feature-card {
        padding: 16px;
    }
}
