/* ================= 教学资料页面样式 ================= */
.materials-page {
    padding-top: 130px;
    padding-bottom: 80px;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-title {
    font-size: 3.2rem;
    font-weight: 900;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
}

/* Materials card 升级版毛玻璃材质 */
.material-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.tool-card {
    cursor: pointer;
}

.tool-card .card-action {
    pointer-events: none;
}

/* 炫光光效叠加 */
.material-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card-action {
    margin-top: auto;
}

.material-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
}

.material-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(79, 172, 254, 0.15);
}

.material-card:hover::before {
    opacity: 1;
}

/* Icon 容器优化 */
.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15), rgba(79, 172, 254, 0.05));
    color: var(--color-blue);
    border: 1px solid rgba(79, 172, 254, 0.2);
    box-shadow: inset 0 2px 10px rgba(255,255,255,0.05);
}

/* Content */
.card-content {
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.file-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.material-card:hover .file-name {
    color: var(--color-blue);
}

.file-meta {
    display: flex;
    gap: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* Download button */
.card-action {
    align-self: flex-end;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 2;
}

.card-action:hover {
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
}

.card-action.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.card-action.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-muted);
    box-shadow: none;
    transform: none;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.preview-page {
    max-width: 1500px;
}

.preview-header {
    margin-bottom: 28px;
}

.preview-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: -8px 0 28px;
}

.preview-shell {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    min-height: 72vh;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.pdf-preview-frame {
    display: block;
    width: 100%;
    height: 78vh;
    border: 0;
    background: #111827;
}

.doc-preview {
    max-width: 960px;
    min-height: 72vh;
    margin: 0 auto;
    padding: 54px 62px;
    background: rgba(255, 255, 255, 0.96);
    color: #1f2937;
    line-height: 1.82;
    font-size: 1rem;
}

.doc-preview h1,
.doc-preview h2,
.doc-preview h3 {
    color: #111827;
    line-height: 1.35;
}

.doc-preview p {
    margin: 0 0 1em;
}

.preview-empty {
    padding: 100px 30px;
}

@media (max-width: 768px) {
    .material-actions {
        justify-content: flex-start;
    }

    .pdf-preview-frame {
        height: 70vh;
    }

    .doc-preview {
        padding: 30px 22px;
        font-size: 0.95rem;
    }
}
