/* LootWeekly Prototype — 基础层：变量 / Reset / 布局 / 顶栏 / Hero */

:root {
  --bg: #070a10;
  --bg-soft: #0b1119;
  --surface: #111a27;
  --surface-2: #172232;
  --surface-3: #1d2a3d;
  --border: #22304a;
  --border-soft: #182231;
  --text: #e9eff8;
  --muted: #94a3ba;
  --faint: #6a7a92;
  --gold: #f6c445;
  --gold-2: #ffe08a;
  --gold-deep: #b6892a;
  --blue: #4aa8ff;
  --green: #3ddc97;
  --red: #ff6b6b;
  --purple: #b07bff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --container: 1180px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.35);
  --header-h: 62px;
}

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

/* clip 只裁切横向溢出，不创建滚动容器；hidden 会让顶栏/页内导航的 sticky 失效 */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(246, 196, 69, 0.09), transparent 70%),
    radial-gradient(700px 420px at 4% 8%, rgba(74, 168, 255, 0.07), transparent 70%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-2);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-weight: 800;
}

h1 {
  font-size: clamp(1.85rem, 4.2vw, 3rem);
}

h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

li {
  margin-bottom: 0.45em;
}

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

::selection {
  background: rgba(246, 196, 69, 0.28);
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

main {
  position: relative;
  z-index: 1;
  padding-bottom: 72px;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.83rem; }
.tiny { font-size: 0.74rem; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: "Cascadia Mono", Consolas, monospace; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 16, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover { color: var(--text); text-decoration: none; }

.logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  color: #22190a;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.35), 0 6px 16px rgba(246, 196, 69, 0.28);
}

.logo__dot { color: var(--gold); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav__link:hover { color: var(--text); background: var(--surface); text-decoration: none; }

.nav__link[aria-current="page"] {
  color: var(--gold);
  background: rgba(246, 196, 69, 0.1);
  box-shadow: inset 0 0 0 1px rgba(246, 196, 69, 0.22);
}

.header-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  padding: 6px 11px;
  border: 1px solid rgba(61, 220, 151, 0.28);
  border-radius: var(--radius-pill);
  background: rgba(61, 220, 151, 0.08);
  flex-shrink: 0;
}

.header-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 38px 0 32px;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 520px;
  background: radial-gradient(closest-side, rgba(246, 196, 69, 0.16), transparent);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 40px;
  align-items: start;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--faint);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb span[aria-hidden] { color: #37465c; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.hero h1 { margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: var(--gold); }

.lede {
  font-size: 1.04rem;
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 20px;
}

.updated-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--muted);
}

.updated-bar strong { color: var(--text); font-weight: 700; }
.updated-bar__sep { width: 1px; height: 12px; background: var(--border); }
.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* 倒计时面板 */
.reset-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--surface-2), var(--surface) 65%);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.reset-panel::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(closest-side, rgba(246, 196, 69, 0.22), transparent);
}

.reset-panel__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.cd-cell {
  text-align: center;
  background: rgba(7, 10, 16, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 4px 7px;
}

.cd-num {
  display: block;
  font-size: 1.42rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--gold-2);
  line-height: 1.1;
}

.cd-unit {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 2px;
}

.week-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 8px;
}

.week-bar__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-2));
  transition: width 0.6s ease;
}

.reset-panel__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---------- 跳转导航 ---------- */
.jump {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(7, 10, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.jump__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.jump__inner::-webkit-scrollbar { display: none; }

.jump a {
  flex: 0 0 auto;
  padding: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--faint);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.jump a:hover { color: var(--text); text-decoration: none; }
.jump a.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 区块 ---------- */
.section {
  padding: 44px 0 4px;
  scroll-margin-top: calc(var(--header-h) + 50px);
}

.section--tight { padding-top: 28px; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.section__head h2 { margin-bottom: 0; }
.section__meta { font-size: 0.76rem; color: var(--faint); }

.section__intro {
  color: var(--muted);
  max-width: 74ch;
  margin: 6px 0 20px;
}

/* ---------- 响应式 ---------- */
/* 6 个导航项 + 品牌 + 状态徽章在 961–1080px 会挤爆，先只隐藏徽章 */
@media (max-width: 1080px) {
  .header-live { display: none; }
}

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 26px; }
  .nav-toggle { display: flex; }
  .header-live { display: none; }

  /* backdrop-filter 会让 header 成为 fixed 子元素的包含块，移动端必须关掉 */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #070a10;
  }

  .nav {
    position: fixed;
    top: var(--drawer-top, var(--header-h));
    right: 0;
    bottom: 0;
    width: min(300px, 86vw);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px;
    margin: 0;
    background: #0a1119;
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.55);
    overflow-y: auto;
    z-index: 55;
    display: none;
  }

  body.nav-open .nav { display: flex; animation: drawerIn 0.24s ease; }
  /* clip 不创建滚动容器，避免像 hidden 那样让顶栏 sticky 失效 */
  body.nav-open { overflow: clip; }

  @keyframes drawerIn {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
  }

  .nav__link {
    padding: 12px 14px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 640px) {
  .container, .site-header__inner, .jump__inner { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 26px; }
  .cd-num { font-size: 1.2rem; }
}
