/* ========== 起点下载站 PRO - 高端运营级主题 ========== */
:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd1;
    --accent: #00cec9;
    --accent2: #fd79a8;
    --bg: #0f0f1a;
    --bg-card: rgba(26, 26, 46, 0.9);
    --bg-card-solid: #1a1a2e;
    --text: #e0e0e0;
    --text-secondary: #888;
    --border: #2a2a4a;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ========== 粒子背景 ========== */
.particles-bg {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108,92,231,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,206,201,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(253,121,168,0.05) 0%, transparent 50%);
}

/* ========== 导航栏 ========== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.nav-container {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none;
}
.logo-icon {
    font-size: 1.5rem; color: var(--primary-light);
    animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(162,155,254,0.4)); }
    50% { filter: drop-shadow(0 0 12px rgba(162,155,254,0.8)); }
}
.logo-text {
    font-size: 1.15rem; font-weight: 700;
    background: linear-gradient(135deg, #a29bfe, #00cec9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-badge {
    font-size: 0.6rem; padding: 2px 6px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 4px; color: white; font-weight: 700;
    letter-spacing: 1px;
}
.nav-links { display: flex; gap: 20px; }
.nav-link {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.85rem; transition: var(--transition);
    padding: 6px 0;
    position: relative;
}
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px; background: var(--primary-light);
    transition: var(--transition);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }
.admin-link {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
}
.admin-link:hover {
    border-color: var(--primary-light);
    background: rgba(108,92,231,0.1);
}

/* 卡密状态 */
.card-status { flex-shrink: 0; }
.card-badge {
    padding: 7px 18px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    border: none;
}
.card-badge.active {
    background: rgba(0,206,201,0.15);
    color: var(--accent);
    cursor: default;
}
.card-badge.inactive {
    background: rgba(108,92,231,0.15);
    color: var(--primary-light);
    border: 1px solid rgba(108,92,231,0.3);
}
.card-badge.inactive:hover {
    background: rgba(108,92,231,0.25);
    transform: translateY(-1px);
}

/* ========== 公告跑马灯 ========== */
.notice-bar {
    background: rgba(108,92,231,0.08);
    border-bottom: 1px solid var(--border);
    padding: 8px 0; overflow: hidden;
    white-space: nowrap;
}
.notice-scroll {
    display: inline-block;
    animation: marquee 30s linear infinite;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.notice-item { margin: 0 16px; }
.notice-sep { color: var(--border); margin: 0 8px; }
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========== Hero 主视觉 ========== */
.hero {
    position: relative;
    padding: 80px 0 60px;
    text-align: center;
    overflow: hidden;
}
.hero-bg-shapes { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; }
.shape {
    position: absolute; border-radius: 50%;
    filter: blur(60px); opacity: 0.08;
}
.shape-1 { width: 350px; height: 350px; background: #6c5ce7; top: -80px; right: -80px; }
.shape-2 { width: 250px; height: 250px; background: #00cec9; bottom: -50px; left: -60px; }
.shape-3 { width: 200px; height: 200px; background: #fd79a8; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-content { position: relative; z-index: 1; }
.hero-title {
    font-size: 2.8rem; font-weight: 800; line-height: 1.2;
    margin-bottom: 16px;
}
.gradient-text {
    background: linear-gradient(135deg, #a29bfe, #fd79a8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--text); }
.hero-desc {
    color: var(--text-secondary); font-size: 1.05rem;
    margin-bottom: 30px;
}
.hero-stats {
    display: flex; justify-content: center; gap: 40px;
    margin-bottom: 40px;
}
.stat-item { text-align: center; }
.stat-num {
    display: block; font-size: 1.5rem; font-weight: 700;
    background: linear-gradient(135deg, #a29bfe, #00cec9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 0.8rem; color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== 搜索框 ========== */
.search-box {
    display: flex; gap: 12px; max-width: 620px; margin: 0 auto 20px;
}
.search-input-wrapper {
    flex: 1; position: relative;
    display: flex; align-items: center;
}
.search-icon {
    position: absolute; left: 16px;
    color: var(--text-secondary); pointer-events: none;
}
.search-input-wrapper input {
    width: 100%; padding: 16px 16px 16px 48px;
    background: var(--bg-card-solid);
    border: 2px solid var(--border);
    border-radius: 50px; color: var(--text);
    font-size: 1rem; outline: none;
    transition: var(--transition);
}
.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,92,231,0.12);
}
.search-box > button {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; border: none;
    border-radius: 50px; font-size: 1rem;
    font-weight: 600; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.search-box > button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108,92,231,0.4);
}
.search-box > button:active { transform: translateY(0); }
.search-tags { font-size: 0.85rem; color: var(--text-secondary); }
.search-tags a {
    color: var(--primary-light); text-decoration: none;
    margin: 0 6px; transition: var(--transition);
}
.search-tags a:hover { color: var(--accent); text-decoration: underline; }

/* ========== 特性展示 ========== */
.features { padding: 60px 0 80px; }
.section-title {
    text-align: center; font-size: 1.5rem; font-weight: 700;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #a29bfe, #00cec9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: inline-block; width: 100%;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 24px;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(108,92,231,0.15);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 14px; }
.feature-card h3 {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 8px;
}
.feature-card p {
    font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6;
}

/* ========== 搜索结果 ========== */
.results-section { padding: 0 0 60px; }
.results-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.results-header h2 { font-size: 1.3rem; }
.result-count {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white; padding: 3px 12px;
    border-radius: 20px; font-size: 0.78rem;
}
.results-list { display: flex; flex-direction: column; gap: 12px; }

.book-card {
    display: flex; gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px; cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}
.book-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(108,92,231,0.12);
}
.book-card .cover {
    width: 80px; height: 106px; border-radius: 8px;
    object-fit: cover; background: #1a1a2e; flex-shrink: 0;
}
.book-card .cover-placeholder {
    width: 80px; height: 106px; border-radius: 8px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.5rem; flex-shrink: 0;
}
.book-card .info { flex: 1; min-width: 0; }
.book-card .title {
    font-size: 1.1rem; font-weight: 600; margin-bottom: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.book-card .meta {
    display: flex; gap: 14px; font-size: 0.82rem;
    color: var(--text-secondary); margin-bottom: 8px; flex-wrap: wrap;
}
.book-card .intro {
    font-size: 0.82rem; color: #666;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.book-card .extra-info {
    display: flex; gap: 10px; font-size: 0.75rem;
    color: #555; margin-top: 6px; flex-wrap: wrap;
}

/* ========== Loading ========== */
.loading-spinner {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 40px; color: var(--text-secondary);
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-results {
    text-align: center; padding: 60px 20px;
    color: var(--text-secondary); font-size: 1.1rem;
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ========== 模态框 ========== */
.modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%; max-width: 750px; max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-small { max-width: 440px; }
.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    font-size: 1.4rem; color: #666;
    cursor: pointer; z-index: 10;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.modal-body { padding: 24px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========== 书籍详情 ========== */
.book-detail { display: flex; gap: 20px; }
.book-detail .detail-cover {
    width: 120px; height: 160px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0;
}
.book-detail .detail-cover-placeholder {
    width: 120px; height: 160px; border-radius: 10px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2rem; flex-shrink: 0;
}
.book-detail .detail-info { flex: 1; }
.book-detail .detail-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.book-detail .detail-meta {
    display: flex; gap: 14px; font-size: 0.88rem;
    color: var(--text-secondary); margin-bottom: 12px; flex-wrap: wrap;
}
.book-detail .detail-intro {
    font-size: 0.88rem; color: #777; line-height: 1.6;
    margin-bottom: 16px; max-height: 90px; overflow-y: auto;
}
.download-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.btn-primary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,92,231,0.4);
}
.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-success {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,206,201,0.4);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; justify-content: center; }

/* ========== 卡密弹窗 ========== */
.card-modal-header { text-align: center; margin-bottom: 24px; }
.card-modal-icon { font-size: 3rem; margin-bottom: 8px; }
.card-modal-header h3 { font-size: 1.2rem; margin-bottom: 4px; }
.card-modal-header p { color: var(--text-secondary); font-size: 0.85rem; }
.card-input-group { display: flex; flex-direction: column; gap: 12px; }
.card-input-group input {
    padding: 14px 18px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: 1rem;
    text-align: center; letter-spacing: 2px;
    outline: none; transition: var(--transition);
    text-transform: uppercase;
}
.card-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,92,231,0.12);
}
.card-hint {
    text-align: center; color: var(--text-secondary);
    font-size: 0.8rem; margin-top: 16px;
}

/* ========== 下载进度 ========== */
.dl-title { text-align: center; margin-bottom: 12px; }
.dl-info { text-align: center; margin-bottom: 14px; }
.dl-info p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.8; }
.progress-bar-container {
    width: 100%; height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px; overflow: hidden;
    margin: 16px 0;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe, #00cec9);
    border-radius: 5px;
    transition: width 0.4s ease;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.progress-text {
    text-align: center; font-size: 1.1rem; font-weight: 600;
    color: var(--primary-light);
}
.progress-chapter {
    text-align: center; font-size: 0.82rem;
    color: var(--text-secondary); margin-top: 6px;
}

/* ========== 章节列表 ========== */
.chapter-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.chapter-section h3 {
    font-size: 1rem; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: space-between;
}
.chapter-count { font-size: 0.82rem; color: var(--text-secondary); font-weight: normal; }
.chapter-list {
    max-height: 340px; overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0,0,0,0.15);
}
.chapter-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.84rem; cursor: pointer;
    transition: background 0.2s;
}
.chapter-item:hover { background: rgba(108,92,231,0.08); }
.chapter-item:last-child { border-bottom: none; }
.chapter-item input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary); cursor: pointer;
}
.chapter-item label { cursor: pointer; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-all-row {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(108,92,231,0.06);
    font-size: 0.84rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 1;
}
.select-all-row input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.select-all-row label { cursor: pointer; }

/* ========== Toast ========== */
.toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card-solid);
    color: var(--text);
    padding: 14px 28px; border-radius: 10px;
    font-size: 0.9rem; z-index: 2000;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ========== Footer ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 24px;
    margin-top: 40px;
}
.footer-content {
    display: flex; gap: 40px;
    flex-wrap: wrap; margin-bottom: 24px;
}
.footer-brand { flex: 1; min-width: 200px; }
.footer-logo {
    font-size: 1rem; font-weight: 700;
    background: linear-gradient(135deg, #a29bfe, #00cec9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.footer-brand p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 6px; }
.footer-links h4 { font-size: 0.9rem; margin-bottom: 10px; }
.footer-link-list { display: flex; flex-direction: column; gap: 6px; }
.footer-link-list a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.82rem; transition: var(--transition);
}
.footer-link-list a:hover { color: var(--primary-light); }
.no-links { color: #555; font-size: 0.8rem; }
.footer-info p { font-size: 0.82rem; color: #555; line-height: 1.8; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px; text-align: center;
    font-size: 0.8rem; color: #555;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .hero-title { font-size: 2rem; }
    .hero-stats { gap: 20px; }
    .search-box { flex-direction: column; }
    .search-box > button { justify-content: center; }
    .nav-links { display: none; }
    .book-card .cover, .book-card .cover-placeholder { width: 60px; height: 80px; }
    .book-detail { flex-direction: column; align-items: center; text-align: center; }
    .download-actions { justify-content: center; }
    .modal-content { width: 95%; }
    .features-grid { grid-template-columns: 1fr; }
}
