/* 响应式设计 - 小说栈 */

/* 超大屏幕 (≥1400px) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 大屏幕 (≥1200px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕 (≥992px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板 (≥768px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .reader-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .toolbar-left, .toolbar-right {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* 手机 (≥576px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    .novel-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .reader-content {
        padding: 20px;
        font-size: 1rem;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
}

/* 小手机 (<576px) */
@media (max-width: 575px) {
    .container {
        padding: 0 10px;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .feature-card, .novel-card {
        padding: 20px;
    }
    
    .reader-container {
        padding: 10px;
    }
    
    .reader-content {
        padding: 15px;
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .reader-content p {
        text-indent: 1.5em;
        margin-bottom: 1em;
    }
    
    .paid-features {
        flex-direction: column;
        align-items: center;
    }
    
    .wallet-info {
        flex-direction: column;
        text-align: center;
    }
    
    .chapter-actions {
        flex-direction: column;
    }
    
    .chapter-actions .btn {
        width: 100%;
    }
    
    .comments-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .menu-item {
        flex: 0 0 auto;
    }
    
    .menu-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 15px;
        white-space: nowrap;
    }
    
    .menu-link:hover, .menu-link.active {
        border-left-color: transparent;
        border-bottom-color: #667eea;
    }
    
    .works-table {
        display: block;
        overflow-x: auto;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}

/* 超小屏幕处理 */
@media (max-width: 400px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-section {
        text-align: center;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 40px 0;
    }
    
    .auth-container {
        margin: 30px auto;
    }
    
    .reader-header {
        position: static;
    }
    
    .sidebar {
        height: auto;
        max-height: 300px;
        overflow-y: auto;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .btn, .form-control, .card {
        border-width: 0.5px;
    }
}

/* 打印样式 */
@media print {
    .header, .footer, .reader-toolbar, .comments-section, .paid-chapter {
        display: none;
    }
    
    .reader-content {
        box-shadow: none;
        padding: 0;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a202c;
        --card-bg: #2d3748;
        --text-color: #e2e8f0;
        --text-light: #a0aec0;
        --border-color: #4a5568;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .card, .reader-content, .auth-card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .form-control {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        border-color: #667eea;
        background-color: #2d3748;
    }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .novel-card, .feature-card, .stat-card {
        transition: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --primary-dark: #0000cc;
        --text-color: #000000;
        --border-color: #000000;
    }
    
    .btn-primary {
        background: var(--primary-color);
        color: white;
        border: 2px solid black;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-btn, .action-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control, select, textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .menu-link, .footer-links a {
        padding: 12px 0;
    }
    
    /* 增大触摸目标 */
    .toolbar-btn, .font-size-btn, .theme-btn {
        min-width: 44px;
        min-height: 44px;
    }
}/* ===== 增强三栏布局效果 ===== */
.three-pillars {
    gap: 40px !important;  /* 增加间距 */
    margin: 60px auto 80px !important;
    max-width: 1200px;
}

.pillar {
    border-radius: 20px !important;  /* 增加圆角 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;  /* 增强阴影 */
    min-height: 420px;  /* 统一最小高度 */
    display: flex;
    flex-direction: column;
    padding: 30px !important;  /* 增加内边距 */
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pillar:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
}

/* 彩色边框效果 */
.three-pillars .pillar:nth-child(1) {
    border-color: #667eea;
}

.three-pillars .pillar:nth-child(2) {
    border-color: #764ba2;
}

.three-pillars .pillar:nth-child(3) {
    border-color: #48bb78;
}

/* 按钮底部对齐 */
.pillar a.btn {
    margin-top: auto !important;
    align-self: flex-start;
    margin-top: 20px !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600;
}

/* 图标样式优化 */
.pillar h3 i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
}

.pillar h3 {
    font-size: 1.8rem !important;
    margin-bottom: 25px !important;
    color: #2d3748;
}

.pillar p {
    line-height: 1.7;
    font-size: 1.05rem;
    color: #4a5568;
    flex-grow: 1;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .three-pillars {
        gap: 30px;
        margin: 40px auto 60px;
    }
    
    .pillar {
        min-height: 380px;
        padding: 25px !important;
    }
    
    .pillar h3 {
        font-size: 1.6rem !important;
    }
}
/* ===== 增强三栏布局效果 ===== */
.three-pillars {
    gap: 40px !important;  /* 增加间距 */
    margin: 60px auto 80px !important;
    max-width: 1200px;
}

.pillar {
    border-radius: 20px !important;  /* 增加圆角 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;  /* 增强阴影 */
    min-height: 420px;  /* 统一最小高度 */
    display: flex;
    flex-direction: column;
    padding: 30px !important;  /* 增加内边距 */
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pillar:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
}

/* 彩色边框效果 */
.three-pillars .pillar:nth-child(1) {
    border-color: #667eea;
}

.three-pillars .pillar:nth-child(2) {
    border-color: #764ba2;
}

.three-pillars .pillar:nth-child(3) {
    border-color: #48bb78;
}

/* 按钮底部对齐 */
.pillar a.btn {
    margin-top: auto !important;
    align-self: flex-start;
    margin-top: 20px !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600;
}

/* 图标样式优化 */
.pillar h3 i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
}

.pillar h3 {
    font-size: 1.8rem !important;
    margin-bottom: 25px !important;
    color: #2d3748;
}

.pillar p {
    line-height: 1.7;
    font-size: 1.05rem;
    color: #4a5568;
    flex-grow: 1;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .three-pillars {
        gap: 30px;
        margin: 40px auto 60px;
    }
    
    .pillar {
        min-height: 380px;
        padding: 25px !important;
    }
    
    .pillar h3 {
        font-size: 1.6rem !important;
    }
}
