/* 学习资料库样式 */

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    color: #333;
    line-height: 1.8;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 移动端简化背景 */
@media (max-width: 768px) {
    body {
        background: #f0f2f5;
    }
}

/* ========== 头部导航 ========== */
.header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    min-width: 900px;
    flex-wrap: nowrap !important;
}

.logo-area {
    flex-shrink: 0;
    min-width: 100px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 55px;
    width: auto;
    display: block;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #4f46e5;
}

.slogan {
    display: none;
}

.nav {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-item {
    text-decoration: none;
    color: #4b5563;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

.nav-item:active {
    outline: 2px solid #4f46e5;
    opacity: 0.8;
}

.nav-item.active {
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
}

.user-area {
    display: flex !important;
    gap: 8px !important;
    align-items: center;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    min-width: 200px;
}

.user-info {
    color: #6b7280;
    font-size: 14px;
    white-space: nowrap;
}

.member-badge {
    background: #f59e0b;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.user-dropdown-btn:hover {
    background: #e5e7eb;
}

.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 140px;
    padding: 6px 0;
    display: none;
    z-index: 1000;
}

.user-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

.dropdown-item svg {
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    white-space: nowrap;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: #fff;
    color: #4f46e5;
    border: 2px solid #4f46e5;
}

.btn-outline:hover {
    background: #4f46e5;
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-large {
    padding: 12px 28px;
    font-size: 15px;
}

/* ========== 主内容区 ========== */
.main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px 20px;
    flex: 1 0 auto;
    width: 100%;
}

/* ========== 分类标题区 ========== */
.category-header {
    background: #fff;
    padding: 20px 25px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.category-header h1 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1f2937;
    font-weight: 700;
}

.seo-keywords {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.seo-tag {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #0369a1;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sub-categories {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.sub-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.sub-categories .tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.sub-categories .tag:hover, .sub-categories .tag.active {
    background: #4f46e5;
    color: #fff;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.filter-section {
    margin-bottom: 12px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: #374151;
    font-size: 13px;
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tags .tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-tags .tag:hover {
    background: #e5e7eb;
}

.filter-tags .tag.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

/* ========== 资料卡片 ========== */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.material-card {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

/* 右上角格式徽章 */
.card-format-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    z-index: 1;
    letter-spacing: 0.5px;
}
.card-format-badge.pdf  { background: #ef4444; }
.card-format-badge.word { background: #3b82f6; }
.card-format-badge.ppt  { background: #f59e0b; }

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: #f9fafb;
}

.card-thumb-empty {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-small {
    background: #f3f4f6;
    color: #6b7280;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.card-title {
    font-size: 13px;
    color: #1f2937;
    line-height: 1.3;
    font-weight: 600;
}

.card-meta {
    color: #9ca3af;
    font-size: 11px;
}

.card-price {
    font-weight: 700;
    font-size: 12px;
}

.card-price:not(.free):not(.downloaded) {
    color: #f59e0b;
}

.card-price.free {
    color: #10b981;
}

.card-price.downloaded {
    color: #8b5cf6;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* ========== 空状态 ========== */
.empty-message {
    text-align: center;
    color: #6b7280;
    padding: 80px 30px;
    font-size: 16px;
    background: #fff;
    border-radius: 12px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.page-btn {
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-size: 15px;
}

.page-btn.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* ========== 底部 ========== */
.footer {
    background: #1f2937;
    color: #fff;
    flex-shrink: 0;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #f9fafb;
    border-bottom: 2px solid #4b5563;
    padding-bottom: 10px;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.8;
    color: #d1d5db;
    margin: 0;
}

.footer-col a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 8px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fbbf24;
}

/* 快速链接 2x2 网格 */
.footer-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.footer-quick-links a {
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 二维码区域 */
.footer-contact-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.footer-contact-text {
    flex: 1;
}

.footer-contact-text p {
    font-size: 13px;
    line-height: 1.8;
    color: #d1d5db;
    margin: 0;
}

.footer-qr-box {
    width: 80px;
    height: 80px;
    background: #374151;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px dashed #6b7280;
}

.footer-qr-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-qr-box span {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    padding: 4px;
}

.footer-bottom {
    background: #111827;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #374151;
}

.footer-bottom p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

.footer-disclaimer {
    background: #111827;
    padding: 14px 20px;
    text-align: center;
    border-top: 1px solid #374151;
}

.footer-disclaimer p {
    font-size: 12px;
    line-height: 1.6;
    color: #9ca3af;
    margin: 0;
}

/* ========== 会员中心 ========== */
.member-card {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.member-info, .member-status {
    flex: 1;
    min-width: 200px;
}

.member-info h2, .member-status h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1f2937;
}

.member-badge.active {
    background: #10b981;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.member-badge.none {
    background: #6b7280;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.points {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
}

.section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.price-cards {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.price-card {
    flex: 1;
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e5e7eb;
    position: relative;
    min-width: 180px;
}

.price-card.recommended {
    border: 2px solid #4f46e5;
    background: linear-gradient(135deg, #f0f9ff, #e8f4fe);
}

.price-card h3 {
    font-size: 16px;
    color: #374151;
    margin-bottom: 10px;
}

.price-card .price {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 15px;
}

.price-card .benefits {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.price-card .benefits li {
    font-size: 13px;
    color: #6b7280;
    padding: 5px 0;
}

.price-card button {
    margin-top: 10px;
}

.recommend-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: #f59e0b;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.data-table td {
    color: #4b5563;
}

.valid-badge {
    background: #d1fae5;
    color: #059669;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.expired-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.disabled-card {
    opacity: 0.6;
    pointer-events: none;
}

.disabled-badge {
    background: #d1d5db;
    color: #6b7280;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: block;
    margin-top: 10px;
}

.upgrade-info {
    background: #fef3c7;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: #92400e;
}

.upgrade-price {
    color: #f59e0b;
    font-weight: 600;
}

/* ========== 登录注册 ========== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    padding: 40px 20px;
}

.auth-box {
    background: #fff;
    padding: 50px 45px;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.auth-desc {
    text-align: center;
    color: #f59e0b;
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    color: #374151;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: #4f46e5;
    outline: none;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.auth-link {
    text-align: center;
    margin-top: 30px;
    color: #6b7280;
    font-size: 14px;
}

.auth-link a {
    color: #4f46e5;
    font-weight: 500;
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    max-width: 420px;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #1f2937;
}

.modal-content p {
    margin-bottom: 30px;
    color: #6b7280;
    font-size: 15px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header-container {
        padding: 8px 10px;
        flex-wrap: wrap !important;
        min-width: 0;
        gap: 10px;
    }
    
    .logo-area {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .slogan {
        display: none;
    }
    
    .nav {
        width: 100%;
        order: 3;
        justify-content: center;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding: 5px 0;
    }
    
    .nav-item {
        padding: 4px 8px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .user-area {
        width: 100%;
        order: 2;
        justify-content: center;
        gap: 6px !important;
        min-width: 0;
        margin-bottom: 5px;
    }
    
    .btn-small {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    .main {
        padding: 10px 12px;
    }
    
    /* 移动端底部优化 */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 12px;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col h4 {
        border-bottom: none;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .footer-col p {
        font-size: 12px;
        line-height: 1.5;
        margin: 0;
    }
    
    .footer-col a {
        font-size: 12px;
        padding: 4px 0;
        display: inline-block;
    }
    
    .footer-col a:not(:last-child)::after {
        content: ' |';
        color: #4b5563;
        margin: 0 6px;
    }
    
    .footer-divider {
        margin: 0 12px;
    }
    
    .footer-bottom {
        padding: 12px;
    }
    
    .footer-bottom p {
        font-size: 11px;
    }
    
    .member-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .member-info, .member-status {
        min-width: 100%;
    }
    
    .price-cards {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-card {
        min-width: 100%;
        padding: 15px;
    }
    
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .material-card {
        padding: 10px;
    }
    
    .filter-bar, .category-header {
        padding: 15px;
    }
    
    .filter-tags .tag {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 首页顶部横幅 */
.site-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 10px;
    padding: 20px 28px;
    margin-bottom: 24px;
    color: #fff;
}
.hero-tagline {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}
.hero-sub {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 14px;
}
.hero-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.hero-cat-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}
.hero-cat-btn:hover { background: rgba(255,255,255,0.28); }
.hero-total {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 8px;
}
.hero-total strong { font-size: 15px; }
@media (max-width: 480px) {
    .site-hero { padding: 14px 16px; }
    .hero-tagline { font-size: 15px; }
    .hero-cat-btn { font-size: 11px; padding: 4px 9px; }
}

/* 精选展示区 */
.showcase-section {
    margin-bottom: 30px;
}
.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}
.showcase-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}
.showcase-more {
    font-size: 14px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}
.showcase-more:hover {
    color: #4f46e5;
    text-decoration: underline;
}
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 480px) {
    .header-container {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .nav-item {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .btn-small {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}