/* ============================================================
   作品集系统 · 样式
   前台：编辑部式排版 / 后台：清晰的表单与表格
   ============================================================ */

:root {
  --ink: #16181c;
  --ink-soft: #3d4249;
  --muted: #6f757e;
  --faint: #9aa0a8;
  --line: #e5e2dc;
  --line-strong: #d3cfc6;
  --bg: #faf9f7;
  --surface: #ffffff;
  --tint: #f2efe9;
  --accent: #2c5f58;
  --accent-soft: #e6efec;
  --danger: #a63d2f;
  --danger-soft: #fbeae7;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 8px 24px rgba(20, 22, 26, 0.05);
  --shadow-lg: 0 24px 60px rgba(20, 22, 26, 0.16);
  --wrap: 1240px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--tint);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}
em { font-style: normal; }
button { font: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------- 页头 ------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 247, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 28px;
  min-height: 68px;
}

.brand { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: flex; gap: 4px; margin-right: auto; }
.site-nav a {
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 14px; color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--tint); color: var(--ink); }
.site-nav a.is-active { color: var(--ink); font-weight: 500; background: var(--tint); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-search input {
  width: 168px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 13px; color: var(--ink);
  transition: border-color 0.15s, width 0.2s;
}
.nav-search input:focus { border-color: var(--accent); outline: none; width: 210px; }

.nav-toggle {
  display: none; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 16px; height: 1.5px; background: var(--ink); display: block; }

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--tint); border-color: var(--faint); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f0d4ce; }
.btn-danger:hover { background: #f6ded9; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-xs { padding: 4px 9px; font-size: 12px; }
.btn-block { width: 100%; }

.link-more { font-size: 13px; color: var(--muted); white-space: nowrap; }
.link-more:hover { color: var(--ink); }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; letter-spacing: 0.02em;
}

.badge {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 500; line-height: 1.6;
}
.badge-live { background: var(--accent-soft); color: var(--accent); }
.badge-draft { background: #f0eee9; color: var(--muted); }
.badge-feat { background: #fdf0dd; color: #96601a; }
.badge-cover { background: rgba(22, 24, 28, 0.82); color: #fff; }

/* ------------------------------- 首屏 ------------------------------- */

.hero { padding: 72px 0 0; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { max-width: 900px; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.hero-title { font-size: clamp(38px, 6vw, 76px); letter-spacing: -0.035em; }
.hero-lead {
  margin-top: 20px; max-width: 620px;
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.75; color: var(--ink-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 48px;
  margin: 54px 0 0; padding: 0 0 44px;
}
.hero-stats dt {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.hero-stats dd { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.hero-stats dd.is-text { font-size: 15px; font-weight: 500; padding-top: 8px; }
.hero-stats dd a { border-bottom: 1px solid var(--line-strong); }

.hero-strip {
  display: flex; gap: 14px;
  height: clamp(150px, 17vw, 250px);
  padding: 0 32px 0 max(32px, calc((100vw - var(--wrap)) / 2 + 32px));
  margin-top: -8px;
}
.hero-strip-item {
  flex: 1 1 0; min-width: 0; height: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden;
  background: var(--tint);
}
.hero-strip-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-strip-item:hover img { transform: scale(1.04); }

/* ------------------------------- 通用区块 ------------------------------- */

.section { padding: 78px 0; }
.section-tint { background: var(--tint); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 34px;
}
.section-title { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; }
.section-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.page { padding: 44px 32px 96px; }
.page-head { max-width: 760px; margin-bottom: 40px; }
.page-title { font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.03em; }
.page-lead { margin-top: 16px; font-size: 17px; color: var(--ink-soft); }
.page-meta { margin-top: 14px; color: var(--faint); font-size: 13px; }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--faint); margin-bottom: 26px;
}
.crumbs a:hover { color: var(--ink); }
.crumbs .is-current { color: var(--ink-soft); }

/* ------------------------------- 分类 ------------------------------- */

.category-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.category-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.category-card:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px);
}
.category-card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.category-card-media img { width: 100%; height: 100%; object-fit: cover; }
.category-card-blank {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #f4f1ec 0 12px, #eeebe5 12px 24px);
}
.category-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.category-card-body h3 { font-size: 18px; }
.category-card-body p { color: var(--muted); font-size: 13.5px; margin: 0; }
.category-card-count {
  margin-top: auto; padding-top: 14px;
  font-size: 12px; color: var(--faint); letter-spacing: 0.04em;
}

/* ------------------------------- 作品卡片 ------------------------------- */

.work-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.work-card { display: flex; flex-direction: column; gap: 14px; }
.work-card-media {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--tint);
  aspect-ratio: 4 / 3;
}
.work-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-card:hover .work-card-media img { transform: scale(1.045); }
.work-card-media .badge { position: absolute; top: 12px; left: 12px; }
.work-card-body { display: flex; flex-direction: column; gap: 6px; }
.work-card-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.work-card:hover .work-card-title { text-decoration: underline; text-underline-offset: 3px; }
.work-card-summary { font-size: 13.5px; color: var(--muted); }
.work-card-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; font-size: 12px; color: var(--faint); }

/* ------------------------------- 作品行列表 ------------------------------- */

.work-list { border-top: 1px solid var(--line); }
.work-row a {
  display: grid; grid-template-columns: 92px 1fr auto;
  align-items: center; gap: 22px;
  padding: 18px 4px; border-bottom: 1px solid var(--line);
  transition: background 0.15s, padding 0.15s;
}
.work-row a:hover { background: rgba(0, 0, 0, 0.015); padding-left: 10px; padding-right: 10px; }
.work-row-thumb {
  display: block; width: 92px; aspect-ratio: 4 / 3;
  overflow: hidden; border-radius: var(--radius); background: var(--tint);
}
.work-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.work-row-title { font-weight: 500; }
.work-row-summary { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-row-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--faint); }

/* ------------------------------- 筛选栏 ------------------------------- */

.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 22px; margin-bottom: 34px; border-bottom: 1px solid var(--line);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--ink-soft);
  transition: all 0.15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-count { font-size: 11px; color: var(--faint); }
.chip.is-active .chip-count { color: rgba(255, 255, 255, 0.65); }
.filter-search { display: flex; gap: 8px; }
.filter-search input {
  width: 260px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 13px;
}
.filter-search input:focus { border-color: var(--accent); outline: none; }

/* ------------------------------- 作品详情 ------------------------------- */

.work-detail { padding: 40px 0 40px; }
.work-detail-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px; padding-bottom: 44px; border-bottom: 1px solid var(--line);
}
.work-detail-title { font-size: clamp(30px, 4.4vw, 54px); letter-spacing: -0.03em; }
.work-detail-summary { margin-top: 20px; font-size: 18px; line-height: 1.7; color: var(--ink-soft); max-width: 680px; }

.work-meta { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.work-meta dt {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 4px;
}
.work-meta dd { margin: 0; font-size: 14px; }
.work-meta a { border-bottom: 1px solid var(--line-strong); }
.work-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 10px; border-radius: 999px;
  background: var(--tint); font-size: 12px; color: var(--ink-soft);
}
.tag:hover { background: var(--accent-soft); color: var(--accent); }

.work-gallery {
  display: flex; flex-direction: column; gap: 18px;
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 44px 32px;
}
.gallery-item { margin: 0; }
.gallery-item.is-lead { margin-bottom: 12px; }
.gallery-button {
  display: block; width: 100%; padding: 0; border: 0; background: var(--tint);
  border-radius: var(--radius-lg); overflow: hidden; cursor: zoom-in;
}
.gallery-item img { width: 100%; height: auto; }
.gallery-item figcaption {
  margin-top: 10px; font-size: 13px; color: var(--muted);
  padding-left: 2px;
}
.work-no-media {
  padding: 40px; text-align: center; color: var(--muted);
  background: var(--tint); border-radius: var(--radius-lg); margin-bottom: 32px;
}

.work-description { max-width: 760px; margin: 8px 0 56px; font-size: 16px; line-height: 1.85; color: var(--ink-soft); }

.prose h2 { margin: 1.8em 0 0.6em; font-size: 24px; color: var(--ink); }
.prose h3 { margin: 1.6em 0 0.5em; font-size: 19px; color: var(--ink); }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.prose a { border-bottom: 1px solid var(--line-strong); }
.prose a:hover { border-color: var(--accent); color: var(--accent); }
.prose strong { font-weight: 600; color: var(--ink); }

.work-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-top: 1px solid var(--line); padding-top: 30px;
}
.work-nav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.work-nav-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.work-nav-item.is-next { text-align: right; }
.work-nav-label { font-size: 12px; color: var(--faint); }
.work-nav-title { font-weight: 500; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(14, 15, 17, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 72px;
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox img { max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 2px; }
.lightbox figcaption { color: rgba(255, 255, 255, 0.7); font-size: 13px; margin-top: 14px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: transparent; border: 0; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer; padding: 12px;
  opacity: 0.65; transition: opacity 0.15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 16px; right: 20px; font-size: 30px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ------------------------------- 关于 / 空状态 ------------------------------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; }
.about-side { display: flex; flex-direction: column; gap: 26px; }
.side-block { border-top: 1px solid var(--line); padding-top: 18px; }
.side-block h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.side-block p { font-size: 14px; }
.side-list li a {
  display: flex; justify-content: space-between;
  padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line);
}
.side-list li a span { color: var(--faint); font-size: 12px; }
.side-list li a:hover { color: var(--accent); }

.empty {
  padding: 56px 32px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-sm { padding: 34px 24px; }
.empty-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0; }
.empty a { border-bottom: 1px solid var(--line-strong); }

.error-page { max-width: 620px; padding-top: 90px; padding-bottom: 120px; }
.error-code { font-size: 60px; font-weight: 600; color: var(--line-strong); margin: 0 0 8px; }

/* ------------------------------- 页脚 ------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-title { font-weight: 600; margin: 0; }
.footer-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.footer-meta { text-align: right; font-size: 13px; color: var(--faint); }
.footer-meta p { margin: 0 0 4px; }
.footer-meta a:hover { color: var(--ink); }

/* ============================================================
   后台
   ============================================================ */

.admin-body { background: #f6f5f3; }
.admin-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.admin-side {
  display: flex; flex-direction: column; gap: 26px;
  padding: 22px 18px; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.admin-brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
}
.admin-brand strong { display: block; font-size: 14px; }
.admin-brand small { display: block; font-size: 11px; color: var(--faint); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--ink-soft);
}
.admin-nav a:hover { background: var(--tint); }
.admin-nav a.is-active { background: var(--ink); color: #fff; font-weight: 500; }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-side-foot form { margin: 0; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 30px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar-title { font-weight: 600; font-size: 15px; }
.admin-topbar-right { margin-left: auto; }
.admin-user { font-size: 13px; color: var(--muted); }
.admin-menu-btn {
  display: none; width: 34px; height: 34px; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--radius); cursor: pointer;
}
.admin-content { padding: 26px 30px 60px; display: flex; flex-direction: column; gap: 20px; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 24px;
}
.panel-danger { border-color: #f0d4ce; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; }
.panel-hint, .panel-text { font-size: 13px; color: var(--muted); margin: 0; }
.panel-text { margin-bottom: 14px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; transition: opacity 0.4s; }
.alert-ok { background: var(--accent-soft); color: var(--accent); }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert.is-hidden { opacity: 0; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.stat-hint { font-size: 12px; color: var(--muted); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--faint);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0 12px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(0, 0, 0, 0.012); }
.col-thumb { width: 74px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.col-actions .btn { margin-left: 4px; }
.thumb {
  width: 64px; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); background: var(--tint);
}
.table-title { display: block; font-weight: 500; }
.table-title:hover { color: var(--accent); }
.table-sub { display: block; font-size: 12px; color: var(--faint); }
.table-tags { font-size: 13px; color: var(--muted); }
.inline-form { display: inline; margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar input, .toolbar select {
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 13px; font-family: inherit;
}
.toolbar input { flex: 1 1 220px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); outline: none; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field-label em { color: var(--danger); font-size: 11px; }
.field-hint { font-size: 12px; color: var(--faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 14px; font-family: inherit;
  color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(44, 95, 88, 0.1);
}
.field-grid { display: grid; gap: 0 20px; }
.field-full { grid-column: 1 / -1; }

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.edit-main, .edit-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.edit-side { position: sticky; top: 82px; }
.side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.switch {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--line);
}
.switch:last-of-type { border-bottom: 0; }
.switch input { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.switch-body { display: flex; flex-direction: column; }
.switch-label { font-size: 14px; font-weight: 500; }
.switch-hint { font-size: 12px; color: var(--faint); }

.kv { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.settings-side { display: flex; flex-direction: column; gap: 20px; }

/* 分类管理 */
.category-create {
  display: grid; grid-template-columns: 1fr 1fr 1.4fr 100px auto;
  gap: 0 16px; align-items: end;
}
.category-create .field { margin-bottom: 0; }
.field-action { justify-content: flex-end; }
.category-admin-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.category-admin-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; background: #fcfcfb;
  display: flex; flex-direction: column;
}
.category-admin-card .field { margin-bottom: 12px; }
.category-admin-card .field input { padding: 8px 11px; font-size: 13px; }
.category-admin-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.category-admin-count { font-size: 12px; color: var(--faint); }
.category-admin-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }

/* 图片管理 */
.uploader { margin-bottom: 20px; }
.uploader-drop {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 30px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: #fcfcfb; transition: border-color 0.15s, background 0.15s;
}
.uploader-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.uploader-title { margin: 0; font-size: 14px; color: var(--ink-soft); }
.uploader-hint { margin: 0; font-size: 12px; color: var(--faint); }
.uploader-preview { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.uploader-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.uploader-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; background: var(--tint); padding: 6px 10px; border-radius: var(--radius); }
.uploader-list img { width: 36px; height: 36px; object-fit: cover; border-radius: 3px; }
.uploader-actions { display: flex; gap: 8px; }

.image-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.image-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: #fcfcfb; cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.image-card.is-cover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.image-card.is-dragging { opacity: 0.4; cursor: grabbing; }
.image-card.is-over { border-color: var(--accent); border-style: dashed; }
.image-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--tint); }
.image-card-media img { width: 100%; height: 100%; object-fit: cover; }
.image-drag {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.88); border-radius: 4px;
  font-size: 13px; color: var(--muted); cursor: grab;
}
.image-card-media .badge-cover { position: absolute; top: 8px; left: 8px; }
.image-card-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.image-card-meta { margin: 0; font-size: 11.5px; color: var(--faint); }
.caption-form { display: flex; gap: 6px; }
.image-caption {
  flex: 1; min-width: 0; padding: 6px 9px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--radius); font-family: inherit;
}
.image-caption:focus { border-color: var(--accent); outline: none; }
.image-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 登录 */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: linear-gradient(160deg, #f7f6f3 0%, #efece6 100%);
}
.login-card {
  width: min(400px, calc(100vw - 40px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px 30px; box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.login-brand h1 { font-size: 17px; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--faint); }
.login-card .btn { margin-top: 8px; }
.login-hint { margin: 16px 0 0; font-size: 12px; color: var(--faint); text-align: center; line-height: 1.6; }

.hidden-form { display: none; }

/* 发布与二维码 */
.upload-grid {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
}
.steps { margin: 0 0 18px; padding-left: 1.2em; list-style: decimal; font-size: 14px; color: var(--ink-soft); }
.steps li { margin-bottom: 6px; }
.export-box {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fcfcfb; padding: 16px 18px; margin-bottom: 16px;
}
.export-title { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.code-block {
  margin: 10px 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--ink); color: #f2efe9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; overflow-x: auto;
}
.details { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px; }
.details summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.details-body { padding-top: 12px; font-size: 13.5px; color: var(--ink-soft); }
.details-body p { margin: 0 0 10px; }

.qr-box {
  margin-top: 20px; padding: 20px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fcfcfb;
}
.qr-preview {
  width: 220px; height: 220px; margin: 0 auto 12px;
  border-radius: var(--radius); background: #fff;
  box-shadow: 0 1px 3px rgba(20, 22, 26, 0.08);
}
.qr-url {
  font-size: 13px; word-break: break-all; color: var(--ink-soft);
  margin: 0 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.sub-title {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin: 22px 0 10px;
}
.sub-title:first-of-type { margin-top: 8px; }

@media (max-width: 1080px) {
  .upload-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1080px) {
  .category-create { grid-template-columns: 1fr 1fr; }
  .field-action { grid-column: 1 / -1; }
  .field-action .btn { width: 100%; }
  .edit-layout, .settings-grid { grid-template-columns: 1fr; }
  .edit-side { position: static; }
  .work-detail-head { grid-template-columns: 1fr; gap: 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  .wrap, .page { padding-left: 20px; padding-right: 20px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: 250px; transform: translateX(-100%);
    transition: transform 0.22s ease; box-shadow: var(--shadow-lg);
  }
  .admin-side.is-open { transform: none; }
  .admin-menu-btn { display: grid; place-items: center; }
  .admin-content { padding: 20px 18px 60px; }
  .admin-topbar { padding: 14px 18px; }

  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 20px 14px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); border-radius: 0; background: none !important; }
  .nav-toggle { display: flex; }
  .nav-search { display: none; }
  .hero-strip { padding-left: 20px; padding-right: 20px; gap: 10px; }
  .hero-strip-item:nth-child(n + 4) { display: none; }
  .hero { padding-top: 44px; }
  .hero-stats { gap: 28px; }
  .section { padding: 52px 0; }
  .work-gallery { padding: 28px 20px; }
  .work-nav { grid-template-columns: 1fr; }
  .work-nav-item.is-next { text-align: left; }
  .work-row a { grid-template-columns: 68px 1fr; gap: 14px; }
  .work-row-thumb { width: 68px; }
  .work-row-meta { display: none; }
  .table .col-thumb, .table-tags { display: none; }
  .filter-search input { width: 100%; }
  .filter-search { width: 100%; }
}

@media (max-width: 560px) {
  .hero-title { font-size: 34px; }
  .hero-stats { gap: 22px; }
  .hero-stats dd { font-size: 20px; }
  .category-grid, .work-grid { grid-template-columns: 1fr; }
  .table { font-size: 13px; }
  .table td, .table th { padding: 10px 8px; }
  .lightbox { padding: 40px 12px; }
  .lightbox-prev, .lightbox-next { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
