/* ============================================================================
   肇春来 · 首页
   ----------------------------------------------------------------------------
   设计语言沿用「春雷音乐」:暗色底 + 琥珀金强调 + 编辑型排版。
   首页是整个站的门面,音乐板块是其中一件作品 —— 两页共用一套设计令牌,
   所以站点看起来像一个作品,而不是一堆拼凑的网页。

   令牌命名与 020_wp_music/assets/css/player.css 对齐,方便两边互相借鉴。
   ========================================================================== */

/* ── 设计令牌 ────────────────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg-0: #0a0a0c;
  --bg-1: #131316;
  --bg-2: #1a1a1e;
  --bg-3: #232329;
  --bg-4: #2d2d34;

  --border:        rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text-0: #f5f1ea;   /* primary 暖白 */
  --text-1: #b8b3a8;   /* secondary */
  --text-2: #8f8a81;   /* tertiary */
  --text-3: #6c6862;   /* dim —— 不承载正文 */

  --accent:        #e8b340;
  --accent-hover:  #f0c258;
  --accent-press:  #d09e2a;
  --accent-soft:   rgba(232, 179, 64, 0.12);
  --accent-glow:   rgba(232, 179, 64, 0.35);
  --accent-text:   #e8b340;
  --on-accent:     #0a0a0c;

  --glass-top: rgba(10, 10, 12, 0.82);
  --card-bg: rgba(255, 255, 255, 0.028);
  --card-bg-hover: rgba(255, 255, 255, 0.052);
  --cover-ph: linear-gradient(135deg, #2a2a30, #1a1a1e);
  --cover-ph-fg: linear-gradient(135deg, rgba(232, 179, 64, 0.18), rgba(232, 179, 64, 0.04));

  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.85);

  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1120px;
  --gutter: 28px;
  --header-h: 62px;
}

/* 主题:星光白 */
[data-theme="light"] {
  --bg-0: #fafafa;
  --bg-1: #f2f2f7;
  --bg-2: #ebebef;
  --bg-3: #e2e2e7;
  --bg-4: #d8d8de;

  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  --text-0: #1c1c1e;
  --text-1: #3a3a3c;
  --text-2: #646469;
  --text-3: #8a8a90;

  --accent:        #c8890b;
  --accent-hover:  #a86f06;
  --accent-press:  #8d5b04;
  --accent-soft:   rgba(200, 137, 11, 0.12);
  --accent-glow:   rgba(200, 137, 11, 0.28);
  --accent-text:   #8d5b04;
  --on-accent:     #ffffff;

  --glass-top: rgba(250, 250, 250, 0.85);
  --card-bg: rgba(0, 0, 0, 0.022);
  --card-bg-hover: rgba(0, 0, 0, 0.05);
  --cover-ph: linear-gradient(135deg, #e6e6ea, #dcdce2);
  --cover-ph-fg: linear-gradient(135deg, rgba(200, 137, 11, 0.16), rgba(200, 137, 11, 0.03));

  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.28);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

::selection { background: var(--accent-soft); color: var(--text-0); }

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

/* 底噪 —— 纯色大背景会显得塑料,加一点颗粒 */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
[data-theme="light"] .grain { opacity: .05; mix-blend-mode: multiply; }

/* 版心 */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── 顶栏 ──────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  background: var(--glass-top);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-0);
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .14em;
  white-space: nowrap;
}

/* 品牌标记:一个像闪电/篆刻的折角方块 —— 和春雷的六边形同一套"几何标记"语言 */
.brand-mark {
  width: 15px;
  height: 17px;
  flex: none;
  background: linear-gradient(150deg, var(--accent), rgba(232, 179, 64, .45));
  clip-path: polygon(42% 0%, 100% 0%, 58% 42%, 100% 42%, 22% 100%, 40% 58%, 0% 58%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-2);
}

.site-nav a {
  position: relative;
  padding: 4px 0;
  transition: color .2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.site-nav a:hover { color: var(--text-0); }
.site-nav a:hover::after { transform: scaleX(1); }

/* 主题切换 */
.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── 按钮 ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text-1);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.btn svg { width: 15px; height: 15px; }

/* ── 通用分区 ──────────────────────────────────────────────────────────── */
.section {
  padding: 76px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--accent-text);
}

.section-title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-0);
}

.section-note {
  max-width: 30em;
  font-size: 14.5px;
  color: var(--text-2);
}

/* ── 作品卡片 ──────────────────────────────────────────────────────────── */
.works {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.work {
  --work-accent: var(--accent);
  --work-accent-soft: var(--accent-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 268px;
  padding: 26px 26px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

/* 每件作品有自己的强调色 —— 音乐是琥珀金,产品各有各的色,文字保持中性 */
.work[data-accent="cyan"] {
  --work-accent: #22d3ee;
  --work-accent-soft: rgba(34, 211, 238, .12);
}
.work[data-accent="violet"] {
  --work-accent: #a78bfa;
  --work-accent-soft: rgba(167, 139, 250, .12);
}
.work[data-accent="neutral"] {
  --work-accent: var(--text-1);
  --work-accent-soft: rgba(255, 255, 255, .07);
}
[data-theme="light"] .work[data-accent="cyan"]   { --work-accent: #0891b2; --work-accent-soft: rgba(8, 145, 178, .12); }
[data-theme="light"] .work[data-accent="violet"] { --work-accent: #7c5cf0; --work-accent-soft: rgba(124, 92, 240, .12); }
[data-theme="light"] .work[data-accent="neutral"]{ --work-accent: #4a4a52; --work-accent-soft: rgba(0, 0, 0, .06); }

.work:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--work-accent) 42%, transparent);
  background: var(--card-bg-hover);
}

/* 卡片右上角的一层柔光 */
.work::after {
  content: "";
  position: absolute;
  top: -110px;
  right: -80px;
  width: 300px;
  height: 260px;
  background: radial-gradient(circle at center, var(--work-accent-soft), transparent 66%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.work:hover::after { opacity: 1; }

.work-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-2);
}

.work-no {
  color: var(--work-accent);
}

.work-tag {
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--text-2);
}

.work-title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-0);
}

.work-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--work-accent);
}

.work-desc {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-1);
}

.work-meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-2);
}

/* 卡片底部箭头 */
.work-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--work-accent);
  transition: gap .2s ease;
}

.work:hover .work-go { gap: 12px; }
.work-go svg { width: 14px; height: 14px; }

/* 专辑封面小样 */
.covers {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.cover {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--cover-ph);
  border: 1px solid var(--border);
  transition: transform .25s ease;
}

.work:hover .cover:nth-child(1) { transform: translateY(-3px) rotate(-2.5deg); }
.work:hover .cover:nth-child(2) { transform: translateY(-5px); }
.work:hover .cover:nth-child(3) { transform: translateY(-3px) rotate(2.5deg); }

/* 产品图标 */
.work-icon {
  width: 52px;
  height: 52px;
  margin-top: 18px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--work-accent-soft);
  border: 1px solid color-mix(in srgb, var(--work-accent) 30%, transparent);
}

.work-icon svg { width: 26px; height: 26px; }

/* 文字板块的标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.tag {
  padding: 4px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 12.5px;
  color: var(--text-2);
}

/* 通栏卡片(第三个作品占满一行) */
.work--wide { grid-column: 1 / -1; min-height: 0; }

/* ── 其它入口 ──────────────────────────────────────────────────────────── */
.elsewhere {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 12px;
}

.elsewhere a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.elsewhere a:hover {
  border-color: var(--border-strong);
  background: var(--card-bg-hover);
  transform: translateY(-2px);
}

.elsewhere-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-0);
}

.elsewhere-desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-2);
}

/* ── 页脚 ──────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 44px 0 52px;
  border-top: 1px solid var(--border);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--text-0);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13.5px;
  color: var(--text-2);
}

.footer-links a:hover { color: var(--accent-text); }

.footer-meta {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
}

.footer-meta a { color: var(--text-3); }
.footer-meta a:hover { color: var(--text-2); }

/* ── 进场动画 ──────────────────────────────────────────────────────────── */
/* 只有 JS 可用时才"先藏起来" —— 脚本挂了内容也要看得见 */
.js .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s cubic-bezier(.22, .61, .36, 1), transform .6s cubic-bezier(.22, .61, .36, 1);
}

.rv.in { opacity: 1; transform: none; }

.rv-d1 { transition-delay: .06s; }
.rv-d2 { transition-delay: .12s; }
.rv-d3 { transition-delay: .18s; }
.rv-d4 { transition-delay: .24s; }

/* 首屏不用滚动触发,直接显示 —— 否则页面加载时标题是空的 */
.js .hero .rv { opacity: 1; transform: none; }

/* ── 响应式 ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .works { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --gutter: 20px; }

  .site-nav { gap: 18px; font-size: 13px; }

  .section { padding: 56px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-meta { margin-left: 0; }
}

/* ── 无障碍:系统开了「减弱动态效果」就全停 ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .work, .cover, .btn, .theme-toggle { transition: none !important; }
}
