/* ============================================
   Frontend CSS - 前端公共 + 页面样式
   ============================================ */

/* === Design Tokens === */
:root {
    --primary: #4f6ef7;
    --primary-light: #eef2ff;
    --success: #34d399;
    --success-bg: #ecfdf5;
    --danger: #f43f5e;
    --danger-bg: #fff1f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border: #f5f5f5;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --header-height: 54px;
}

/* === Reset & Base === */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* === Buttons === */
.btn-baidu {
    background: linear-gradient(135deg, #06a7ff 0%, #0176ff 100%);
    color: #fff;
    border: none;
    font-weight: 500;
}

.btn-baidu:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-quark {
    background: linear-gradient(135deg, #ff6a00 0%, #ff3d00 100%);
    color: #fff;
    border: none;
    font-weight: 500;
}

.btn-quark:hover {
    opacity: 0.9;
    color: #fff;
}

/* === Header === */
.site-header {
    background: var(--bg-card);
    height: var(--header-height);
    padding: 0 16px 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.site-header .header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.site-header .logo {
    height: 30px;
}
.site-header .logo img{
    height: 100%;
}


.site-header .header-icon {
    color: var(--primary);
    font-size: 22px;
}

.site-header .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* === Footer === */
.copyright {
    text-align: center;
    margin-top: auto;
    font-size: 11px;
    color: var(--text-muted);
}

/* === Cards === */
.section-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.section-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Notice === */
.notice-bar {
    background: var(--warning-bg);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === Tags === */
.tag-free,
.rec-tag-free {
    background: var(--success-bg);
    color: var(--success);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
}

.tag-paid,
.rec-tag-paid {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
}

/* === Search === */
.search-wrap {
    padding: 0 0 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    border-radius: 8px;
    padding-left: 44px;
    height: 40px;
    border: 1px solid var(--bg-card);
    background: var(--bg-card);
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1) !important;
}

.search-icon {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--text-muted);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 42px;
}

/* === Utilities === */
.hidden {
    display: none;
}

/* === Recommend === */
.recommend-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fire-icon {
    color: #f59e0b;
}

.recommend-list {
    font-size: 13px;
}

.rec-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.15s;
}

.rec-item:last-child {
    border-bottom: none;
}

.rec-item:hover {
    opacity: 0.8;
}

.rec-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.rec-item-tag {
    margin-left: 10px;
    flex-shrink: 0;
}

.rec-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
}

/* ============================================
   Index / List Page
   ============================================ */
.page-index {
    height: 100%;
    overflow: hidden;
}

.main-wrap {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.side-nav {
    width: 88px;
    background: var(--bg-card);
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-flow: column;
    justify-content: center;
}

.side-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    font-size: 11px;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    gap: 4px;
}

.side-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.side-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.side-nav a i {
    font-size: 20px;
}

.content-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    height: 100%;
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    border-top-left-radius: 15px;
}

.res-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    color: inherit;
    text-decoration: none;
    border: 1px solid transparent;
}

.res-card .res-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.res-card .res-icon i {
    font-size: 18px;
    color: var(--primary);
}

.res-card .res-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.res-card .res-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.res-card .res-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-size: 300;
    gap: 6px;
}

.res-card-row {
    display: flex;
    align-items: center;
}

.res-arrow {
    color: var(--border);
    margin-left: 8px;
    font-size: 14px;
}

.load-more {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .side-nav {
        width: 64px;
    }

    .side-nav a {
        padding: 10px 4px;
        font-size: 10px;
    }

    .side-nav a i {
        font-size: 18px;
    }

    .content-area {
        padding: 12px;
    }

    .res-card {
        padding: 14px;
    }
}

/* ============================================
   Detail Page
   ============================================ */
.page-detail {
    background-color: var(--bg-body);
}
.page-detail .copyright {
    padding-bottom: 12px;
}
.detail-header {
    background: var(--bg-card);
    height: var(--header-height);
    padding: 0 16px 0 12px;
    width: 100%;
    position: sticky;
    margin: 0 auto;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.detail-header .header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.detail-header a {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.detail-header a:hover {
    color: var(--primary);
}

.detail-header h1 {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    flex: 1;
    margin: 0;
}

.detail-wrap {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 14px;
    flex: 1;
}

.info-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.info-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.info-icon i {
    font-size: 22px;
    color: var(--primary);
}

.info-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.info-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.info-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.info-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
    line-height: 1;
}

.info-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cover-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

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

.share-btn {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.7;
}

.preview-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.preview-img {
    height: 120px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.preview-img:hover {
    transform: scale(1.02);
}

.content-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.download-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.download-section .hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.download-section .layui-btn {
    width: 100%;
    height: 46px;
    line-height: 46px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
    margin-left: 0 !important;
}

.download-section .layui-btn:last-child {
    margin-bottom: 0;
}

.pay-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 12px;
    text-align: center;
}

.pay-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--danger);
    margin-bottom: 4px;
}

.pay-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card-input-wrap {
    text-align: left;
    margin-bottom: 14px;
}

.input-rounded {
    border-radius: var(--radius-sm);
    height: 42px;
    border: 1px solid var(--border);
}

.input-rounded:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.btn-unlock {
    width: 100%;
    height: 46px;
    line-height: 46px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.pay-contact {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.btn-no-ml {
    margin-left: 0;
}

.btn-paid-link {
    width: 100%;
    height: 44px;
    line-height: 44px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-weight: 500;
}

.tips-card {
    background: var(--warning-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #fde68a33;
}

.tips-card p {
    font-size: 13px;
    color: #92400e;
    margin-bottom: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tips-card ul {
    font-size: 12px;
    color: #a16207;
    padding-left: 18px;
    margin: 0;
}

.tips-card ul li {
    margin-bottom: 3px;
    list-style: disc;
    line-height: 1.6;
}

.paid-links {
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    display: none;
    text-align: center;
}

.paid-links p {
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.qrcode-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    margin-bottom: 12px;
    text-align: center;
    display: none;
    border: 1px solid var(--border);
}

.qrcode-section .qr-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.qrcode-section .qr-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.qrcode-section .qr-tip-bottom {
    font-size: 11px;
    color: var(--text-muted);
}

.qr-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-only {
    display: none;
}

.breadcrumb {
    padding: 12px 16px;
    font-size: 12px;
    color: #8896a4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 300;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    gap: 4px;
}
.breadcrumb a {
    color: #4361ee;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    margin: 0 2px;
    color: #c0c8d0;
}
.breadcrumb .current {
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}