/* 鬼故事网站 - 暗黑仿番茄风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #121212;
    color: #e0e0e0;
    line-height: 1.6;
    padding-bottom: 60px;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* 主色调：暗黑 + 暗红点缀 */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #1e1e1e;
    --bg-hover: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #999999;
    --text-muted: #666666;
    --accent: #c62828;
    --accent-light: #ef5350;
    --border: #2a2a2a;
    --gold: #ffd700;
}

/* ========== 顶部导航 ========== */
.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.logo span {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav a:hover, .nav a.active {
    color: var(--accent-light);
}

/* ========== Banner区域 ========== */
.banner {
    background: linear-gradient(135deg, #1a0a0a 0%, #121212 50%, #0a0a1a 100%);
    padding: 40px 16px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(198, 40, 40, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.banner h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
    text-shadow: 0 0 20px rgba(198, 40, 40, 0.5);
}

.banner p {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
}

/* ========== 板块标题 ========== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 24px 0 16px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

/* ========== 分类网格 ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 8px;
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-card.hot {
    border-color: rgba(198, 40, 40, 0.3);
}

.category-card .icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.category-card .name {
    font-size: 13px;
    color: var(--text-primary);
}

/* ========== 故事列表 ========== */
.story-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.story-item {
    background: var(--bg-card);
    padding: 16px;
    transition: background 0.2s;
}

.story-item:hover {
    background: var(--bg-hover);
}

.story-item .title {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.4;
}

.story-item .desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.category-tag {
    background: rgba(198, 40, 40, 0.2);
    color: var(--accent-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* ========== 底部Tab导航（仿番茄） ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 16px;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--accent-light);
}

.tab-item .icon {
    font-size: 22px;
}

/* ========== 搜索框 ========== */
.search-box {
    margin-bottom: 20px;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--accent-light);
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ========== VIP卡片 ========== */
.vip-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 16px;
}

.vip-header {
    text-align: center;
    margin-bottom: 24px;
}

.vip-header h1 {
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 8px;
}

.vip-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.vip-card {
    background: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    text-align: center;
}

.vip-card .name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.vip-card .price {
    font-size: 36px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}

.vip-card .price span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: normal;
}

.vip-card .desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.vip-btn {
    display: inline-block;
    padding: 12px 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(198, 40, 40, 0.4);
}

.vip-btn.secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-light);
}

/* ========== 阅读页 ========== */
.reader-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 16px;
}

.reader-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.reader-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.reader-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.reader-category {
    display: inline-block;
    background: rgba(198, 40, 40, 0.2);
    color: var(--accent-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.reader-content {
    font-size: 17px;
    line-height: 2;
    color: #d0d0d0;
    text-align: justify;
}

.reader-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.reader-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.reader-nav a {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 阅读设置面板 */
.reader-settings {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 1px solid var(--border);
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transition: bottom 0.3s;
    z-index: 200;
}

.reader-settings.show {
    bottom: 0;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.setting-label {
    width: 80px;
    font-size: 14px;
    color: var(--text-secondary);
}

.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.theme-option.active {
    border-color: var(--accent);
}

.theme-dark-option {
    background: #121212;
}

.theme-green-option {
    background: #c7d5b5;
}

.theme-yellow-option {
    background: #f5e6c8;
}

.theme-paper-option {
    background: #f0e6d2;
}

.font-size-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* 阅读主题 */
.theme-green .reader-content {
    color: #333;
    background: #c7d5b5;
}

.theme-yellow .reader-content {
    color: #5c4b37;
    background: #f5e6c8;
}

.theme-paper .reader-content {
    color: #4a3f35;
    background: #f0e6d2;
}

/* ========== 底部 ========== */
.footer {
    background: #0a0a0a;
    padding: 30px 16px;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.footer .disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer .links {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer .links a {
    color: var(--text-secondary);
    margin: 0 8px;
}

.footer .beian {
    font-size: 11px;
    color: #555;
}

/* ========== 书架 ========== */
.bookshelf-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 10px;
}

.bookshelf-cover {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.bookshelf-info {
    flex: 1;
}

.bookshelf-title {
    font-size: 15px;
    color: #fff;
    margin-bottom: 6px;
}

.bookshelf-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== 抽奖转盘 ========== */
.lottery-container {
    text-align: center;
    padding: 30px 16px;
}

.lottery-wheel {
    width: 280px;
    height: 280px;
    margin: 0 auto 30px;
    position: relative;
}

.lottery-btn {
    padding: 14px 50px;
    background: linear-gradient(135deg, var(--gold), #ffb700);
    color: #121212;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.lottery-btn:hover {
    transform: scale(1.05);
}

.lottery-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 分享区域 ========== */
.share-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.share-link {
    width: 100%;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    margin-bottom: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .nav {
        display: none;
    }
    
    .banner h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
