/* 美术博客素材 · 静态站点主题：黑白灰扁平 + Emoji 图标 */
:root {
  --bg: #f6f6f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e2;
  --line-strong: #c9c9c7;
  --accent: #111111;
  --hover: #ededeb;
  --radius: 10px;
  --maxw: 1200px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 24px; padding: 14px 24px;
}
.brand { font-weight: 600; font-size: 16px; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px;
  color: var(--muted);
}
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav .dropdown { position: relative; }
.nav .dropdown > button {
  background: none; border: none; padding: 6px 12px; border-radius: 999px;
  font-size: 13.5px; color: var(--muted); cursor: pointer; font: inherit;
}
.nav .dropdown > button:hover { background: var(--hover); color: var(--text); }
.nav .dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--shadow);
}
.nav .dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; color: var(--text); }
.dropdown-menu a:hover { background: var(--hover); text-decoration: none; }

.search-box { flex: 1; display: flex; justify-content: flex-end; }
.search-box input {
  width: 220px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); font: inherit; color: var(--text);
}
.search-box input:focus { outline: none; background: var(--surface); border-color: var(--line-strong); }

main { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 80px; }

/* ── Hero ───────────────────────────────── */
.hero { margin-bottom: 36px; }
.hero h1 { font-size: 28px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.5px; }
.hero .sub { color: var(--muted); font-size: 14px; }

/* ── Section headers ────────────────────── */
.section { margin: 36px 0; }
.section h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }

/* ── Category Grid ──────────────────────── */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; display: block; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.cat-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.cat-card .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.cat-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.cat-card .desc { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.cat-card .count { font-size: 12px; color: var(--muted); }

/* ── Tag Wall ────────────────────────────── */
.h2-sub { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }

/* 外层折叠：整面标签墙默认收起 */
.tag-wall-outer {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.tag-wall-outer > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 15px 18px;
  transition: background .12s;
}
.tag-wall-outer > summary:hover { background: var(--hover); }
.tag-wall-outer > summary::-webkit-details-marker { display: none; }
.tag-wall-outer > summary::before {
  content: "▸"; display: inline-block; align-self: center;
  color: var(--muted); font-size: 13px; transition: transform .15s;
}
.tag-wall-outer[open] > summary::before { transform: rotate(90deg); }
.tag-wall-outer .tw-title { font-size: 17px; font-weight: 700; }

/* 内层手风琴：每个分组一行，默认只展开第一组 */
.tag-wall {
  display: flex; flex-direction: column; gap: 10px;
  padding: 2px 18px 18px;
}
.tag-group {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.tag-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius);
  transition: background .12s;
}
.tag-group > summary:hover { background: var(--hover); }
.tag-group > summary::-webkit-details-marker { display: none; }
.tag-group > summary::before {
  content: "▸"; display: inline-block;
  color: var(--muted); font-size: 11px; transition: transform .15s;
}
.tag-group[open] > summary::before { transform: rotate(90deg); }
.tag-group .g-count {
  font-size: 11px; font-weight: 500; color: var(--muted);
  background: var(--hover); padding: 0 7px; border-radius: 999px;
}
.tag-group .tag-chips { padding: 2px 16px 16px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; background: var(--bg);
  transition: border-color .12s, background .12s;
}
.tag-chip:hover { border-color: var(--accent); background: var(--hover); text-decoration: none; }
.tag-chip .n { font-size: 10.5px; color: var(--muted); }

/* ── Post Grid ──────────────────────────── */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
}
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: block; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.post-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.post-card .cover {
  aspect-ratio: 4/3; background: var(--bg) center/cover no-repeat;
  background-color: #eee;
  border-bottom: 1px solid var(--line);
}
.post-card .body { padding: 12px 14px 16px; }
.post-card .meta { display: flex; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.post-card .meta .cat { background: var(--hover); padding: 1px 8px; border-radius: 999px; }
.post-card h4 { font-size: 14.5px; font-weight: 600; margin: 0 0 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .date { font-size: 11.5px; color: var(--muted); }

/* ── List view (category / search) ──────── */
.list-row {
  display: grid; grid-template-columns: 100px 1fr auto; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line); align-items: center;
}
.list-row .thumb { aspect-ratio: 1/1; background: var(--bg) center/cover no-repeat; border-radius: 6px; border: 1px solid var(--line); }
.list-row h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.list-row .excerpt { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 4px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-row .tags { font-size: 11.5px; color: var(--muted); }
.list-row .right { font-size: 12px; color: var(--muted); white-space: nowrap; }

@media (max-width: 720px) {
  .list-row { grid-template-columns: 60px 1fr; }
  .list-row .right { display: none; }
  .search-box { display: none; }
}

/* ── Article ────────────────────────────── */
.article { max-width: 760px; margin: 0 auto; }
.article .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.article h1 { font-size: 30px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.5px; }
.en-title { color: var(--muted); font-size: 15px; font-style: italic; margin: -2px 0 10px; }
.article .meta { color: var(--muted); font-size: 13px; margin-bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.article .meta a { color: var(--muted); border-bottom: 1px dotted var(--line-strong); }
.article .cover-photo {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); margin-bottom: 24px;
  background: var(--bg) center/cover no-repeat; border: 1px solid var(--line);
}
.article .tags { margin-bottom: 32px; display: flex; flex-wrap: wrap; gap: 6px; }
.article .tags span {
  background: var(--hover); padding: 3px 10px; border-radius: 999px; font-size: 12px;
}
.article-body { font-size: 15.5px; line-height: 1.75; }
.article-body p { margin: 0 0 1em; }
.article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; }
.article-body h2 { font-size: 20px; font-weight: 600; margin: 1.8em 0 .6em; }
.article-body h3 { font-size: 17px; font-weight: 600; margin: 1.5em 0 .5em; }
.article-body blockquote {
  border-left: 3px solid var(--line-strong); margin: 1em 0; padding: 4px 14px;
  color: var(--muted); font-style: italic;
}
.article-body code { background: var(--hover); padding: 1px 6px; border-radius: 3px; font-size: 13.5px; }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* ── Search box (page) ──────────────────── */
.search-page { max-width: 760px; margin: 0 auto; }
.search-page input {
  width: 100%; padding: 12px 16px; font-size: 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.search-page input:focus { outline: none; border-color: var(--accent); }
.search-results { margin-top: 24px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ── Footer ─────────────────────────────── */
footer {
  border-top: 1px solid var(--line); padding: 24px; text-align: center;
  color: var(--muted); font-size: 12px; background: var(--surface);
}
