/* ============================================
   88源码网 - 前端样式（毛玻璃+深色/浅色）
   ============================================ */

:root {
    --bg-color: #f0f4f8;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --primary: #0066FF;
    --primary-hover: #0052cc;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --ad-bg: rgba(255, 255, 255, 0.8);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --ad-bg: rgba(30, 41, 59, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background 0.4s ease, color 0.3s ease;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* 装饰背景 */
.bg-blobs {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden; pointer-events: none;
}
.blob { position: absolute; width: 500px; height: 500px; filter: blur(80px); border-radius: 50%; opacity: 0.4; animation: move 20s infinite alternate; }
.blob-1 { background: #0066FF; top: -100px; right: -100px; }
.blob-2 { background: #60a5fa; bottom: -150px; left: -100px; animation-delay: -5s; }
.blob-3 { background: #93c5fd; top: 40%; left: 20%; opacity: 0.2; }
@keyframes move { from { transform: translate(0, 0); } to { transform: translate(100px, 100px); } }

/* 容器 */
.container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }

/* 导航 */
header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}
.nav-wrap { height: 70px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--primary); text-decoration: none; }
.nav-menu { display: flex; gap: 24px; flex-wrap: wrap; }
.nav-menu a { font-size: 13px; font-weight: 600; color: var(--text-sub); text-decoration: none; white-space: nowrap; }
.nav-menu a:hover { color: var(--primary); }

.right-zone { display: flex; align-items: center; gap: 15px; }
.theme-toggle { cursor: pointer; font-size: 18px; color: var(--text-sub); padding: 4px; }
.login-btn, .user-btn {
    background: var(--primary); color: #fff; padding: 7px 18px;
    border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none;
    white-space: nowrap;
}
.user-btn { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-main); }
.vip-badge { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; padding: 4px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.vip-link { font-size: 12px; color: #f59e0b; font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Flash消息 */
.flash { padding: 12px 20px; border-radius: 10px; margin-bottom: 0; font-size: 14px; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* 搜索区 */
.search-area { padding: 80px 0 40px; text-align: center; }
.search-area h1 { font-size: 42px; margin-bottom: 20px; font-weight: 800; }
.search-box {
    max-width: 700px; margin: 0 auto; display: flex;
    background: var(--glass-bg); padding: 8px; border-radius: 16px;
    backdrop-filter: blur(10px); border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}
.search-box input {
    flex: 1; background: transparent; border: none; outline: none;
    padding-left: 15px; color: var(--text-main); font-size: 16px;
}
.search-box button {
    background: var(--primary); color: #fff; border: none;
    padding: 12px 25px; border-radius: 12px; cursor: pointer; font-weight: 600;
    font-size: 15px; white-space: nowrap;
}
.search-box button:hover { background: var(--primary-hover); }

/* 文字广告 */
.text-ads-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 30px; }
.text-ad-item {
    height: 32px; background: var(--ad-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px; display: flex; align-items: center;
    padding: 0 10px; font-size: 12px; color: var(--text-sub);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    backdrop-filter: blur(5px); text-decoration: none;
}
.text-ad-item b { color: var(--primary); margin-right: 5px; }
.text-ad-item:hover { border-color: var(--primary); color: var(--text-main); }

/* 大广告 */
.large-ads-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }
.large-ad {
    height: 120px; border-radius: 16px; overflow: hidden;
    background: #000; position: relative; display: block; text-decoration: none;
}
.large-ad img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: 0.5s; }
.large-ad:hover img { transform: scale(1.05); opacity: 0.5; }
.large-ad span {
    position: absolute; bottom: 20px; left: 20px; color: #fff;
    font-weight: 700; font-size: 18px; text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* 区块标题 */
.section-title { font-size: 20px; font-weight: 800; margin-bottom: 25px; display: flex; align-items: center; gap: 10px; }

/* 资源卡片网格 */
.resource-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }

/* 卡片 */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px; overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}
.card:hover { transform: translateY(-8px); border-color: var(--primary); }
.card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-info { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; height: 42px; overflow: hidden; }
.card-desc { font-size: 12px; color: var(--text-sub); margin-bottom: 15px; height: 34px; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-sub); border-top: 1px solid var(--glass-border); padding-top: 10px; gap: 6px; flex-wrap: wrap; }

/* 友情链接 */
.links-box { margin: 50px 0; padding: 25px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; backdrop-filter: blur(10px); }
.links-flex { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 15px; }
.links-flex a { font-size: 13px; color: var(--text-sub); text-decoration: none; }
.links-flex a:hover { color: var(--primary); }

/* 详情内容 */
.detail-body { word-break: break-word; }
.detail-body img { max-width: 100%; border-radius: 8px; }
.detail-body pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.detail-body code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
[data-theme="dark"] .detail-body code { background: rgba(255,255,255,0.1); }

/* 页脚 */
footer { padding: 60px 0 30px; text-align: center; border-top: 1px solid var(--glass-border); background: var(--glass-bg); margin-top: 40px; }
.icp { font-size: 12px; color: var(--text-sub); margin-top: 15px; }

/* 响应式 */
@media (max-width: 1024px) {
    .text-ads-grid { grid-template-columns: repeat(3, 1fr); }
    .resource-grid { grid-template-columns: repeat(2, 1fr); }
}
/* 详情页英雄区 */
.detail-hero { box-shadow: var(--card-shadow); }
.btn-download:hover, .btn-pay:hover { opacity: 0.9; transform: translateY(-1px); transition: all .2s; }

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .search-area h1 { font-size: 28px; }
    .text-ads-grid { grid-template-columns: repeat(2, 1fr); }
    .large-ads-grid { grid-template-columns: 1fr; }
    .resource-grid { grid-template-columns: 1fr; }
    .detail-hero { flex-direction: column; align-items: center; }
    .detail-hero > div:first-child { width: 200px !important; height: 200px !important; }
}
