/* ============================================================
   Sumortsa · 样式表
   主题色可在下方 :root 变量中调整
   ============================================================ */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #1a1b1f;
  --muted: #6f7280;
  --line: #e8e8e4;
  --accent: #2f6fed;
  --accent-strong: #2056c9;
  --accent-soft: #eaf1fe;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(23, 27, 43, 0.08);
  --shadow-lg: 0 24px 64px rgba(23, 27, 43, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
img, video { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 0.5px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-nav a:hover { color: var(--ink); }

/* ---------- 首屏 ---------- */
.hero { text-align: center; padding: 92px 24px 72px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(2.6rem, 6vw, 4rem); letter-spacing: 2px; }
.tagline { margin: 0 0 14px; color: var(--accent); font-weight: 600; }
.intro { max-width: 620px; margin: 0 auto 30px; color: var(--muted); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 26px; border-radius: 999px;
  font-size: 15px; text-decoration: none; transition: 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 作品区 ---------- */
.works { padding: 24px 0 72px; }
.works-head h2 { margin: 8px 0 20px; font-size: 1.6rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 26px; }
#search {
  flex: 1 1 240px; padding: 10px 18px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; background: var(--surface); color: var(--ink);
  outline: none;
}
#search:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 14px; cursor: pointer;
  transition: 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); outline: none; }
.card-cover { position: relative; aspect-ratio: 4 / 3; background: #eef0f4; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 52px;
  background: linear-gradient(135deg, #eaf1fe, #f3ecfe);
}
.badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; color: #fff; background: rgba(23, 27, 43, 0.62); backdrop-filter: blur(4px);
}
.card-body { padding: 16px 18px 18px; }
.card-body h3 { margin: 0 0 6px; font-size: 17px; }
.card-desc {
  margin: 0 0 12px; color: var(--muted); font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.card-meta span { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- 关于 ---------- */
.about { border-top: 1px solid var(--line); background: var(--surface); padding: 64px 0; }
.about h2 { margin: 0 0 16px; font-size: 1.6rem; }
#about-text { white-space: pre-line; color: var(--muted); max-width: 720px; }
#contact-text { color: var(--ink); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; text-align: center; color: var(--muted); font-size: 13.5px; }
.site-footer p { margin: 4px 0; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 18, 26, 0.55); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; width: min(860px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px;
}
.modal-close {
  position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal-head { padding-right: 44px; }
.modal-head h2 { margin: 10px 0 6px; font-size: 1.5rem; }
.modal-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.modal-desc { margin: 10px 0 18px; color: var(--muted); }
.viewer { margin-bottom: 20px; }
.viewer audio, .viewer video { width: 100%; border-radius: 10px; background: #000; display: block; }
.pdf-frame { width: 100%; height: min(62vh, 520px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.img-preview { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.img-preview img { display: block; width: 100%; border-radius: 10px; }
.no-preview {
  padding: 44px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 10px; background: var(--bg);
}
.viewer-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.player-shell { background: #10131c; border-radius: 10px; padding: 18px; }
.player-title { color: #fff; font-size: 14px; margin-bottom: 12px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-top: 1px solid var(--line); font-size: 14px;
}
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 13px; min-width: 64px; text-align: right; }
.file-actions { display: flex; gap: 8px; }
.btn-small {
  display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: 0.15s; white-space: nowrap;
}
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-download { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-download:hover { background: var(--accent-strong); color: #fff; }

/* ---------- 灯箱 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 18, 0.93); }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; }
.lightbox-stage {
  position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 48px;
}
.lightbox-stage img { max-width: 92vw; max-height: 82vh; border-radius: 6px; }
.lightbox-stage figcaption { color: #d8dbe2; font-size: 14px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; border: 0; border-radius: 50%; width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 22px; cursor: pointer;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .hero { padding: 60px 20px 48px; }
  .modal-dialog { padding: 20px 16px; }
  .file-list li { flex-wrap: wrap; }
  .file-size { min-width: auto; }
  .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; }
}
