/* 社区谱面站的全部样式。浅色、简洁；动效只用位移和透明度，时长短、曲线柔和。 */

/* ---------- 样式变量 ---------- */
:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f0f3f5;
  --line: #e4e9ed;
  --line-strong: #d3dbe1;
  --text: #111a22;
  --sub: #5a6672;
  --mute: #8f99a3;
  --accent: #0a7f8c;
  --accent-bright: #19bfd2;
  --accent-soft: #e3f5f7;
  --warn: #b05836;
  --warn-soft: #fbeee8;
  --ultra: #9b4fd0;
  --d-easy: #1e9e6a;
  --d-normal: #0a8fa0;
  --d-expert: #d2702a;
  --d-master: #cc3d66;
  --d-ultra: #9b4fd0;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(17, 26, 34, 0.05);
  --shadow: 0 1px 2px rgba(17, 26, 34, 0.04), 0 8px 24px -12px rgba(17, 26, 34, 0.14);
  --shadow-lg: 0 2px 4px rgba(17, 26, 34, 0.04), 0 24px 48px -20px rgba(17, 26, 34, 0.22);
  --out: cubic-bezier(0.22, 1, 0.36, 1);
  --move: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "JetBrains Mono", Consolas, monospace;
  --nav-h: 64px;
  --page-pad: clamp(20px, 5vw, 64px);
  --maxw: 1160px;
  color-scheme: light;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(25, 191, 210, 0.22); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.88em; }
main { min-height: calc(100vh - var(--nav-h)); outline: none; }
.noscript { padding: 40px; text-align: center; }
.link { color: var(--accent); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.35s var(--out); }
.link:hover { background-size: 100% 1px; }

/* 页面内的元素按顺序浮现：给父元素加 .stagger，子元素依次延迟 */
.stagger > * { animation: rise 0.7s var(--out) both; }
.stagger > :nth-child(1) { animation-delay: 0.02s; }
.stagger > :nth-child(2) { animation-delay: 0.07s; }
.stagger > :nth-child(3) { animation-delay: 0.12s; }
.stagger > :nth-child(4) { animation-delay: 0.17s; }
.stagger > :nth-child(5) { animation-delay: 0.22s; }
.stagger > :nth-child(6) { animation-delay: 0.27s; }
.stagger > :nth-child(n + 7) { animation-delay: 0.32s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 页面切换（支持的浏览器用 View Transitions） ---------- */
::view-transition-old(root) { animation: vt-out 0.22s var(--move) both; }
::view-transition-new(root) { animation: vt-in 0.42s var(--out) both; }
::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: var(--out); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.nav { view-transition-name: site-nav; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--page-pad);
  background: rgba(245, 247, 248, 0.82);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 24px; height: 24px; transition: transform 0.5s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brand-mark path { stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.brand-mark .brand-judge { stroke: var(--accent-bright); stroke-width: 1.8; }
.brand-mark rect { fill: var(--accent-bright); transition: transform 0.5s var(--spring); }
.brand:hover .brand-mark rect { transform: translateY(4px); }
.brand-mark circle { fill: var(--surface); transition: transform 0.5s var(--spring); }
.brand:hover .brand-mark circle { transform: translateY(4px); }
.brand-word { font-weight: 700; letter-spacing: 0.14em; font-size: 13.5px; }
.nav-links { position: relative; display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a { position: relative; z-index: 1; color: var(--sub); padding: 7px 14px; font-size: 14px; transition: color 0.25s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
/* 当前页面下面的小横线，换页时滑过去 */
.nav-ind { position: absolute; bottom: 0; left: 0; height: 2px; width: 0; border-radius: 2px; background: var(--text); opacity: 0; transition: transform 0.45s var(--out), width 0.45s var(--out), opacity 0.2s; }

/* ---------- 按钮与通用组件 ---------- */
.wrap { width: min(var(--maxw), 100%); margin: 0 auto; padding: 0 var(--page-pad); }
.label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--spring), box-shadow 0.3s var(--out), border-color 0.25s, background 0.25s, color 0.25s, opacity 0.2s;
}
.btn:hover { border-color: var(--sub); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; transition-duration: 0.1s; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:hover { border-color: var(--text); }
/* 主按钮悬停时一层青色从左往右铺开 */
.btn-primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--out); }
.btn-primary:hover::before { transform: scaleX(1); }
.btn-primary[disabled]::before { display: none; }
.btn-warn { color: var(--warn); border-color: #ebcfc3; }
.btn-warn:hover { border-color: var(--warn); }
.btn-small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn .arrow { display: inline-block; transition: transform 0.35s var(--out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn .swap { display: inline-grid; }
.btn .swap > * { grid-area: 1 / 1; transition: transform 0.35s var(--out), opacity 0.25s; }
.btn .swap > :last-child { transform: translateY(110%); opacity: 0; }
.btn.done .swap > :first-child { transform: translateY(-110%); opacity: 0; }
.btn.done .swap > :last-child { transform: none; opacity: 1; color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--d, var(--mute)); flex: none; }

/* ---------- 首页 ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding-top: clamp(40px, 8vh, 96px);
  padding-bottom: clamp(40px, 8vh, 88px);
}
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.hero-title { margin: 0; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
/* 标题逐行从遮罩下面升起 */
.hero-title .ln { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .ln > span { display: block; animation: line-up 0.95s var(--out) both; }
.hero-title .ln:nth-child(2) > span { animation-delay: 0.08s; color: var(--mute); }
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }
.hero-lead { margin: 0; max-width: 26em; font-size: 17px; color: var(--sub); animation: rise 0.8s var(--out) 0.25s both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; animation: rise 0.8s var(--out) 0.32s both; }
.hero-stats { display: flex; gap: 36px; margin: 6px 0 0; padding: 0; list-style: none; animation: rise 0.8s var(--out) 0.4s both; }
.hero-stats b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.hero-stats span { font-size: 12.5px; color: var(--mute); }
.hero-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 600px;
  width: 100%;
  justify-self: end;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: stage-in 1.1s var(--out) 0.15s both;
}
@keyframes stage-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.hero-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 列表区 */
.section { padding-top: 40px; padding-bottom: 120px; }
.toolbar { position: sticky; top: var(--nav-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 32px; padding: 12px 0; background: rgba(245, 247, 248, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.toolbar h2 { margin: 0 8px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.toolbar h2 .count { margin-left: 8px; font-size: 14px; font-weight: 500; color: var(--mute); font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1 1 200px; max-width: 300px; margin-left: auto; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  outline: none;
  font-size: 14px;
  transition: border-color 0.25s, box-shadow 0.3s var(--out);
}
.search input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 4px rgba(17, 26, 34, 0.04); }
.search input::placeholder { color: var(--mute); }
.search svg { position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; stroke: var(--mute); fill: none; stroke-width: 1.8; transition: stroke 0.25s, transform 0.4s var(--spring); }
.search:focus-within svg { stroke: var(--text); transform: scale(1.08); }
/* 分段选择：选中项背后的白块会滑动 */
.seg { position: relative; display: flex; padding: 3px; border-radius: 99px; background: var(--surface-2); }
.seg-ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); transition: transform 0.45s var(--out), width 0.45s var(--out); }
.seg button { position: relative; z-index: 1; flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 99px; background: transparent; color: var(--mute); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; cursor: pointer; transition: color 0.25s; }
.seg button:hover, .seg button[aria-pressed="true"] { color: var(--text); }
.select {
  height: 38px;
  padding: 0 30px 0 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235A6672' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 12px center / 10px;
  appearance: none;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 36px 24px; }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-art { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); transition: transform 0.5s var(--out), box-shadow 0.5s var(--out); }
.card:hover .card-art { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-art > img, .card-art > svg { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--out); }
.card:hover .card-art > img, .card:hover .card-art > svg { transform: scale(1.04); }
/* 悬停时从封面底部升起的一层详细信息 */
.card-info {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  font-size: 12px;
  line-height: 1.55;
  color: var(--sub);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.45s var(--out);
}
.card-info b { color: var(--text); font-weight: 600; }
.card-info div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover .card-info, .card:focus-visible .card-info { opacity: 1; transform: none; }
.card-tag { position: absolute; left: 10px; top: 10px; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--text); background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(8px); }
.card-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-title { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-artist { margin: 0; font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.levels { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.levels span { display: inline-flex; align-items: center; gap: 5px; }
.levels b { color: var(--text); font-weight: 600; }
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in { animation: rise 0.7s var(--out) both; animation-delay: var(--delay, 0s); }
.card-meta { display: none; font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { padding: 80px 24px; text-align: center; color: var(--sub); grid-column: 1 / -1; animation: rise 0.6s var(--out) both; }
.empty h3 { color: var(--text); font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.empty p { margin: 0; }
code { font-family: var(--mono); font-size: 0.86em; color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- 歌曲详情 ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 28px; color: var(--sub); font-size: 14px; transition: color 0.2s; }
.back:hover { color: var(--text); }
.back .arrow { display: inline-block; transition: transform 0.35s var(--out); }
.back:hover .arrow { transform: translateX(-3px); }
.detail-head { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(28px, 5vw, 64px); align-items: end; }
.jacket { aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-lg); }
.jacket > img, .jacket > svg { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.detail-info h1 { margin: 0; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.detail-info .artist { margin: -4px 0 0; font-size: 17px; color: var(--sub); }
.facts { display: flex; flex-wrap: wrap; gap: 28px; margin: 6px 0 4px; padding: 0; list-style: none; }
.facts span { display: block; font-size: 12px; color: var(--mute); }
.facts b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.byline { font-size: 13px; color: var(--mute); }

.block { margin-top: 64px; }
.block h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.diff-wrap { display: grid; grid-template-columns: minmax(260px, 0.9fr) 1.4fr; gap: 20px; align-items: stretch; }
.diff-list { position: relative; padding: 6px; }
/* 选中难度左侧的竖条，切换时滑动 */
.diff-ind { position: absolute; left: 6px; right: 6px; top: 0; height: 0; border-radius: 10px; background: var(--surface-2); transition: transform 0.45s var(--out), height 0.45s var(--out); }
.diff-row {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.diff-row .name { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: var(--sub); transition: color 0.25s; }
.diff-row .name small { display: block; font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--mute); }
.diff-row[aria-selected="true"] .name { color: var(--text); }
.diff-row .lv { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--d); }
.diff-row.none { cursor: default; opacity: 0.35; }
.diff-row.none .lv { color: var(--mute); }
.diff-detail { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
.density { height: 110px; display: flex; align-items: flex-end; gap: 2px; }
.density i { flex: 1; height: 2%; min-height: 1px; border-radius: 2px 2px 0 0; background: var(--d, var(--accent)); transition: height 0.6s var(--out), background-color 0.4s; transition-delay: calc(var(--i) * 5ms); }
.density-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.type-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type-bar span { display: block; font-size: 12px; color: var(--mute); }
.type-bar b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.type-bar .track { height: 3px; margin-top: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.type-bar .fill { height: 100%; width: 0; border-radius: 99px; background: var(--c); transition: width 0.6s var(--out); }

/* 谱面预览 */
.stage { overflow: hidden; }
.stage-view { position: relative; aspect-ratio: 20 / 9; max-height: 60vh; width: 100%; background: var(--surface); }
.stage-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(2px); text-align: center; padding: 20px; transition: opacity 0.4s; }
.stage-cover p { margin: 0; color: var(--sub); font-size: 13.5px; }
.play-big { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--text); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform 0.35s var(--spring); }
.play-big:hover { transform: scale(1.08); }
.play-big:active { transform: scale(0.95); }
.play-big svg { width: 18px; height: 18px; margin-left: 3px; fill: currentColor; }
.stage-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.stage-bar input[type="range"] { flex: 1; accent-color: var(--text); }
.loadbar { width: min(220px, 70%); height: 2px; border-radius: 99px; background: var(--line); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--text); transition: width 0.2s; }

.dl { display: grid; grid-template-columns: 120px 1fr; margin: 0; }
.dl dt, .dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl dt { color: var(--mute); }
.dl dd { color: var(--sub); overflow-wrap: anywhere; min-width: 0; }
.dl .hash { font-family: var(--mono); font-size: 12.5px; }

/* ---------- 上传 ---------- */
.narrow { width: min(820px, 100%); margin: 0 auto; padding: 48px var(--page-pad) 120px; }
.page-title { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 40px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.page-lead { margin: 0 0 32px; color: var(--sub); }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.45s var(--out), min-height 0.5s var(--out), padding 0.5s var(--out);
}
.drop:hover { border-color: var(--sub); }
.drop.over { border-style: solid; border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop.has-file { min-height: 120px; padding: 22px; }
.drop .icon { width: 36px; height: 36px; stroke: var(--text); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--spring); }
.drop .icon .arrow-up { transition: transform 0.5s var(--spring); }
.drop:hover .icon .arrow-up, .drop.over .icon .arrow-up { transform: translateY(-3px); }
.drop.over .icon { transform: scale(1.1); }
.drop.busy .icon .arrow-up { animation: bob 0.9s var(--move) infinite alternate; }
@keyframes bob { to { transform: translateY(-5px); } }
.drop h2 { margin: 6px 0 0; font-size: 16px; font-weight: 600; }
.drop p { margin: 0; color: var(--mute); font-size: 13px; }
.drop input { display: none; }
.file-line { font-size: 13px; color: var(--sub); animation: rise 0.4s var(--out) both; }
.file-line b { color: var(--text); font-weight: 500; margin-right: 6px; }

.upload-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.upload-grid:has(> .form[hidden]) { grid-template-columns: 1fr; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding-bottom: 6px; }
.checks { animation: rise 0.5s var(--out) both; }
.checks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; }
.checks-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 9px 20px; opacity: 0; transform: translateY(6px); transition: opacity 0.35s, transform 0.45s var(--out); }
.check.in { opacity: 1; transform: none; }
.check .what b { display: block; font-size: 14px; font-weight: 500; }
.check .what span { display: block; font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.check.miss .what span { color: var(--warn); }
/* 检查结果的图标：圆圈和对勾/叉号依次画出来 */
.mark-icon { width: 20px; height: 20px; margin-top: 1px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-icon circle { stroke-dasharray: 57; stroke-dashoffset: 57; opacity: 0.35; }
.mark-icon path { stroke-dasharray: 20; stroke-dashoffset: 20; }
.check.in .mark-icon circle { transition: stroke-dashoffset 0.5s var(--out); stroke-dashoffset: 0; }
.check.in .mark-icon path { transition: stroke-dashoffset 0.35s var(--out) 0.25s; stroke-dashoffset: 0; }
.check.perfect .mark-icon { stroke: var(--accent); }
.check.great .mark-icon { stroke: var(--d-expert); }
.check.miss .mark-icon { stroke: var(--warn); }
.verdict { margin: 8px 20px 18px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; animation: rise 0.45s var(--out) both; }
.verdict b { font-weight: 600; margin-right: 6px; }
.verdict.ok { background: var(--accent-soft); color: var(--accent); }
.verdict.bad { background: var(--warn-soft); color: var(--warn); }

.form { padding: 22px; display: flex; flex-direction: column; gap: 20px; animation: rise 0.5s var(--out) both; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
  font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.3s var(--out);
}
.input:focus { border-color: var(--text); box-shadow: 0 0 0 4px rgba(17, 26, 34, 0.06); }
.hint { font-size: 12px; color: var(--mute); margin-top: 6px; }
.check-box { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check-box input { appearance: none; flex: none; position: relative; width: 18px; height: 18px; margin: 2px 0 0; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: background 0.25s, border-color 0.25s, transform 0.3s var(--spring); }
.check-box input:hover { border-color: var(--sub); }
.check-box input:active { transform: scale(0.9); }
.check-box input:checked { background: var(--text); border-color: var(--text); }
.check-box input::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border-right: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(45deg) scale(0); transition: transform 0.3s var(--spring); }
.check-box input:checked::after { transform: rotate(45deg) scale(1); }
.check-box small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; line-height: 1.6; }
.mini { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.mini .art { aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.mini .art > * { width: 100%; height: 100%; object-fit: cover; }
.mini b { display: block; font-size: 14.5px; font-weight: 600; }
.mini span { display: block; font-size: 12.5px; color: var(--mute); }

.progress { position: relative; height: 3px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--text); transition: width 0.2s linear; }
.progress.wait i { width: 30% !important; animation: indeterminate 1.1s var(--move) infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress-text { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }

.done { padding: 24px 0 0; }
.done-mark { width: 52px; height: 52px; margin-bottom: 18px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.done-mark circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw 0.7s var(--out) 0.05s forwards; }
.done-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.45s var(--out) 0.55s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done > :not(.done-mark) { animation: rise 0.7s var(--out) both; }
.done > :nth-child(2) { animation-delay: 0.5s; }
.done > :nth-child(3) { animation-delay: 0.58s; }
.done > :nth-child(4) { animation-delay: 0.66s; }
.done > :nth-child(5) { animation-delay: 0.74s; }
.keybox { margin-top: 28px; padding: 20px; }
.keybox h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; }
.keybox p { margin: 0 0 14px; color: var(--sub); font-size: 13px; }
.keyline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.keyline code { flex: 1 1 280px; min-width: 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }

/* ---------- 管理与规则 ---------- */
.manage-card { display: grid; grid-template-columns: 80px 1fr; gap: 18px; padding: 16px; align-items: center; }
.manage-card .art { width: 80px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.manage-card .art > * { width: 100%; height: 100%; object-fit: cover; }
.manage-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.manage-card p { margin: 0; color: var(--mute); font-size: 13px; }
.danger { margin-top: 24px; padding: 20px; }
.danger h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--warn); }
.danger p { margin: 0 0 14px; color: var(--sub); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .input { flex: 1 1 220px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.notice { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; background: var(--surface-2); color: var(--sub); animation: rise 0.4s var(--out) both; }
.notice.err { background: var(--warn-soft); color: var(--warn); }
.prose h2 { margin: 40px 0 10px; font-size: 16px; font-weight: 600; }
.prose p, .prose li { color: var(--sub); }
.prose ul { margin: 0; padding-left: 1.1em; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--line-strong); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mute); font-size: 12px; font-weight: 500; }
.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { height: 3px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--text); border-radius: 99px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; padding: 10px 18px; border-radius: 99px; background: var(--text); color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toast 2.6s var(--out) both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 4px); } }

/* ---------- 页脚 ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; width: min(var(--maxw), 100%); margin: 0 auto; padding: 28px var(--page-pad) 40px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12.5px; }
.foot a { color: var(--sub); transition: color 0.2s; }
.foot a:hover { color: var(--text); }
.foot .sp { margin-right: auto; }

/* 难度色：放在组件之后，才能覆盖组件里的默认值 */
.d-easy { --d: var(--d-easy); }
.d-normal { --d: var(--d-normal); }
.d-expert { --d: var(--d-expert); }
.d-master { --d: var(--d-master); }
.d-ultra { --d: var(--d-ultra); }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { aspect-ratio: 16 / 10; justify-self: stretch; }
  .detail-head { grid-template-columns: 1fr; }
  .detail-head .jacket { width: min(260px, 70vw); }
  .diff-wrap { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .nav-links a { padding: 6px 10px; }
  .hero-stage { aspect-ratio: 4 / 3; }
  .toolbar h2 { flex: 1 0 100%; }
  .search { margin-left: 0; max-width: none; flex: 1 0 100%; order: 3; }
  .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .card { flex-direction: row; align-items: center; gap: 14px; padding: 10px 0; }
  .card-art { width: 68px; flex: none; border-radius: 10px; }
  .card:hover .card-art { transform: none; box-shadow: var(--shadow-sm); }
  .card-info, .card-tag { display: none; }
  .card-meta { display: block; }
  .type-bars { grid-template-columns: repeat(2, 1fr); }
  .dl { grid-template-columns: 92px 1fr; }
  .stage-view { aspect-ratio: 4 / 3; }
  .check { padding: 9px 16px; }
}
@media (hover: none) {
  .card-info { display: none; }
  .card-meta { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
}
