/* iOS 毛玻璃拟态效果 */

/* 基础毛玻璃效果 */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 毛玻璃卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 2rem;
    margin: 1rem 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* 毛玻璃按钮 */
.glass-button {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.glass-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 毛玻璃输入框 */
.glass-input {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.glass-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* 毛玻璃模态框 */
.glass-modal {
    background: rgba(245, 241, 235, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(245, 241, 235, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--text-medium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.close:hover {
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* PDF 查看器 */
.pdf-viewer {
    width: 100%;
    height: 70vh;
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 讲义网格 */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.note-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.note-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
}

.note-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.note-card .subject-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
}

.note-card .date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* 题目样式 */
.quiz-content {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
}

.question-card {
    margin-bottom: 2rem;
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.options-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 769px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.option-item {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.option-item.selected {
    background: rgba(184, 196, 176, 0.3);
    border-color: var(--morandi-green);
}

.option-item.correct {
    background: rgba(184, 196, 176, 0.4);
    border-color: var(--morandi-green);
    animation: correctAnswer 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-item.incorrect {
    background: rgba(212, 184, 192, 0.4);
    border-color: var(--morandi-pink);
    animation: incorrectAnswer 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectAnswer {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* 闪卡样式 */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.flashcard {
    width: 400px;
    height: 250px;
    perspective: 1000px;
    margin-bottom: 2rem;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
}

.flashcard-front {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--text-dark);
}

.flashcard-back {
    background: rgba(184, 196, 176, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    transform: rotateY(180deg);
}

.card-content {
    text-align: center;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.card-content p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.flashcard-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 文章网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
}

.article-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--morandi-blue), var(--morandi-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-excerpt {
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 关于页面 */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.about-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.about-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--text-medium);
    line-height: 1.6;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-dark);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .flashcard {
        width: 320px;
        height: 200px;
    }
    
    .flashcard-front,
    .flashcard-back {
        padding: 1.5rem;
    }
    
    .card-content h3 {
        font-size: 1.2rem;
    }
    
    .card-content p {
        font-size: 1rem;
    }
    
    .flashcard-controls {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .control-btn {
        width: 200px;
        margin: 0;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100vw - 2rem);
    }
    
    .glass-modal {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .flashcard {
        width: 280px;
        height: 180px;
    }
    
    .flashcard-front,
    .flashcard-back {
        padding: 1rem;
    }
    
    .card-content h3 {
        font-size: 1.1rem;
    }
    
    .card-content p {
        font-size: 0.95rem;
    }
    
    .note-card {
        padding: 1.25rem;
    }
    
    .article-content {
        padding: 1.25rem;
    }
    
    .about-card {
        padding: 1.5rem;
    }
}

/* 玻璃态滚动条 */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(255, 255, 255, 0.25);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}

.article-detail-content,
.quiz-content,
.subject-grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(255, 255, 255, 0.25);
}

.article-detail-content::-webkit-scrollbar,
.quiz-content::-webkit-scrollbar,
.subject-grid::-webkit-scrollbar {
    width: 8px;
}

.article-detail-content::-webkit-scrollbar-track,
.quiz-content::-webkit-scrollbar-track,
.subject-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.article-detail-content::-webkit-scrollbar-thumb,
.quiz-content::-webkit-scrollbar-thumb,
.subject-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}
