/* ==========================================================================
   星环投票 VoteOrbit — 视觉系统
   深空极光主题 · CSS 3D 透视 · 玻璃拟态
   ========================================================================== */

:root {
  --bg-0: #04050d;
  --bg-1: #080b18;
  --bg-2: #0d1122;

  --surface: rgba(255, 255, 255, 0.042);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.16);

  --text: #eef1ff;
  --text-2: #a6aecf;
  --text-3: #6d7597;

  --a1: #7c5cff;
  --a1-soft: rgba(124, 92, 255, 0.18);
  --a2: #22d3ee;
  --a2-soft: rgba(34, 211, 238, 0.16);
  --a3: #ff5c8a;
  --gold: #ffc93c;
  --silver: #cbd5e1;
  --bronze: #e79a5a;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.7);
  --shadow: 0 18px 46px -20px rgba(0, 0, 0, 0.95), 0 2px 6px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 90px -32px rgba(0, 0, 0, 1), 0 4px 12px -4px rgba(0, 0, 0, 0.7);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --inset-lo: inset 0 -1px 0 rgba(0, 0, 0, 0.4);

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clip 而不是 hidden —— hidden 会创建滚动容器，把 sticky 顶栏弄坏 */
  overflow-x: clip;
}

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- 背景层 */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(124, 92, 255, 0.24), transparent 62%),
    radial-gradient(1000px 620px at 88% 4%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(255, 92, 138, 0.14), transparent 62%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 45%, var(--bg-0));
}

/* 缓慢漂移的极光团 */
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: drift 26s var(--ease) infinite alternate;
}

.aurora.a-1 {
  width: 46vmax;
  height: 46vmax;
  left: -14vmax;
  top: -16vmax;
  background: radial-gradient(circle at 40% 40%, rgba(124, 92, 255, 0.9), transparent 68%);
}

.aurora.a-2 {
  width: 40vmax;
  height: 40vmax;
  right: -12vmax;
  top: 4vmax;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.75), transparent 68%);
  animation-duration: 32s;
  animation-delay: -8s;
}

.aurora.a-3 {
  width: 42vmax;
  height: 42vmax;
  left: 30%;
  bottom: -22vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 92, 138, 0.62), transparent 68%);
  animation-duration: 38s;
  animation-delay: -16s;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.14); }
  100% { transform: translate3d(-5vmax, 7vmax, 0) scale(0.94); }
}

/* 细腻网格，撑出纵深 */
.bg-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(620px) rotateX(62deg);
  transform-origin: center 30%;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 12%, transparent 78%);
  opacity: 0.55;
  animation: gridflow 24s linear infinite;
}

@keyframes gridflow {
  from { background-position: 0 0; }
  to { background-position: 0 62px; }
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 内容层 */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-narrow { max-width: 880px; }
.wrap-wide { max-width: 1560px; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  background: linear-gradient(180deg, rgba(6, 8, 18, 0.86), rgba(6, 8, 18, 0.55));
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--a1), #4b32d8 55%, #2a1a8f);
  box-shadow: var(--inset-hi), 0 8px 20px -8px rgba(124, 92, 255, 0.9);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.brand-mark svg { width: 21px; height: 21px; }
.brand:hover .brand-mark { transform: rotateY(24deg) rotateX(-10deg) scale(1.06); }

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font-size: 15.5px; font-weight: 700; }
.brand-text span { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.16em; text-transform: uppercase; }

.topbar-spacer { flex: 1; }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 8px 13px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-3); box-shadow: var(--inset-hi); }

/* ---------------------------------------------------------------- 面板 */

.panel {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.022));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inset-hi);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.28), transparent 38%, transparent 62%, rgba(124, 92, 255, 0.24));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel-pad { padding: 26px; }
.panel-tight { padding: 18px; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.panel-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.panel-head .grow { flex: 1; }

/* ---------------------------------------------------------------- 排版 */

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.015em; }

.display {
  font-size: clamp(34px, 6.4vw, 76px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  background: linear-gradient(140deg, #fff 8%, #cdd4ff 42%, #8ea4ff 68%, var(--a2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.lede {
  font-size: clamp(14.5px, 1.55vw, 17.5px);
  color: var(--text-2);
  max-width: 62ch;
  margin: 18px 0 0;
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--a2);
  margin: 0 0 16px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--a2));
}

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

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

.btn {
  --_bg: var(--surface-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--_bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transform-style: preserve-3d;
  box-shadow: var(--inset-hi), 0 6px 16px -10px rgba(0, 0, 0, 0.9);
  transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease), background 0.22s var(--ease),
    border-color 0.22s var(--ease);
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-2);
  background: var(--surface-3);
  box-shadow: var(--inset-hi), 0 14px 28px -14px rgba(0, 0, 0, 1);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: var(--inset-lo), 0 2px 6px -3px rgba(0, 0, 0, 0.9);
}

.btn:disabled { opacity: 0.42; cursor: not-allowed; filter: saturate(0.6); }

.btn-primary {
  background: linear-gradient(150deg, #8f72ff, var(--a1) 46%, #5636e0);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  text-shadow: 0 1px 2px rgba(20, 8, 60, 0.5);
  box-shadow: var(--inset-hi), 0 14px 32px -12px rgba(124, 92, 255, 0.95);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(150deg, #9c82ff, #8366ff 46%, #6242ec);
  box-shadow: var(--inset-hi), 0 20px 42px -14px rgba(124, 92, 255, 1);
}

.btn-cyan {
  background: linear-gradient(150deg, #5ee7f5, var(--a2) 46%, #0891b2);
  border-color: rgba(255, 255, 255, 0.24);
  color: #04222b;
  font-weight: 700;
  box-shadow: var(--inset-hi), 0 14px 32px -12px rgba(34, 211, 238, 0.9);
}

.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); }

.btn-danger {
  background: linear-gradient(150deg, #ff8ba3, #f43f5e 55%, #be123c);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { padding: 15px 30px; font-size: 15.5px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- 表单 */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }

.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.label .hint {
  font-weight: 400;
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: rgba(4, 6, 16, 0.6);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-shadow: inset 0 2px 6px -3px rgba(0, 0, 0, 0.9);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.input::placeholder,
.textarea::placeholder { color: var(--text-3); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.75);
  background: rgba(8, 10, 24, 0.85);
  box-shadow: 0 0 0 3.5px var(--a1-soft), inset 0 2px 6px -3px rgba(0, 0, 0, 0.9);
}

.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }

/* ------------------------------------------------------------ 图片拖拽上传 */

.uploader {
  position: relative;
  border-radius: var(--r);
  border: 1.5px dashed var(--line-2);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.uploader:hover { border-color: rgba(124, 92, 255, 0.6); }

.uploader.is-over {
  border-color: var(--a1);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.08));
  transform: scale(1.012);
  box-shadow: 0 0 0 4px var(--a1-soft);
}

.uploader-empty { padding: 30px 20px; text-align: center; }

.uploader-empty .up-ico {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--a2);
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.34);
}

.uploader-empty .up-ico svg { width: 23px; height: 23px; }
.uploader-empty .up-title { font-size: 14.5px; font-weight: 620; }
.uploader-empty .up-sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

.uploader-preview { position: relative; aspect-ratio: 16 / 10; }
.uploader-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.uploader-preview .up-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 13, 0.88));
}

.uploader-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.uploader-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  transition: width 0.28s var(--ease-out);
}

.uploader-meta { font-size: 12px; color: var(--text-3); min-height: 16px; }

.uploader-alt { margin-top: 4px; }

.uploader-alt summary {
  font-size: 12.5px;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
  padding: 5px 0;
  user-select: none;
  transition: color 0.2s var(--ease);
}

.uploader-alt summary::-webkit-details-marker { display: none; }

.uploader-alt summary::before {
  content: '›';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.2s var(--ease);
}

.uploader-alt[open] summary::before { transform: rotate(90deg); }
.uploader-alt summary:hover { color: var(--a2); }
.uploader-alt .input { margin-top: 8px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23a6aecf' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
  cursor: pointer;
}

.select option { background: #0b0e1e; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }

/* 分段选择器：投票模式的视觉核心控件 */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: var(--r-sm);
  background: rgba(4, 6, 16, 0.6);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 8px -4px rgba(0, 0, 0, 0.95);
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  transition: all 0.22s var(--ease);
  border: 1px solid transparent;
}

.segmented label small { font-size: 10.5px; font-weight: 400; color: var(--text-3); }

.segmented input:checked + label {
  background: linear-gradient(155deg, rgba(124, 92, 255, 0.34), rgba(124, 92, 255, 0.14));
  border-color: rgba(124, 92, 255, 0.5);
  color: #fff;
  box-shadow: var(--inset-hi), 0 8px 20px -12px rgba(124, 92, 255, 1);
}

.segmented input:checked + label small { color: rgba(255, 255, 255, 0.65); }
.segmented input:focus-visible + label { outline: 2px solid var(--a2); outline-offset: 2px; }

/* 开关 */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch-track {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 2px 6px -2px rgba(0, 0, 0, 0.9);
  transition: all 0.26s var(--ease);
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff, #c3c9e0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: transform 0.26s var(--ease), background 0.26s var(--ease);
}

.switch input:checked + .switch-track {
  background: linear-gradient(120deg, var(--a1), #5636e0);
  border-color: rgba(255, 255, 255, 0.3);
}

.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch-text { font-size: 13.5px; }
.switch-text small { display: block; font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- 徽标 */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

.badge-ok { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.12); }
.badge-warn { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.12); }
.badge-danger { color: #fda4af; border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.12); }
.badge-violet { color: #c4b5fd; border-color: rgba(124, 92, 255, 0.45); background: rgba(124, 92, 255, 0.16); }
.badge-cyan { color: #67e8f9; border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.12); }
.badge-gold { color: #fde68a; border-color: rgba(255, 201, 60, 0.45); background: rgba(255, 201, 60, 0.14); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-live { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.9s infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------------------------------------------------------------- 3D 卡片 */

.tilt-scene { perspective: 1300px; perspective-origin: 50% 40%; }

.tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform 0.5s var(--ease-out), box-shadow 0.4s var(--ease);
  will-change: transform;
}

.tilt.is-active { transition: transform 0.08s linear, box-shadow 0.4s var(--ease); }

/* 作品卡 */
.work-card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow), var(--inset-hi);
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  isolation: isolate;
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px 300px at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.16), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.work-card:hover::after { opacity: 1; }

.work-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, #131832, #0a0d1c);
  overflow: hidden;
  transform: translateZ(14px);
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.7s var(--ease-out), filter 0.4s var(--ease);
  filter: saturate(1.02) contrast(1.03);
}

.work-card:hover .work-media img { transform: scale(1.09); }

.work-media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(320px 220px at 30% 20%, rgba(124, 92, 255, 0.3), transparent 70%),
    radial-gradient(280px 220px at 78% 76%, rgba(34, 211, 238, 0.22), transparent 72%);
  letter-spacing: -0.04em;
}

.work-media-fade {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 13, 0.92));
  pointer-events: none;
}

.work-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(6, 8, 20, 0.72);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  box-shadow: var(--inset-hi);
  transform: translateZ(34px);
}

.work-rank.r1 { background: linear-gradient(150deg, #ffe08a, var(--gold) 55%, #c98f00); color: #3d2800; border-color: rgba(255, 255, 255, 0.4); }
.work-rank.r2 { background: linear-gradient(150deg, #f1f5f9, var(--silver) 55%, #8896a8); color: #1e293b; border-color: rgba(255, 255, 255, 0.4); }
.work-rank.r3 { background: linear-gradient(150deg, #f6c08a, var(--bronze) 55%, #a25c22); color: #331a05; border-color: rgba(255, 255, 255, 0.35); }

.work-body { padding: 16px 17px 18px; transform: translateZ(24px); }

.work-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-author {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-desc {
  margin: 10px 0 0;
  font-size: 12.8px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--text-2);
}

/* 选中态 */
.work-card .select-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
  pointer-events: none;
  z-index: 4;
}

.work-check {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 20, 0.68);
  border: 1.5px solid var(--line-2);
  backdrop-filter: blur(10px);
  transform: translateZ(40px) scale(0.86);
  opacity: 0.55;
  transition: all 0.3s var(--ease-out);
}

.work-check svg { width: 16px; height: 16px; opacity: 0; transform: scale(0.5); transition: all 0.3s var(--ease-out); }

.work-card.is-selected .select-ring {
  border-color: rgba(124, 92, 255, 0.95);
  box-shadow: 0 0 0 4px var(--a1-soft), 0 24px 60px -22px rgba(124, 92, 255, 1);
}

.work-card.is-selected .work-check {
  opacity: 1;
  transform: translateZ(46px) scale(1);
  background: linear-gradient(150deg, #9c82ff, var(--a1) 55%, #5636e0);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px -8px rgba(124, 92, 255, 1);
}

.work-card.is-selected .work-check svg { opacity: 1; transform: scale(1); }
.work-card.is-selected { box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 92, 255, 0.5); }

.work-card.is-disabled { opacity: 0.44; filter: grayscale(0.6); cursor: not-allowed; }
.work-card.is-hidden-work { position: relative; }
.work-card.is-hidden-work::before {
  content: "已下架";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  background: rgba(6, 8, 20, 0.85);
  border: 1px solid var(--line-2);
  color: var(--text-3);
}

/* 投票选中时的「抬起」 */
.work-card.is-selected .work-media { transform: translateZ(24px); }
.work-card.is-selected .work-body { transform: translateZ(34px); }

/* ---------------------------------------------------------------- 作品墙 */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

/* 列表模式：更适合作品少但信息密的场景 */
.work-list { display: flex; flex-direction: column; gap: 14px; }

.work-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.work-row:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateX(4px); }
.work-row.is-selected { border-color: rgba(124, 92, 255, 0.8); background: rgba(124, 92, 255, 0.12); }

.work-row-thumb {
  width: 96px;
  height: 72px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(150deg, #131832, #0a0d1c);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.16);
}

.work-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-row h4 { margin: 0; font-size: 15px; }
.work-row .work-row-meta { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ---------------------------------------------------------------- 投票浮动条 */

.vote-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(130%);
  z-index: 60;
  width: min(720px, calc(100vw - 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), opacity 0.35s var(--ease);
}

.vote-dock.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

.vote-dock-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 15px 13px 20px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(150deg, rgba(22, 25, 48, 0.9), rgba(10, 12, 26, 0.88));
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 1), var(--inset-hi);
}

.vote-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.vote-count .slash { font-size: 15px; color: var(--text-3); font-weight: 600; }
.vote-count .max { font-size: 15px; color: var(--text-2); font-weight: 700; }

.vote-dock-meta { flex: 1; min-width: 0; }
.vote-dock-meta b { display: block; font-size: 13.5px; font-weight: 650; }
.vote-dock-meta span { font-size: 11.5px; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vote-progress { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 7px; }
.vote-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width 0.45s var(--ease-out); width: 0; }

/* ---------------------------------------------------------------- 领奖台 / 结果 */

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 18px;
  padding: 30px 0 0;
  perspective: 1500px;
  perspective-origin: 50% 0%;
}

.podium-slot { display: flex; flex-direction: column; align-items: center; transform-style: preserve-3d; }
.podium-slot.p2 { order: 1; }
.podium-slot.p1 { order: 2; }
.podium-slot.p3 { order: 3; }

.podium-card {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  margin-bottom: 14px;
  backdrop-filter: blur(14px);
}

.podium-avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 10px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(150deg, #16193a, #0a0d1c);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset-hi);
}

.podium-avatar img { width: 100%; height: 100%; object-fit: cover; }
.podium-card h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.podium-card .votes { font-size: 25px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.podium-block {
  width: 100%;
  border-radius: 12px 12px 0 0;
  position: relative;
  border: 1px solid var(--line-2);
  border-bottom: none;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--inset-hi), 0 -18px 44px -20px rgba(0, 0, 0, 1);
  transition: height 1s var(--ease-out);
  overflow: hidden;
}

.podium-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 42%);
  pointer-events: none;
}

.p1 .podium-block { background: linear-gradient(180deg, rgba(255, 201, 60, 0.42), rgba(255, 201, 60, 0.04)); border-color: rgba(255, 201, 60, 0.5); }
.p2 .podium-block { background: linear-gradient(180deg, rgba(203, 213, 225, 0.36), rgba(203, 213, 225, 0.03)); border-color: rgba(203, 213, 225, 0.42); }
.p3 .podium-block { background: linear-gradient(180deg, rgba(231, 154, 90, 0.36), rgba(231, 154, 90, 0.03)); border-color: rgba(231, 154, 90, 0.42); }

.p1 .podium-block { height: 178px; }
.p2 .podium-block { height: 132px; }
.p3 .podium-block { height: 104px; }

.p1 .podium-card { border-color: rgba(255, 201, 60, 0.55); box-shadow: 0 30px 70px -26px rgba(255, 201, 60, 0.6); }
.p2 .podium-card { border-color: rgba(203, 213, 225, 0.4); }
.p3 .podium-card { border-color: rgba(231, 154, 90, 0.4); }

/* 榜单 */
/* ------------------------------------------------------------ 完整榜单（条形图） */

.rank-list { display: flex; flex-direction: column; gap: 10px; }

.rank-row {
  --pct: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 46px 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014));
  overflow: hidden;
  /* 关键：让 z-index:-1 的条形图层落在「行背景之上、内容之下」 */
  isolation: isolate;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.rank-row:hover {
  transform: translateY(-2px) translateZ(0);
  border-color: var(--line-2);
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 1);
}

.rank-track { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.rank-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--pct);
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.36), rgba(124, 92, 255, 0.2) 58%, rgba(34, 211, 238, 0.26));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  transition: width 0.9s var(--ease-out);
}

/* 条形末端的高光「帽子」，让条形有厚度和方向感。
   它必须挂在 .rank-fill 里面，right:0 才是条形的末端而不是整行的末端。 */
.rank-cap {
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--a2), var(--a1));
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
}

.rank-row.is-lead { border-color: rgba(255, 201, 60, 0.34); }

.rank-row.is-lead .rank-fill {
  background: linear-gradient(90deg, rgba(255, 201, 60, 0.38), rgba(255, 201, 60, 0.19) 58%, rgba(255, 92, 138, 0.24));
}

.rank-row.is-lead .rank-cap {
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  box-shadow: 0 0 16px rgba(255, 201, 60, 0.8);
}

.rank-no {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: rgba(6, 8, 20, 0.62);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset-hi);
}

.rank-no.r1 { background: linear-gradient(150deg, #ffe08a, var(--gold) 55%, #c98f00); color: #3d2800; }
.rank-no.r2 { background: linear-gradient(150deg, #f1f5f9, var(--silver) 55%, #8896a8); color: #1e293b; }
.rank-no.r3 { background: linear-gradient(150deg, #f6c08a, var(--bronze) 55%, #a25c22); color: #331a05; }

.rank-thumb {
  position: relative;
  z-index: 1;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(150deg, #16193a, #0a0d1c);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--line);
}

.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }

.rank-info { position: relative; z-index: 1; min-width: 0; }

.rank-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-dim { flex-shrink: 0; font-size: 11px; color: var(--text-3); font-weight: 500; }

.rank-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 名次变化标记：票数一动就看得出来谁上去了、谁掉下来了 */
.rank-delta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  animation: deltaIn 0.45s var(--ease-out);
}

.rank-delta.up { color: #6ee7b7; background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.34); }
.rank-delta.down { color: #fca5a5; background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.3); }

@keyframes deltaIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.85); }
  to { opacity: 1; transform: none; }
}

.rank-score { position: relative; z-index: 1; text-align: right; }
.rank-score .rank-n { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.05; }
.rank-score .rank-pct { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 1px; }

/* 指标块 */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; }

.metric {
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.018));
  box-shadow: var(--inset-hi);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.3), transparent 70%);
  pointer-events: none;
}

.metric .k { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.metric .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: 5px; font-variant-numeric: tabular-nums; }
.metric .u { font-size: 13px; color: var(--text-2); font-weight: 600; margin-left: 3px; }

/* ---------------------------------------------------------------- 扫码区 */

.qr-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow), var(--inset-hi);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.qr-frame {
  position: relative;
  padding: 11px;
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9), var(--inset-hi);
}

.qr-frame svg { display: block; width: 100%; height: auto; }
.qr-frame .qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 22%;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--a1), #5636e0);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.qr-card .qr-link { font-size: 11.5px; color: var(--text-3); word-break: break-all; font-family: var(--mono); max-width: 100%; }

/* ---------------------------------------------------------------- 表格 */

.table-scroll { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }

table.data thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(8, 10, 22, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 2;
}

table.data tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.data tbody tr { transition: background 0.2s var(--ease); }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 提示 */

.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(560px, calc(100vw - 24px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 17px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: linear-gradient(150deg, rgba(24, 27, 52, 0.96), rgba(10, 12, 26, 0.94));
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 54px -20px rgba(0, 0, 0, 1);
  font-size: 13.5px;
  font-weight: 550;
  animation: toastIn 0.42s var(--ease-out);
  max-width: 100%;
}

.toast.out { animation: toastOut 0.3s var(--ease) forwards; }
.toast .ico { width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 800; }

.toast-ok .ico { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }
.toast-err .ico { background: rgba(251, 113, 133, 0.2); color: #fda4af; }
.toast-info .ico { background: rgba(34, 211, 238, 0.2); color: #67e8f9; }
.toast-ok { border-color: rgba(52, 211, 153, 0.35); }
.toast-err { border-color: rgba(251, 113, 133, 0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* ---------------------------------------------------------------- 弹窗 */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(3, 4, 10, 0.76);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.26s var(--ease);
  overflow-y: auto;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: linear-gradient(165deg, rgba(18, 21, 42, 0.98), rgba(8, 10, 22, 0.99));
  box-shadow: 0 50px 110px -40px rgba(0, 0, 0, 1), var(--inset-hi);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.42s var(--ease-out);
}

.modal-wide { width: min(1000px, 100%); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 680; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: rgba(0, 0, 0, 0.2); }

/* ---------------------------------------------------------------- 空状态 */

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.015);
}

.empty .big { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty h3 { margin: 0 0 6px; color: var(--text-2); font-size: 16px; }
.empty p { margin: 0 auto; max-width: 46ch; font-size: 13.5px; }

/* ---------------------------------------------------------------- 骨架屏 */

.skeleton-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.045) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------------------------------------------------------- 首页 Hero */

.hero { padding: clamp(48px, 8vh, 100px) 0 40px; position: relative; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 34px; }

.feature {
  padding: 22px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: var(--inset-hi);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
  transform-style: preserve-3d;
}

.feature:hover { transform: translateY(-6px) rotateX(4deg) rotateY(-4deg); box-shadow: var(--shadow); border-color: var(--line-2); }

.feature .ico {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.28), rgba(34, 211, 238, 0.16));
  border: 1px solid var(--line-2);
  color: #c4b5fd;
  box-shadow: var(--inset-hi);
}

.feature .ico svg { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 7px; font-size: 15.5px; font-weight: 660; }
.feature p { margin: 0; font-size: 13.2px; color: var(--text-2); line-height: 1.65; }

/* ---------------------------------------------------------------- 步骤 */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; counter-reset: s; }

.step {
  position: relative;
  padding: 20px 20px 20px 22px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  counter-increment: s;
}

.step::before {
  content: counter(s, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--a2);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 9px;
}

.step h4 { margin: 0 0 6px; font-size: 14.5px; }
.step p { margin: 0; font-size: 12.8px; color: var(--text-2); line-height: 1.6; }

/* ---------------------------------------------------------------- 工具条 */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 20px;
}

.toolbar .grow { flex: 1; }
.toolbar .count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 3px; padding: 4px; border-radius: var(--r-sm); background: rgba(4, 6, 16, 0.55); border: 1px solid var(--line); }

.tab {
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}

.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: #fff; background: var(--surface-3); box-shadow: var(--inset-hi); }

/* ---------------------------------------------------------------- 飞入动画 */

.fly-chip {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, #9c82ff, var(--a1));
  box-shadow: 0 16px 36px -12px rgba(124, 92, 255, 1);
  transition: all 0.72s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.confetti {
  position: fixed;
  width: 9px;
  height: 9px;
  z-index: 290;
  pointer-events: none;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- 彩带横幅 */

.ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}

.ribbon.ribbon-ok { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.09); color: #a7f3d0; }
.ribbon.ribbon-warn { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.09); color: #fde68a; }
.ribbon.ribbon-danger { border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.09); color: #fecdd3; }
.ribbon .grow { flex: 1; }

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

.footer {
  margin-top: auto;
  padding: 30px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}

.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------- 打印墙 */

.print-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}

.print-tile {
  break-inside: avoid;
  page-break-inside: avoid;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #fff;
  color: #0b1020;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.print-tile .p-idx { font-size: 11px; letter-spacing: 0.16em; color: #6b7280; text-transform: uppercase; font-weight: 700; }
.print-tile .p-img { width: 100%; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: #eef1f7; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #b9c0d0; }
.print-tile .p-img img { width: 100%; height: 100%; object-fit: cover; }
.print-tile .p-title { font-size: 16px; font-weight: 750; line-height: 1.3; }
.print-tile .p-author { font-size: 12px; color: #6b7280; }
.print-tile .p-qr { width: 148px; height: 148px; }
.print-tile .p-qr svg { width: 100%; height: 100%; display: block; }
.print-tile .p-hint { font-size: 11px; color: #6b7280; line-height: 1.45; }
.print-tile .p-code { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: #111827; }

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .podium { gap: 10px; }
  .podium-block { font-size: 30px; }
  .p1 .podium-block { height: 132px; }
  .p2 .podium-block { height: 100px; }
  .p3 .podium-block { height: 78px; }
  .podium-avatar { width: 58px; height: 58px; border-radius: 16px; }
}

@media (max-width: 680px) {
  .wrap { padding: 0 15px; }
  .work-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; padding: 11px 13px; }
  .rank-no { width: 34px; height: 34px; border-radius: 10px; font-size: 13.5px; }
  .rank-thumb { display: none; }
  .rank-score .rank-n { font-size: 19px; }
  .rank-title { font-size: 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric .v { font-size: 23px; }
  .panel-pad { padding: 18px; }
  .nav-links .nav-link.opt { display: none; }
  .vote-dock-inner { padding: 11px 12px 11px 16px; gap: 12px; }
  .vote-count { font-size: 22px; }
  .work-row { grid-template-columns: 68px 1fr; }
  .work-row-thumb { width: 68px; height: 56px; }
  .modal-body { padding: 18px; }
  .hero { padding: 30px 0 20px; }
  .topbar-inner { height: 58px; gap: 8px; }
  .brand-text span { display: none; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .topbar { overflow: hidden; }
  .footer-inner { gap: 8px; }
}

@media (max-width: 420px) {
  .work-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .work-body { padding: 11px 12px 13px; }
  .work-title { font-size: 13.5px; }
  .work-desc { display: none; }
  .work-tags { display: none; }
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .tilt { transform: none !important; }
}

/* 打印 */
@media print {
  .bg-layer, .topbar, .footer, .no-print, .vote-dock { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { min-height: auto; }
  .print-sheet { gap: 8mm; grid-template-columns: repeat(3, 1fr); }
  .print-tile { border: 1px solid #d1d5db; box-shadow: none; }
  @page { margin: 10mm; }
}
