/* static/css/style.css - 通用基础样式
   base.html 每次都会加载这里，适合放跨主题复用的小组件样式。 */

/* 旧模板仍在使用的项目级组件 */
.grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin: 2rem 0;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.upload-section {
    text-align: center;
    margin: 2rem 0;
}

.hero-actions,
.section-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary, #666);
    font-size: 1.2rem;
}

.section-title-light {
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    color: var(--text-secondary, #666);
    margin-bottom: 2rem;
}

.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.remember-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.remember-group label {
    margin: 0;
    cursor: pointer;
}

.rhyme-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.rhyme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.rhyme-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rhyme-content {
    padding: 1.5rem;
}

.rhyme-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.rhyme-meta {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.rhyme-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-light, var(--color-primary, #4a90e2));
    color: white;
}

.favorite-btn {
    align-items: center;
    background: transparent;
    border: 2px solid var(--primary-light, var(--color-primary, #4a90e2));
    border-radius: 20px;
    color: var(--primary-light, var(--color-primary, #4a90e2));
    cursor: pointer;
    display: flex;
    gap: 5px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.favorite-btn:hover,
.favorite-btn.favorited {
    background: var(--primary-light, var(--color-primary, #4a90e2));
    border-color: var(--primary-light, var(--color-primary, #4a90e2));
    color: white;
}

.favorite-btn:hover {
    transform: scale(1.05);
}

.favorite-btn.favorited:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.notification {
    align-items: center;
    animation: slideInFromRight 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: white;
    display: flex;
    gap: 10px;
    max-width: 300px;
    padding: 1rem 1.5rem;
    position: fixed;
    right: 20px;
    top: 100px;
    z-index: 1000;
}

.notification-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.notification-error {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
}

.notification-info {
    background: linear-gradient(135deg, #2196F3 0%, #0b7dda 100%);
}

.notification-close {
    background: transparent;
    border: 0;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.empty-state {
    grid-column: 1 / -1;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 2rem;
}

.error-panel {
    margin: 0 auto;
    max-width: 560px;
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1.25rem;
}

.error-title {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 1.25rem 0;
    padding: 1rem;
}

.upload-form {
    margin: 0 auto;
    max-width: 600px;
}

.form-hint {
    color: var(--text-secondary, #666);
    display: block;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.radio-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.radio-option {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.metric-card,
.badge-card,
.profile-summary {
    text-align: center;
}

.profile-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.metric-value {
    color: var(--primary-light, var(--color-primary, #4a90e2));
    font-size: 2rem;
    font-weight: bold;
}

.progress-track {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    font-size: 0.8rem;
    height: 100%;
    line-height: 20px;
    text-align: center;
}

.badge-section {
    margin-bottom: 3rem;
}

.badge-section-title {
    margin-bottom: 1.5rem;
}

.badge-section-title.common {
    color: #666;
}

.badge-section-title.rare {
    color: #4a90e2;
}

.badge-section-title.epic {
    color: #9c27b0;
}

.badge-section-title.legendary {
    color: #ff9800;
}

.badge-card.locked {
    opacity: 0.5;
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.badge-name {
    margin-bottom: 0.5rem;
}

.badge-description {
    color: #666;
    margin-bottom: 0.5rem;
}

.badge-earned-at {
    color: #999;
}

.badge-status {
    background: #f0f0f0;
    border-radius: 15px;
    color: #666;
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.badge-status.unlocked {
    background: #4CAF50;
    color: white;
}

.leaderboard-item {
    align-items: center;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    padding: 15px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background-color: var(--light-bg, #f7fafc);
    transform: translateX(5px);
}

.leaderboard-item:nth-child(1) .rank {
    color: #FFD700;
}

.leaderboard-item:nth-child(2) .rank {
    color: #C0C0C0;
}

.leaderboard-item:nth-child(3) .rank {
    color: #CD7F32;
}

.rank {
    color: var(--primary-light, var(--color-primary, #4a90e2));
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    width: 60px;
}

.user-avatar {
    align-items: center;
    background: linear-gradient(135deg, #FF6B8B, #4ECDC4);
    border-radius: 50%;
    color: white;
    display: flex;
    font-size: 1.2rem;
    font-weight: bold;
    height: 50px;
    justify-content: center;
    margin-right: 15px;
    width: 50px;
}

.user-info {
    flex: 1;
}

.user-name,
.score-value,
.current-rank-value {
    font-weight: bold;
}

.user-name {
    font-size: 1.1rem;
}

.user-mode,
.score-label {
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

.score {
    text-align: right;
}

.score-value {
    color: var(--primary-light, var(--color-primary, #4a90e2));
    font-size: 1.5rem;
}

.current-user-rank,
.completion-status {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    color: white;
    margin-bottom: 20px;
    padding: 15px;
    text-align: center;
}

.current-rank-value {
    font-size: 2rem;
}

.quick-actions {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    text-align: center;
}

.challenge-info,
.challenge-history,
.missing-state {
    padding: 20px;
    text-align: center;
}

.challenge-date {
    color: var(--text-secondary, #666);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.challenge-title {
    color: var(--primary-light, var(--color-primary, #4a90e2));
    margin-bottom: 20px;
}

.challenge-target {
    background: linear-gradient(135deg, #FFD166, #FF9E6D);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(255, 209, 102, 0.3);
    color: white;
    margin: 20px 0;
    padding: 15px;
}

.challenge-target-score {
    font-size: 1.5rem;
    font-weight: bold;
}

.challenge-reward {
    font-size: 1.2rem;
}

.rhyme-background,
.challenge-rules {
    background: var(--light-bg, #f7fafc);
    border-radius: 10px;
    margin: 20px 0;
    padding: 15px;
    text-align: left;
}

.completion-status {
    margin: 20px 0;
    padding: 20px;
}

.completion-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.completion-note {
    font-size: 0.9rem;
    opacity: 0.9;
}

.challenge-actions {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr 1fr;
    margin: 20px 0;
}

.challenge-action {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.challenge-action-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

body.adult-style .btn:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-outline) {
    background: var(--primary-light);
    color: white;
}

body.kids-style .btn:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-outline) {
    background: var(--color-primary);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #42e695 0%, #3bb2b8 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
}

.btn-accent {
    background: var(--accent-color, var(--color-accent, #805ad5));
    color: white;
}

.alert-message,
.alert-info {
    color: #2c5282;
    border-color: var(--primary-light, var(--color-secondary, #4a90e2));
}

.alert-error,
.alert-danger {
    color: #b91c1c;
    border-color: var(--danger-color, var(--color-warning, #f44336));
}

.alert-warning {
    color: #92400e;
    border-color: var(--warning-color, var(--color-accent, #ed8936));
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .rhyme-card-header,
    .radio-group,
    .challenge-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .favorite-btn {
        align-self: flex-start;
    }

    .leaderboard-item {
        padding: 10px;
    }

    .user-avatar {
        font-size: 1rem;
        height: 40px;
        margin-right: 10px;
        width: 40px;
    }

    .rank {
        font-size: 1.2rem;
        width: 40px;
    }
}

/* 页脚备案信息链接 */
.footer-filing {
    margin-top: 10px;
}

.footer-filing a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-filing a:hover {
    color: white;
}

/* 打印样式 */
@media print {
    .style-switcher,
    .navbar,
    .footer {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000FF;
        --color-secondary: #008000;
        --text-primary: #000000;
        --bg-card: #FFFFFF;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
