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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    padding: 20px;
}

/* 使用说明区域 */
.instructions-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.instructions-section h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.instruction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.step-number {
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.step-content h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.tag {
    background: white;
    color: #667eea;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-section {
    margin-bottom: 30px;
}

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

#scenicInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

#scenicInput:focus {
    border-color: #667eea;
}

#searchBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#searchBtn:active {
    transform: translateY(0);
}

.spots-section {
    margin-bottom: 30px;
}

.spots-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.spots-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.spot-card {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.spot-card:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.spot-card.active {
    background: #764ba2;
    color: white;
}

.explanation-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

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

.explanation-header h2 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

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

.voice-select {
    padding: 10px 15px;
    background: white;
    color: #333;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    min-width: 150px;
}

.voice-select:hover {
    border-color: #764ba2;
    background: #f8f9fa;
}

.voice-select:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.play-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.play-btn:hover {
    background: #218838;
}

.play-btn.playing {
    background: #dc3545;
}

.play-btn.highlight-btn {
    animation: pulse 1.5s ease-in-out 2;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
        transform: scale(1);
    }
}

.explanation-content {
    color: #555;
    line-height: 1.8;
    font-size: 1.05rem;
    white-space: pre-wrap;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.hidden {
    display: none;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 10px;
}

.clear-cache-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.clear-cache-btn:hover {
    background: #5a6268;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    main {
        padding: 15px;
    }

    /* 使用说明移动端优化 */
    .instructions-section {
        padding: 15px;
    }

    .instructions-section h2 {
        font-size: 1.2rem;
    }

    .instruction-item {
        padding: 12px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .step-content h3 {
        font-size: 1rem;
    }

    .step-content p {
        font-size: 0.85rem;
    }

    .feature-tags {
        gap: 8px;
    }

    .tag {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .input-group {
        flex-direction: column;
    }

    #scenicInput, #searchBtn {
        width: 100%;
        font-size: 0.95rem;
    }

    .spots-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .spot-card {
        padding: 15px;
        font-size: 0.95rem;
    }

    .explanation-section {
        padding: 15px;
    }

    .explanation-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .controls-group {
        flex-direction: column;
        width: 100%;
    }

    .voice-select {
        width: 100%;
    }

    .explanation-header h2 {
        font-size: 1.2rem;
    }

    .play-btn {
        width: 100%;
        padding: 12px;
    }

    .explanation-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    footer {
        padding: 15px;
        font-size: 0.85rem;
    }

    .clear-cache-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .spots-section h2,
    .explanation-header h2 {
        font-size: 1.1rem;
    }

    .spot-card {
        padding: 12px;
    }
}
