/* ================= DaYuZero 前台样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0f1a;
  --bg2: #111827;
  --card: #161e2e;
  --card-hover: #1c2740;
  --border: rgba(255,255,255,.08);
  --text: #e5e9f0;
  --text-dim: #94a3b8;
  --primary: #6366f1;
  --primary2: #8b5cf6;
  --accent: #22d3ee;
  --radius: 14px;
  --particle: 129,140,248;
}

/* ============ 模板主题 ============ */
/* 极光青 */
[data-theme="cyan"] {
  --bg: #071318; --bg2: #0b1e26; --card: #0e2530; --card-hover: #133342;
  --primary: #06b6d4; --primary2: #0ea5e9; --accent: #34d399;
  --particle: 103,232,249;
}
/* 翡翠绿 */
[data-theme="emerald"] {
  --bg: #08130d; --bg2: #0c1f14; --card: #10281a; --card-hover: #153524;
  --primary: #10b981; --primary2: #22c55e; --accent: #a3e635;
  --particle: 110,231,183;
}
/* 暖阳橙 */
[data-theme="sunset"] {
  --bg: #171009; --bg2: #221708; --card: #2a1d0e; --card-hover: #382713;
  --primary: #f59e0b; --primary2: #f97316; --accent: #fb7185;
  --particle: 252,211,77;
}
/* 简约亮色 */
[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #ffffff; --card: #ffffff; --card-hover: #f0f3ff;
  --border: rgba(15,23,42,.1); --text: #1e293b; --text-dim: #64748b;
  --primary: #4f46e5; --primary2: #7c3aed; --accent: #0891b2;
  --particle: 99,102,241;
}
[data-theme="light"] .nav { background: rgba(255,255,255,.8); }
[data-theme="light"] .nav .links a:hover, [data-theme="light"] .nav .links a.active { color: #1e293b; }
[data-theme="light"] .nav-search { background: rgba(15,23,42,.05); }
[data-theme="light"] .tag { background: rgba(79,70,229,.08); color: #4f46e5; border-color: rgba(79,70,229,.25); }
[data-theme="light"] .tag.cyan { background: rgba(8,145,178,.08); color: #0891b2; border-color: rgba(8,145,178,.25); }
[data-theme="light"] .card { box-shadow: 0 2px 12px rgba(15,23,42,.06); }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }

/* 粒子画布 */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* 导航 */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 5vw;
  background: rgba(11,15,26,.75); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .logo { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.nav .logo .dot {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); font-size: 18px;
}
.nav .logo img { height: 38px; width: auto; display: block; }
.nav .logo .logo-text {
  font-size: 20px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 720px) {
  .nav .logo .logo-text { font-size: 17px; }
}
@media (max-width: 720px) { .nav .logo img { height: 32px; } }
.nav .links { display: flex; gap: 26px; align-items: center; }
.nav .links a { color: var(--text-dim); font-size: 15px; transition: color .2s; position: relative; }
.nav .links a:hover, .nav .links a.active { color: #fff; }
.nav .links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 2px;
}
/* 导航搜索框 */
.nav-search {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  transition: border-color .2s, background .2s, width .2s;
}
.nav-search:focus-within { border-color: var(--primary); background: rgba(99,102,241,.1); }
.nav-search .ico { font-size: 13px; opacity: .7; }
.nav-search input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; width: 150px;
}
.nav-search input::placeholder { color: var(--text-dim); }
.nav-search input::-webkit-search-cancel-button { cursor: pointer; }
@media (max-width: 720px) {
  .nav-search input { width: 90px; }
  .nav-search input:focus { width: 130px; }
}

.btn-admin {
  padding: 8px 18px; border-radius: 999px; font-size: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff !important; transition: transform .2s, box-shadow .2s;
}
.btn-admin:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,.4); }

.wrap { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { text-align: center; padding: 90px 20px 70px; position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); font-weight: 900; line-height: 1.2;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 60%, var(--primary2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeUp .8s ease both;
}
.hero p {
  margin-top: 18px; font-size: 18px; color: var(--text-dim);
  animation: fadeUp .8s .15s ease both;
}
.hero .cta { margin-top: 34px; display: flex; gap: 16px; justify-content: center; animation: fadeUp .8s .3s ease both; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px; font-size: 16px; font-weight: 600;
  cursor: pointer; border: none; transition: transform .2s, box-shadow .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(99,102,241,.45); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-3px); }

/* 区块 */
.section { padding: 50px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.section-head h2 .bar { width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--accent)); }
.section-head a { color: var(--accent); font-size: 14px; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  opacity: 0; transform: translateY(30px);
}
.card.show { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease, box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-6px); border-color: rgba(99,102,241,.5); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.card .tool-icon { font-size: 40px; margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card .desc { color: var(--text-dim); font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: 16px; display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--text-dim); }
.tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3);
}
.tag.cyan { background: rgba(34,211,238,.12); color: #67e8f9; border-color: rgba(34,211,238,.3); }
.card .cover-img { width: calc(100% + 48px); margin: -24px -24px 16px; height: 160px; object-fit: cover; display: block; }

/* 详情页 */
.detail { padding: 50px 0 80px; }
.detail .back { color: var(--accent); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.detail-head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .tool-icon { font-size: 64px; }
.detail-head h1 { font-size: 32px; margin-bottom: 10px; }
.detail-head .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: 14px; align-items: center; }
.detail-body {
  margin-top: 34px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px; line-height: 1.9; font-size: 15.5px;
}
.detail-body h2 { margin: 26px 0 12px; font-size: 22px; }
.detail-body h3 { margin: 20px 0 10px; font-size: 18px; }
.detail-body p { margin: 10px 0; color: #cbd5e1; }
.detail-body ul, .detail-body ol { margin: 10px 0 10px 24px; color: #cbd5e1; }
.detail-body li { margin: 6px 0; }
.detail-body code { background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 6px; font-size: 14px; color: #67e8f9; }
.detail-body pre { background: #0a0e18; border: 1px solid var(--border); padding: 18px; border-radius: 10px; overflow-x: auto; margin: 14px 0; }
.detail-body pre code { background: none; padding: 0; }
.detail-body blockquote { border-left: 3px solid var(--primary); padding: 8px 18px; margin: 14px 0; background: rgba(99,102,241,.08); border-radius: 0 8px 8px 0; color: var(--text-dim); }
.detail-body img { border-radius: 10px; margin: 10px 0; }

/* 内容块（百度经验式图文视频混排） */
.content-blocks { margin: 8px 0; display: flex; flex-direction: column; gap: 22px; }
.content-blocks .cb-text { color: #cbd5e1; line-height: 1.9; font-size: 15.5px; white-space: pre-wrap; }
.content-blocks .cb-image, .content-blocks .cb-video { margin: 0; }
.content-blocks .cb-image img, .content-blocks .cb-video video {
  width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; background: #0a0e18; display: block;
}
.content-blocks figure { margin: 0; }
.content-blocks figcaption { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 8px; padding: 0 10px; }

/* 媒体播放区 */
.media-zone { margin-top: 30px; }
.media-zone h2 { font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.media-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.media-item video, .media-item img { width: 100%; display: block; }
.media-item video { background: #000; }

/* 加载动画 */
.loader { display: flex; justify-content: center; padding: 60px; }
.loader .ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(99,102,241,.2); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--text-dim); padding: 60px 20px; font-size: 15px; }

/* 分类索引栏 */
.cat-layout { display: flex; gap: 28px; align-items: flex-start; }
.cat-side {
  position: sticky; top: 90px; flex: 0 0 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 12px; z-index: 1;
}
.cat-side .cat-title { font-size: 13px; color: var(--text-dim); padding: 0 10px 10px; letter-spacing: 1px; }
.cat-side a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--text-dim);
  transition: background .15s, color .15s; cursor: pointer;
}
.cat-side a:hover { background: var(--card-hover); color: var(--text); }
.cat-side a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff;
}
.cat-side a .cnt {
  font-size: 12px; padding: 1px 8px; border-radius: 999px;
  background: rgba(127,127,127,.18);
}
.cat-side a.active .cnt { background: rgba(255,255,255,.25); }
.cat-main { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .cat-layout { flex-direction: column; }
  .cat-side {
    position: static; width: 100%; flex: none;
    display: flex; flex-wrap: wrap; gap: 6px; padding: 12px;
  }
  .cat-side .cat-title { display: none; }
  .cat-side a { padding: 7px 14px; }
  .cat-side a .cnt { margin-left: 6px; }
}

/* 页脚 */
footer {
  position: relative; z-index: 1; margin-top: 60px; padding: 34px 5vw; text-align: center;
  color: var(--text-dim); font-size: 14px; border-top: 1px solid var(--border);
}
footer a { color: var(--text-dim); text-decoration: underline; }
footer a:hover { color: var(--primary); }
footer .site-icp { display: inline-block; }

/* 统计条 */
.stats-bar { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 44px; animation: fadeUp .8s .45s ease both; }
.stat-chip {
  padding: 14px 28px; background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center; min-width: 130px;
}
.stat-chip b { display: block; font-size: 24px; background: linear-gradient(120deg, var(--accent), var(--primary2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-chip span { font-size: 13px; color: var(--text-dim); }

@media (max-width: 640px) {
  .nav .links { gap: 14px; }
  .nav .links a:not(.btn-admin) { font-size: 13px; }
  .detail-body { padding: 22px; }
}

/* 评论区 */
.comments-section h3 { font-weight: 600; }
.comments-section .comment-form input:focus,
.comments-section .comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.comments-section .comment-form button:disabled { opacity: .6; cursor: not-allowed; }
.comment-list .empty { padding: 30px 0; text-align: center; color: var(--text-dim); }
@media(max-width:640px){ .comments-section .comment-form { max-width: 100%; } }
