/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

li {
    list-style: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f8fbff;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 容器和布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.header-tools {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 导航栏样式 */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-menu--right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
}

.nav-link:hover {
    background-color: #e8f4fd;
    color: #667eea;
}

/* 下拉菜单 */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8fbff;
    color: #667eea;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    max-width: 300px;
    background-color: #f8fbff;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid #e8f4fd;
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: #667eea;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
}

.search-btn {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #5a67d8;
}

/* 内容区域样式 */
.page-header {
    text-align: center;
    margin: 2rem 0;
}

.page-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 300;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* 文件列表样式 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.file-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8f4fd;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.file-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #f0f8ff;
}

.file-info {
    padding: 1.25rem;
}

.file-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.file-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.file-title a:hover {
    color: #667eea;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #718096;
}

.file-date {
    background-color: #f0f8ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.file-summary {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #2c3e50;
    border: 1px solid #e8f4fd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* 内容页样式 */
.content-header {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.content-body {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    line-height: 1.8;
}

/* 文章正文中的标题样式 */
.content-body h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8f4fd;
    line-height: 1.4;
}

.content-body h2:first-child {
    margin-top: 0;
}

.content-body h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    line-height: 1.4;
    position: relative;
    padding-left: 1rem;
}

.content-body h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.content-body h2:first-child,
.content-body h3:first-child {
    margin-top: 0;
}

/* 文章正文中的段落和列表样式 */
.content-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.content-body ul,
.content-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-body li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* 文章正文中的代码块样式 */
.content-body pre {
    background-color: #f8f9ff;
    border: 1px solid #e8f4fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #2c3e50;
    position: relative;
}

.content-body pre:before {
    content: 'CODE';
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: #718096;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.content-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
}

/* 行内代码样式 */
.content-body code {
    background-color: #f0f8ff;
    color: #667eea;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #e8f4fd;
}

/* 底部样式 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-copyright {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2c3e50;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background-color: #f0f8ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .navbar {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .nav-content {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 60px;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 0;
        border-radius: 8px;
        margin-top: 0.5rem;
        z-index: 1000;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f8ff;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 0.5rem 1rem;
        color: #2c3e50;
        text-decoration: none;
        border-radius: 0;
        transition: background-color 0.3s ease;
        border-bottom: none;
        font-size: 0.95rem;
        line-height: 1.2;
    }
    
    .nav-link:hover {
        background-color: #f0f8ff;
    }
    
    .dropdown {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        background-color: #f8fbff;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        border: 1px solid #e8f4fd;
        margin-top: 0.2rem;
    }

    .dropdown.show {
        opacity: 1;
        visibility: visible;
        max-height: 300px;
        overflow: visible;
    }
    
    .dropdown-item {
        display: block;
        padding: 0.6rem 1.5rem;
        color: #555;
        text-decoration: none;
        border-bottom: 1px solid #e8f4fd;
        transition: background-color 0.3s ease;
        font-size: 0.9rem;
    }
    
    .dropdown-item:hover {
        background-color: #e8f4fd;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* 首页分类卡片样式 */
.category-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    border: 1px solid #f0f8ff;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    border-color: #e8f4fd;
}

.category-card .category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.category-card .category-title {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.category-card .category-description {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* 分类展示区域样式 */
.category-section {
    margin-top: 4rem;
}

.category-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.category-section .section-title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 300;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-section .view-more-btn {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-section .view-more-btn:hover {
    background-color: #667eea;
    color: white;
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        right: 15px;
        font-size: 1.4rem;
        padding: 0.4rem;
    }
    
    .nav-menu {
        margin-top: 0.3rem;
        padding: 0;
    }
    
    .nav-link {
        padding: 0.45rem 0.8rem;
        font-size: 0.9rem;
        line-height: 1.1;
    }
    
    .dropdown-item {
        padding: 0.4rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .file-info {
        padding: 1rem;
    }
    
    .content-header,
    .content-body {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .content-title {
        font-size: 1.5rem;
    }
}

/* 登录页面专用样式 */
.login-form-container {
    max-width: 500px;
    margin: 2rem auto;
}

.login-form-container input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.login-form-container input:invalid {
    border-color: #e74c3c;
}

.login-form-container input:valid {
    border-color: #27ae60;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.third-party-login-btn {
    transition: all 0.3s ease;
}

.third-party-login-btn:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

/* 用户信息页面专用样式 */
.profile-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.profile-form input:focus,
.profile-form textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.profile-form input[readonly] {
    background-color: #f8fbff;
    color: #718096;
    cursor: not-allowed;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.user-stat-card {
    text-align: center;
    padding: 1rem;
    border: 1px solid #e8f4fd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-stat-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.account-overview-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.account-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

/* 导航栏用户信息样式 */
#userNavItem .nav-link {
    font-weight: 600;
    color: #667eea;
}

#userNavItem .dropdown {
    min-width: 150px;
}

#loginNavItem .nav-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

#loginNavItem .nav-link:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .login-form-container {
        margin: 1rem;
    }
    
    .profile-section {
        padding: 1.5rem;
    }
    
    .user-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .account-overview-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        margin: 0.5rem;
    }
    
    .profile-section {
        padding: 1rem;
    }
    
    .user-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 已购买文章列表专用样式 */
.purchased-article-item {
    border: 1px solid #e8f4fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.purchased-article-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.purchased-article-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.purchased-article-title {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.purchased-article-title:hover {
    color: #667eea;
}

.purchased-article-price {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.purchased-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.purchased-article-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.purchased-article-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.purchased-article-btn--primary {
    background-color: #667eea;
    color: white;
}

.purchased-article-btn--primary:hover {
    background-color: #5a67d8;
}

.purchased-article-btn--success {
    background-color: #48bb78;
    color: white;
}

.purchased-article-btn--success:hover {
    background-color: #38a169;
}

.purchase-statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.purchase-stat-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
}

.purchase-stat-item--primary {
    background: #f0f8ff;
}

.purchase-stat-item--success {
    background: #f0fff0;
}

.purchase-stat-item--warning {
    background: #fff8f0;
}

.purchase-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.purchase-stat-value--primary {
    color: #667eea;
}

.purchase-stat-value--success {
    color: #48bb78;
}

.purchase-stat-value--warning {
    color: #ff9800;
}

.purchase-stat-label {
    color: #718096;
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .purchased-article-item {
        padding: 0.75rem;
    }
    
    .purchased-article-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .purchased-article-title {
        font-size: 1rem;
    }
    
    .purchased-article-meta {
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .purchased-article-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .purchased-article-btn {
        justify-content: center;
        padding: 0.5rem 1rem;
    }
    
    .purchase-statistics {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .purchase-stat-item {
        padding: 0.5rem;
    }
    
    .purchase-stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .purchased-article-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .purchase-statistics {
        grid-template-columns: 1fr;
    }
}

/* 会员状态动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 4px 15px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 4px 20px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 4px 15px rgba(255, 215, 0, 0.2);
    }
}

/* 会员状态卡片特殊样式 */
.membership-card-glow {
    position: relative;
    overflow: hidden;
}

.membership-card-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: sweep 3s ease-in-out infinite;
}

@keyframes sweep {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
    100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
}