:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", 
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

main {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.category-selector {
    margin-bottom: 30px;
    text-align: center;
}

.category-selector label {
    font-size: 1rem;
    font-weight: 500;
    margin-right: 10px;
    color: var(--text-muted);
}

.category-selector select {
    padding: 8px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-selector select:hover {
    border-color: var(--primary-color);
}

.category-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quote-card {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 100%;
}

.quote-text {
    font-size: 1.8rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 500;
    text-align: justify;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.quote-text.long {
    font-size: 1.4rem;
    line-height: 2;
    font-weight: 400;
}

.quote-translation {
    font-size: 1.3rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-weight: 400;
    text-align: justify;
    font-style: italic;
    padding-left: 20px;
    border-left: 3px solid var(--border-color);
    display: none;
}

.quote-translation.show {
    display: block;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quote-author {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

.quote-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.info p {
    margin: 5px 0;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

footer a:hover {
    border-bottom-color: white;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 25px;
    }
    
    .quote-card {
        padding: 25px;
    }
    
    .quote-text {
        font-size: 1.4rem;
    }
    
    .quote-text.long {
        font-size: 1.1rem;
        line-height: 1.9;
    }
    
    .quote-translation {
        font-size: 1.1rem;
        padding-left: 15px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
    
    .quote-text {
        font-size: 1.2rem;
    }
    
    .quote-text.long {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .quote-translation {
        font-size: 1rem;
        padding-left: 10px;
    }
}
