/* ============================================================
   非渔视界 · 站点样式（统一设计系统）
   结构：令牌 → 基础 → 布局 → 头部 → 页面头 → 组件 → 页脚 → 响应式
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #191a18;
  --surface: #21231f;
  --surface-2: #282a25;
  --ink: #ece5d8;
  --ink-dim: #c9c3b4;
  --muted: #9a9789;
  --line: rgba(236, 229, 216, 0.14);
  --line-strong: rgba(236, 229, 216, 0.30);
  --gold: #c8a876;
  --red: #b8574a;

  --serif: 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
  --sans: 'Inter', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;

  --maxw: 1180px;
  --pad-x: clamp(18px, 5vw, 64px);
  --sec-y: clamp(44px, 6.5vw, 92px);
  --gap: clamp(12px, 1.8vw, 20px);
  --tap: 44px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

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

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #14140f;
  padding: 10px 16px;
  z-index: 200;
  font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section { padding: var(--sec-y) 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: clamp(18px, 2.6vw, 32px);
}
.section-head > div { min-width: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

/* ---------- 排版 ---------- */
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
}

h1, h2, h3 { font-weight: 400; }
.section h2 { font: 400 clamp(24px, 3.4vw, 40px)/1.22 var(--serif); margin: 10px 0 0; }

.lede { color: var(--ink-dim); font-size: clamp(15px, 1.5vw, 17px); max-width: 62ch; }
.muted { color: var(--muted); }

.text-link {
  color: var(--gold);
  border-bottom: 1px solid rgba(200, 168, 118, .55);
  padding-bottom: 2px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.text-link:hover { border-bottom-color: var(--gold); }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(25, 26, 24, .92);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  letter-spacing: .06em;
  min-height: var(--tap);
  min-width: 0;
}

.logo-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 11px/1.1 var(--sans);
  text-align: center;
  white-space: pre-line;
  background-size: cover;
  background-position: center;
}
.logo-mark.has-image { color: transparent; }

.brand-text { min-width: 0; }
.brand-text strong {
  display: block;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.brand-text small {
  display: block;
  font: 9px/1.5 var(--sans);
  color: var(--muted);
  letter-spacing: .18em;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  width: var(--tap);
  height: var(--tap);
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: square; }
.menu-toggle[aria-expanded="true"] .line-top { transform: translateY(6px) rotate(45deg); transform-origin: 4px 6px; }
.menu-toggle[aria-expanded="true"] .line-mid { opacity: 0; }
.menu-toggle[aria-expanded="true"] .line-bot { transform: translateY(-6px) rotate(-45deg); transform-origin: 4px 18px; }

.site-nav { display: flex; align-items: center; gap: 2px; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 13px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .18s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- 首页主视觉 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(28px, 5.5vw, 88px);
  align-items: center;
  padding: clamp(32px, 6vw, 88px) 0 clamp(24px, 4vw, 56px);
}

.hero h1 {
  font: 400 clamp(32px, 4.2vw, 58px)/1.14 var(--serif);
  margin: 16px 0 20px;
  letter-spacing: .01em;
  text-wrap: balance;
}
.hero .lede { margin: 0 0 22px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; }

.hero-art {
  aspect-ratio: 4 / 5;
  background: radial-gradient(circle at 30% 30%, #d0b27e22, transparent 32%),
    linear-gradient(135deg, #39453d, #81745d 48%, #202a28);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.hero-art::after {
  content: '非渔视界';
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: #fff7;
  font: 12px var(--serif);
  writing-mode: vertical-rl;
  letter-spacing: .3em;
}

/* ---------- 内页页头 ---------- */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  column-gap: clamp(24px, 5vw, 72px);
  align-items: end;
  padding: clamp(34px, 5.5vw, 76px) 0 clamp(20px, 3vw, 34px);
}
.page-hero .eyebrow { grid-column: 1; grid-row: 1; }
.page-hero h1 {
  grid-column: 1;
  grid-row: 2;
  font: 400 clamp(30px, 5vw, 54px)/1.16 var(--serif);
  margin: 12px 0 0;
}
.page-hero .lede {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  margin: 0;
  max-width: 46ch;
  padding-bottom: 10px;
}

/* ---------- 入口卡（首页三分支） ---------- */
.entry-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(18px, 2.4vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 100%;
  transition: border-color .18s, transform .18s, background .18s;
}
.entry-card:hover,
.entry-card:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.entry-index { font-size: 11px; letter-spacing: .28em; color: var(--gold); }
.entry-card h3 { font: 400 clamp(21px, 2.4vw, 28px)/1.25 var(--serif); margin: 0; }
.entry-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.entry-more { margin-top: auto; padding-top: 8px; color: var(--gold); font-size: 13px; letter-spacing: .04em; }

/* ---------- 作品卡 / 文章卡 ---------- */
.card { display: flex; flex-direction: column; min-width: 0; }

/* ---------- 作品墙（justified：每行等高、填满宽度、图片保持原比例） ---------- */
.wall { display: block; }
.jrow { display: flex; align-items: stretch; }
.jrow + .jrow { margin-top: var(--gap); }
.jrow .card { flex: 0 0 auto; }
.jrow .card-media {
  aspect-ratio: auto;
  height: var(--row-h);
  flex: 0 0 auto;
}
.jrow .card-body { flex: 1; }

.card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  /* 文章卡等宽网格用统一比例；作品墙的媒体高度由 justified 布局 inline 指定 */
  aspect-ratio: var(--ratio, 4 / 5);
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  cursor: pointer;
}
.card-media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 不同比例的照片：统一框 + 裁剪，保证多张混排时行高一致 */
.card-media[data-ratio="1x1"] { --ratio: 1 / 1; }
.card-media[data-ratio="4x5"] { --ratio: 4 / 5; }
.card-media[data-ratio="3x2"] { --ratio: 3 / 2; }
.card-media[data-ratio="16x9"] { --ratio: 16 / 9; }
/* 跟随原图：按图片自身比例撑高，网格用 align-items:start 顶对齐 */
.card-media[data-ratio="auto"] { aspect-ratio: auto; min-height: 220px; }
.card-media[data-ratio="auto"] > img { height: auto; }
.card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .38), transparent 42%);
  pointer-events: none;
}
.card-media::before {
  content: '非渔视界';
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  color: #fff7;
  font: 11px var(--serif);
  writing-mode: vertical-rl;
  letter-spacing: .28em;
  pointer-events: none;
}

.card-body { padding: 10px 0 0; }
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .03em;
}
.card-title { font: 400 16px/1.45 var(--serif); margin: 2px 0 0; }
.card-body p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

/* 文章卡：与作品卡同一套卡片语汇（透明底、无边框、图下排文字） */
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.notes-grid .card-media { --ratio: 3 / 2; }
.card-body .text-link { margin-top: 10px; }


/* ---------- 筛选与控件 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(18px, 2.4vw, 28px);
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.filter:hover, .button:hover { color: var(--ink); border-color: var(--line-strong); }
.filter[aria-pressed="true"], .filter.active, .button.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

select.sort, .select {
  min-height: var(--tap);
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 2px;
  font-size: 14px;
}

.load-more { display: flex; margin: clamp(24px, 3vw, 40px) auto 0; }

/* ---------- 关于页 ---------- */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4.5vw, 64px);
  align-items: stretch;
}
.about-side { display: grid; }
.about-main { align-self: start; }

.about-art {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 320px;
  background: linear-gradient(140deg, #3a4a44, #9a8a6c 55%, #232a26);
  background-size: cover;
  background-position: center;
  margin: 0;
  overflow: hidden;
}
.about-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .38), transparent 42%);
  pointer-events: none;
}
.about-art::before {
  content: '非渔视界';
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  color: #fff7;
  font: 11px var(--serif);
  writing-mode: vertical-rl;
  letter-spacing: .28em;
  pointer-events: none;
}

.quote {
  font: 400 clamp(19px, 2vw, 26px)/1.5 var(--serif);
  margin: 28px 0;
  padding-left: 18px;
  border-left: 1px solid var(--gold);
  color: var(--ink);
}
.about-main > p { margin: 0 0 18px; line-height: 1.9; }

.contact-list { display: grid; gap: 0; margin-top: 26px; }

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 6px 0;
  min-height: 52px;
  font-size: 14px;
}
.contact-item > span:first-child { color: var(--muted); }
.contact-item a { min-height: var(--tap); display: inline-flex; align-items: center; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
  font-size: 12px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.footer-inner a:hover { color: var(--ink); }

/* ---------- 灯箱 ---------- */
.lightbox {
  background: #171816;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0;
  width: min(700px, 92vw);
  max-width: none;
  max-height: 90vh;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .78); }
.lightbox-inner { padding: clamp(16px, 3vw, 26px); overflow: auto; max-height: 88vh; }
.close-lightbox {
  float: right;
  width: var(--tap);
  height: var(--tap);
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-art {
  aspect-ratio: 3 / 2;
  margin: 8px 0 14px;
  background-size: cover;
  background-position: center;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(60px, 12vw, 140px) 0; }
.notfound h1 {
  font: 400 clamp(44px, 9vw, 96px)/1.05 var(--serif);
  margin: 14px 0 10px;
}

/* ---------- 占位渐变（未设置真实图片时） ---------- */
.art-1 { background-image: linear-gradient(155deg, #b18c5b, #40372f 45%, #191f20); }
.art-2 { background-image: linear-gradient(145deg, #d7e1dd, #71858e 45%, #26353d); }
.art-3 { background-image: linear-gradient(145deg, #767b6e, #c3b28d 45%, #4e5b52); }
.art-4 { background-image: linear-gradient(145deg, #315a68, #b8a57c 55%, #192a31); }
.art-5 { background-image: linear-gradient(145deg, #e0c891, #6b5540 47%, #222724); }
.art-6 { background-image: linear-gradient(145deg, #eef0e7, #8da0a1 50%, #33464d); }
.art-7 { background-image: linear-gradient(145deg, #d1b18d, #65766a 50%, #27302b); }
.art-8 { background-image: linear-gradient(145deg, #234e61, #79a4a3 50%, #182727); }

[data-site-image].has-image { color: transparent; background-size: cover; background-position: center; }
[data-site-image].has-image::after { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  /* 移动端不再把导航藏进汉堡：四个链接直接横排在品牌下方，随时可点 */
  .menu-toggle { display: none; }

  .header-inner {
    flex-wrap: wrap;
    padding-bottom: 0;
  }
  .brand { margin-right: auto; }

  .site-nav {
    display: flex;
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
    margin: 8px calc(var(--pad-x) * -1) 0;
    padding: 0 var(--pad-x);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    min-height: 46px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .site-nav a:first-child { padding-left: 0; }
  .site-nav a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--gold);
  }

  .page-hero {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
  .page-hero .eyebrow,
  .page-hero h1,
  .page-hero .lede {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    padding-bottom: 0;
  }
  .page-hero h1 { margin: 12px 0 14px; }
  .page-hero .lede { margin: 0; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: clamp(24px, 6vw, 48px) 0 clamp(20px, 4vw, 32px);
    gap: clamp(20px, 4vw, 32px);
  }
  .hero-art { aspect-ratio: 16 / 11; }
  .hero h1 { margin: 12px 0 16px; }

  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
  .about-layout { grid-template-columns: minmax(0, 1fr); }
  .about-side { min-width: 0; }
  .about-art { aspect-ratio: 16 / 11; min-height: 0; width: 100%; }
  .lightbox-art { aspect-ratio: 4 / 3; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .section { padding: clamp(36px, 9vw, 52px) 0; }
  .card-title { font-size: 15px; }
  /* 作品卡在手机上省掉描述；文章卡保留摘要（截两行），否则卡片信息太单薄 */
  .card-body p { display: none; }
  .notes-grid .card-body p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
