/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1d24;
  --sub: #6b7280;
  --line: #e8eaed;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============ 布局 ============ */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ============ 页头 ============ */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.logo span { color: var(--sub); font-size: 13px; font-weight: 400; margin-left: 10px; letter-spacing: 0; vertical-align: baseline; }
.nav-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-link:hover { color: var(--accent); }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-form input {
  width: 260px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); font-size: 13px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.search-form input:focus { border-color: var(--accent); }
.search-form input::placeholder { color: #9ca3af; }
.search-form button {
  height: 38px; padding: 0 18px; border: none;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: background .2s;
}
.search-form button:hover { background: var(--accent-hover); }
.search-empty { text-align: center; color: var(--sub); padding: 60px 20px; grid-column: 1 / -1; }

/* ============ 首页 Hero ============ */
.hero { text-align: center; padding: 72px 20px 48px; }
.hero h1 { font-size: 38px; line-height: 1.25; letter-spacing: -.5px; margin-bottom: 16px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--sub); font-size: 16px; max-width: 560px; margin: 0 auto; }

/* ============ 首页三块 ============ */
.home-block { margin-bottom: 56px; }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.block-title { display: flex; align-items: center; gap: 12px; }
.block-title .cat-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; margin: 0; }
.cat-icon.c1 { background: #eef2ff; color: #6366f1; }
.cat-icon.c2 { background: #ecfdf5; color: #10b981; }
.cat-icon.c3 { background: #fff7ed; color: #f97316; }
.block-title h2 { font-size: 21px; letter-spacing: -.3px; }
.block-count { font-size: 13px; color: var(--sub); }
.block-more { color: var(--accent); font-size: 14px; font-weight: 600; }
.block-more:hover { color: var(--accent-hover); }
.home-grid { padding: 0; }
.home-grid .item-thumb { aspect-ratio: 16/9; font-size: 34px; }

/* ============ 页标题 ============ */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: 30px; letter-spacing: -.4px; }
.page-head p { color: var(--sub); font-size: 15px; margin-top: 8px; }

/* ============ 筛选条 ============ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 24px 0 8px; }
.filters a {
  padding: 7px 16px; border-radius: 20px; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--sub);
}
.filters a.active, .filters a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============ 资源网格 ============ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px 0 72px; }
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.item:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.item-thumb {
  aspect-ratio: 16/10; background: linear-gradient(135deg, #eef2ff, #f3f4f6);
  display: grid; place-items: center; color: #a5b4fc; font-size: 40px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.item:hover .item-thumb img { transform: scale(1.04); }
.item-body { padding: 18px 20px; }
.item-tag {
  display: inline-block; font-size: 12px; color: var(--accent);
  background: #eef2ff; padding: 2px 10px; border-radius: 12px; margin-bottom: 10px;
}
.item-body h3 { font-size: 16px; margin-bottom: 6px; }
.item-body p { font-size: 13px; color: var(--sub); margin-bottom: 16px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: #fff; transition: background .2s;
}
.btn:hover { background: var(--accent-hover); }
.btn.sm { padding: 8px 18px; font-size: 13px; }
.btn.ghost { background: #f3f4f6; color: var(--text); }
.btn.ghost:hover { background: #e5e7eb; }
.item-foot { display: flex; align-items: center; justify-content: space-between; }
.item-meta { font-size: 12px; color: #9ca3af; }

/* ============ 详情页 ============ */
.detail { padding: 40px 0 80px; }
.crumb { font-size: 13px; color: var(--sub); margin-bottom: 24px; }
.crumb a:hover { color: var(--accent); }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
.detail-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.detail-main h1 { font-size: 26px; margin-bottom: 12px; }
.detail-meta { font-size: 13px; color: var(--sub); margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-cover {
  aspect-ratio: 16/9; background: linear-gradient(135deg, #eef2ff, #f3f4f6);
  border-radius: 10px; display: grid; place-items: center; color: #a5b4fc; font-size: 64px;
  margin-bottom: 24px; overflow: hidden;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-section { margin-bottom: 24px; }
.detail-section h2 { font-size: 17px; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid var(--accent); }
.detail-section p, .detail-section li { font-size: 14px; color: #4b5563; line-height: 1.9; }
.detail-section ul { padding-left: 20px; }
.screens { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.screen {
  aspect-ratio: 16/10; background: #f3f4f6; border: 1px solid var(--line);
  border-radius: 8px; display: grid; place-items: center; color: #cbd5e1; font-size: 14px;
}
.side { position: sticky; top: 88px; align-self: start; }
.download-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.download-card h3 { font-size: 16px; margin-bottom: 6px; }
.download-card .tip { font-size: 12px; color: var(--sub); margin-bottom: 20px; }
.download-card .btn { width: 100%; margin-bottom: 12px; }
.code-box {
  background: #f3f4f6; border: 1px dashed var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 14px; letter-spacing: 1px; word-break: break-all;
  margin-top: 8px;
}
.notice { font-size: 12px; color: #9ca3af; line-height: 1.7; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ============ 页脚 ============ */
footer {
  background: var(--card); border-top: 1px solid var(--line);
  padding: 28px 20px; text-align: center; color: var(--sub); font-size: 13px;
}
footer a, footer a:hover { color: inherit; text-decoration: none; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .cats, .grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 600px) {
  .hero { padding: 48px 16px 32px; }
  .hero h1 { font-size: 28px; }
  .cats, .grid { grid-template-columns: 1fr; }
  .search-form input { width: 150px; }
  .search-form button { padding: 0 12px; }
  .screens { grid-template-columns: 1fr; }
}
