/* =========================================================
 * 花盏 · 发布页 —— 「渐变杂志」
 * 白底 + 紫蓝粉渐变（标题 / 色条 / 序号徽章），大留白、现代杂志感。
 * 亮色为默认，暗色保留（右上角切换，记忆在 localStorage）。
 * ========================================================= */

/* ---------- 亮色（默认） ---------- */
:root {
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --line: #E9EBF3;
  --line-2: #D8DCEA;
  --text: #14161C;
  --muted: #6B7180;
  --faint: #9AA1B2;

  --accent: #6C5CE7;
  --accent-ink: #4B3FD6;
  --accent-soft: #EFECFE;
  --grad: linear-gradient(120deg, #6C5CE7 0%, #4F8DFF 46%, #FF6B9A 100%);
  --grad-soft: linear-gradient(120deg, #EFECFE 0%, #E8F1FF 50%, #FFEBF2 100%);

  --ok: #12B76A;
  --bad: #F04438;
  --ghost: #EFF1F8;

  --shadow: 0 20px 44px rgba(76, 63, 190, .16);
  --shadow-soft: 0 6px 18px rgba(76, 63, 190, .08);

  --blob1: rgba(108, 92, 231, .17);
  --blob2: rgba(255, 107, 154, .15);
  --blob3: rgba(79, 141, 255, .15);
  --dot: rgba(108, 92, 231, .13);
  --toggle-bg: rgba(255, 255, 255, .82);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 暗色 ---------- */
[data-theme="dark"] {
  --bg: #0B0B12;
  --card: #14141D;
  --line: #23232F;
  --line-2: #313144;
  --text: #ECECF4;
  --muted: #9A9AB0;
  --faint: #6E6E86;

  --accent: #A79BFF;
  --accent-ink: #C9C2FF;
  --accent-soft: #1D1A33;
  --grad: linear-gradient(120deg, #8B7BFF 0%, #5C9BFF 46%, #FF7FA9 100%);

  --ok: #34D399;
  --bad: #F87171;
  --ghost: #1B1B26;

  --shadow: 0 20px 48px rgba(0, 0, 0, .55);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, .35);

  --blob1: rgba(108, 92, 231, .24);
  --blob2: rgba(255, 107, 154, .16);
  --blob3: rgba(79, 141, 255, .20);
  --dot: rgba(167, 155, 255, .18);
  --toggle-bg: rgba(255, 255, 255, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(920px 430px at 10% -10%, var(--blob1), transparent 62%),
    radial-gradient(780px 390px at 90% 2%, var(--blob2), transparent 60%),
    radial-gradient(720px 380px at 50% 108%, var(--blob3), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* ---------- 亮 / 暗切换 ---------- */
.theme-toggle {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 6;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  background: var(--toggle-bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(18deg);
}

/* ---------- 飘浮微粒 ---------- */
#petals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.petal {
  position: absolute;
  top: -6%;
  border-radius: 50%;
  background: var(--dot);
  animation: fall linear infinite;
  will-change: transform;
}
@keyframes fall {
  0%   { transform: translate3d(0, -6vh, 0); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate3d(var(--sway), 112vh, 0); opacity: 0; }
}

/* ---------- 版面 ---------- */
.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 86px 28px 58px;
  position: relative;
  z-index: 2;
}

header { text-align: center; }

.brand-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.seal {
  width: 52px;
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border-radius: 15px;
  box-shadow: 0 12px 28px rgba(108, 92, 231, .34);
  transform: rotate(-4deg);
}

h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(46px, 8vw, 74px);
  letter-spacing: -.035em;
  line-height: 1.05;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tagline {
  margin-top: 18px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .26em;
  text-indent: .26em;
}

.sub {
  margin-top: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
}

.divider {
  margin: 44px auto 40px;
  width: 190px;
  height: 2px;
  position: relative;
  border-radius: 2px;
  background: var(--grad);
  opacity: .55;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--grad);
  box-shadow: 0 0 0 5px var(--bg);
}

/* ---------- 站点卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 18px;
  min-height: 198px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .24s cubic-bezier(.22, .61, .36, 1), border-color .24s ease, box-shadow .24s ease;
}
.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .24s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: var(--shadow);
}
.card:hover::after { opacity: 1; }

.card .ghost {
  position: absolute;
  top: 4px;
  right: 14px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--ghost);
  transition: color .24s ease;
  user-select: none;
}

/* 序号徽章：六种渐变循环，像杂志的栏目色标 */
.card .idx {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(76, 63, 190, .22);
}
.card:nth-child(6n+1) .idx { background: linear-gradient(135deg, #6C5CE7, #4F8DFF); }
.card:nth-child(6n+2) .idx { background: linear-gradient(135deg, #FF6B9A, #FF9A6C); }
.card:nth-child(6n+3) .idx { background: linear-gradient(135deg, #4F8DFF, #38C6E8); }
.card:nth-child(6n+4) .idx { background: linear-gradient(135deg, #F5A623, #FF6B9A); }
.card:nth-child(6n+5) .idx { background: linear-gradient(135deg, #9B6BFF, #E85CFF); }
.card:nth-child(6n+6) .idx { background: linear-gradient(135deg, #12B76A, #4F8DFF); }

.card h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card .tag {
  display: inline-block;
  padding: 2px 9px;
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
}

.card p {
  flex: 1;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.card .go {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--accent);
}
.card .go i {
  font-style: normal;
  transition: transform .24s ease;
}
.card:hover .go i { transform: translateX(5px); }

.card .status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--faint);
}
.card .status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.card .status[data-state="on"] { color: var(--ok); }
.card .status[data-state="off"] { color: var(--bad); }
.card .status[data-state="on"]::before { animation: pulse 2.2s ease infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 62px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 2.2;
  color: var(--faint);
}

footer .sponsor { margin-top: 2px; }

footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  background-image: var(--grad);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  padding-bottom: 1px;
}
footer a:hover { color: var(--accent-ink); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .wrap { padding: 66px 18px 46px; }
  .brand-line { gap: 13px; }
  .seal { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }
  .tagline { letter-spacing: .16em; text-indent: .16em; font-size: 13px; }
  .theme-toggle { top: 14px; right: 14px; width: 38px; height: 38px; }
  .divider { margin: 34px auto 30px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 0; padding: 20px 18px 16px; }
  .card .ghost { font-size: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .petal { display: none; }
  * { animation: none !important; transition: none !important; }
}
