/* ==========================================================
   Lin汵汵 · base styles
   Shared layout, navigation, buttons and public-page widgets
   ========================================================== */

:root {
  --rose: #ff7ba9;
  --rose-strong: #ec5b90;
  --rose-deep: #c73d6b;
  --blush: #ffd5e2;
  --cream: #fff8f4;
  --cream-2: #fffdfb;
  --paper: #fbf3ed;
  --paper-deep: #f5e8e0;
  --ink: #36242e;
  --ink-soft: #5f4856;
  --muted: #947d89;
  --muted-2: #b9a5ae;
  --lavender: #b7a1ff;
  --mint: #a8dfd9;
  --butter: #f6dfa9;
  --night: #150e1a;
  --night-2: #24142a;
  --line-dark: rgba(255, 255, 255, 0.12);
  --line-light: rgba(88, 50, 66, 0.13);
  --font-sans: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-en: "Georgia", "Times New Roman", serif;
  --shadow-soft: 0 28px 70px -36px rgba(59, 24, 40, 0.3);
  --shadow-card: 0 18px 48px -30px rgba(59, 24, 40, 0.32);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

::selection {
  color: #2b1720;
  background: var(--blush);
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--cream);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------------- Header ---------------- */

.site-header {
  position: relative;
  z-index: 100;
  width: 100%;
  height: 90px;
  padding: 0 clamp(22px, 4.2vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 44px);
}

.site-header--overlay {
  position: absolute;
  top: 0;
  left: 0;
  color: #fff8f4;
}

.site-header--solid {
  position: sticky;
  top: 0;
  color: var(--ink);
  background: rgba(251, 243, 237, 0.82);
  border-bottom: 1px solid rgba(98, 60, 76, 0.08);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.site-header--night {
  position: sticky;
  top: 0;
  color: #fff8f4;
  background: rgba(21, 14, 26, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-width: 0;
}

.brand__avatar {
  position: relative;
  width: 43px;
  height: 43px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 158, 193, 0.42));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 8px 24px -12px rgba(255, 127, 169, 0.8);
}

.brand__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brand__avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--night);
  border-radius: 50%;
  background: #ffb86c;
}

.site-header--solid .brand__avatar::after {
  border-color: var(--paper);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.brand__name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand__sub {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: currentColor;
  opacity: 0.52;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 12px);
}

.main-nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.04em;
  color: currentColor;
  opacity: 0.66;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  opacity: 1;
}

.main-nav a.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.site-header--solid .main-nav a.is-active {
  color: var(--rose-deep);
  background: rgba(236, 91, 144, 0.09);
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: currentColor;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.live-pill:hover {
  background: rgba(255, 255, 255, 0.09);
}

.site-header--solid .live-pill {
  border-color: rgba(104, 60, 79, 0.13);
  background: rgba(255, 255, 255, 0.55);
}

.live-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a899a0;
  box-shadow: 0 0 0 3px rgba(168, 153, 160, 0.14);
}

.live-pill[data-live-state="live"] {
  color: #ffb3cb;
  border-color: rgba(255, 120, 163, 0.44);
  background: rgba(255, 84, 143, 0.1);
}

.site-header--solid .live-pill[data-live-state="live"] {
  color: #c73566;
  background: rgba(255, 123, 169, 0.1);
}

.live-pill[data-live-state="live"] .live-pill__dot {
  background: #ff6e9f;
  box-shadow: 0 0 0 3px rgba(255, 110, 159, 0.2);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 110, 159, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(255, 110, 159, 0); }
}

.admin-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: currentColor;
  opacity: 0.62;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.site-header--solid .admin-link {
  border-color: rgba(104, 60, 79, 0.13);
}

.admin-link:hover {
  opacity: 1;
  transform: rotate(22deg);
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: currentColor;
  background: transparent;
  opacity: 0.7;
}

/* ---------------- Footer ---------------- */

.site-footer {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line-light);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.site-footer__left,
.site-footer__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--rose-strong);
}

.site-footer--night {
  border-top-color: rgba(255, 255, 255, 0.09);
  color: rgba(255, 248, 244, 0.45);
}

.site-footer--night a {
  color: rgba(255, 248, 244, 0.68);
}

.site-footer--night a:hover {
  color: var(--blush);
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  letter-spacing: 0.14em;
}

.footer-mark::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.btn--primary {
  color: #381521;
  background: linear-gradient(135deg, #ffd2e0, #ff99bc);
  box-shadow: 0 12px 28px -16px rgba(255, 108, 158, 0.8);
}

.btn--primary:hover {
  box-shadow: 0 16px 32px -16px rgba(255, 108, 158, 0.9);
}

.btn--dark {
  color: #fff8f4;
  background: #3e2532;
}

.btn--dark:hover {
  background: #543043;
}

.btn--ghost {
  border-color: var(--line-light);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 123, 169, 0.07);
  border-color: rgba(236, 91, 144, 0.28);
}

.btn--soft {
  color: var(--rose-deep);
  border-color: rgba(236, 91, 144, 0.16);
  background: rgba(255, 123, 169, 0.08);
}

.btn--soft:hover {
  background: rgba(255, 123, 169, 0.14);
}

.btn--block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-light);
  border-radius: 50%;
  color: inherit;
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 91, 144, 0.32);
  background: rgba(255, 123, 169, 0.08);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
}

/* ---------------- Form controls ---------------- */

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid rgba(91, 54, 70, 0.15);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input,
.select {
  min-height: 45px;
  padding: 0 14px;
}

.textarea {
  min-height: 122px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.7;
}

.input::placeholder,
.textarea::placeholder {
  color: #b8a5ad;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(236, 91, 144, 0.28);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--rose);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 123, 169, 0.11);
}

.form-hint {
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- Dialog ---------------- */

.modal {
  width: min(92vw, 540px);
  max-height: min(88vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  background: var(--cream-2);
  box-shadow: 0 36px 90px -28px rgba(38, 14, 27, 0.58);
  overflow: auto;
}

.modal[open] {
  animation: modalIn 0.32s var(--ease-out);
}

.modal::backdrop {
  background: rgba(26, 14, 24, 0.64);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdropIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 18px;
}

.modal__eyebrow {
  margin-bottom: 5px;
  color: var(--rose-strong);
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.modal__title {
  font-size: 25px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.modal__sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.modal__close {
  flex: none;
}

.modal__body {
  padding: 4px 30px 30px;
}

.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal--wide {
  width: min(94vw, 720px);
}

.modal--video {
  width: min(96vw, 1060px);
  max-height: 94vh;
  color: #fff8f4;
  background: #120b16;
}

.modal--video .modal__head {
  padding: 20px 24px 14px;
}

.modal--video .modal__title {
  font-size: 20px;
}

.modal--video .modal__eyebrow {
  color: var(--blush);
}

.modal--video .modal__sub {
  color: rgba(255, 248, 244, 0.56);
}

.modal--video .modal__body {
  padding: 0 24px 24px;
}

.modal--video .icon-button {
  border-color: rgba(255, 255, 255, 0.16);
}

.video-shell {
  overflow: hidden;
  border-radius: 16px;
  background: #050308;
  aspect-ratio: 16 / 9;
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050308;
}

.video-description {
  max-width: 780px;
  margin-top: 13px;
  color: rgba(255, 240, 246, 0.5);
  font-size: 11px;
  line-height: 1.8;
}

.video-description:empty {
  display: none;
}

/* ---------------- Toast ---------------- */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  color: #fff8f4;
  background: rgba(43, 25, 38, 0.94);
  box-shadow: 0 18px 45px -18px rgba(28, 12, 23, 0.7);
  backdrop-filter: blur(14px);
  font-size: 13px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease-out);
}

.toast.is-leaving {
  animation: toastOut 0.25s ease forwards;
}

.toast__mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
  border-radius: 50%;
  color: #3d1a27;
  background: var(--blush);
  font-size: 11px;
  font-weight: 800;
}

.toast[data-type="error"] .toast__mark {
  color: #fff;
  background: #d6537b;
}

.toast[data-type="success"] .toast__mark {
  color: #163b33;
  background: var(--mint);
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px); }
}

/* ---------------- Shared visual utilities ---------------- */

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--rose-strong);
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.text-serif {
  font-family: var(--font-serif);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--rose-strong);
  background: rgba(255, 123, 169, 0.09);
}

.empty-state h3 {
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  max-width: 360px;
  font-size: 12px;
}

.loading-dots {
  display: inline-flex;
  gap: 5px;
}

.loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: dotBounce 1s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.13s; }
.loading-dots span:nth-child(3) { animation-delay: 0.26s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ---------------- Responsive header ---------------- */

@media (max-width: 1080px) {
  .site-header {
    height: 78px;
  }

  .main-nav a {
    padding: 8px 11px;
    font-size: 12px;
  }

  .brand__sub {
    display: none;
  }

  .live-pill span:not(.live-pill__dot) {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .site-header {
    height: 68px;
    padding: 0 18px;
    gap: 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand__avatar {
    width: 36px;
    height: 36px;
  }

  .brand__name {
    font-size: 14px;
  }

  .main-nav {
    position: fixed;
    top: 68px;
    left: 12px;
    right: 12px;
    z-index: 120;
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line-light);
    border-radius: 20px;
    color: var(--ink);
    background: rgba(255, 249, 245, 0.97);
    box-shadow: 0 24px 60px -20px rgba(48, 22, 35, 0.32);
    backdrop-filter: blur(18px);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .main-nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--ink);
    opacity: 0.8;
  }

  .main-nav a.is-active {
    color: var(--rose-deep);
    background: rgba(255, 123, 169, 0.1);
  }

  .main-nav a.is-active::after {
    left: auto;
    right: 16px;
    bottom: 50%;
    transform: translateY(50%);
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .admin-link {
    display: none;
  }

  .live-pill {
    height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .header-actions {
    gap: 7px;
  }

  .site-footer {
    width: calc(100% - 36px);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 10px;
  }

  .modal__head {
    padding: 22px 22px 14px;
  }

  .modal__body {
    padding: 4px 22px 24px;
  }

  .toast-stack {
    right: 18px;
    bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
