:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #172121;
  --muted: #6a7477;
  --line: #dde5e7;
  --green: #16b968;
  --green-dark: #098a4c;
  --gold: #d99b28;
  --red: #a83246;
  --blue: #2776d8;
  --shadow: 0 14px 38px rgba(16, 31, 37, .10);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

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

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
}

.app-shell.is-login {
  background: #fff;
}

.app-frame {
  min-height: 100vh;
}

.app-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 14px 92px;
}

.is-login .app-main {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.mobile-header strong {
  font-size: 16px;
}

.mobile-header span {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  min-height: 64px;
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.desktop-nav {
  display: none;
}

.nav-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #596467;
  background: transparent;
  border-radius: 8px;
}

.nav-item span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
}

.nav-item svg {
  width: 21px;
  height: 21px;
}

.nav-item.is-active {
  color: var(--green-dark);
  background: #e8f7ef;
}

.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #111;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .20), rgba(0, 0, 0, .64));
}

.hero-content {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 28px;
  color: #fff;
}

.eyebrow,
.page-title p,
.admin-header p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.hero h1,
.page-title h1,
.profile-panel h1,
.admin-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.hero p {
  max-width: 560px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .86);
  line-height: 1.7;
}

.primary-action,
.pill-button,
.ghost-button,
.admin-link,
.tools button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-action {
  margin-top: 20px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(22, 185, 104, .28);
}

.content-section {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head p,
.page-title span,
.media-info p,
.service-body p,
.profile-panel p,
.admin-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

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

.quick-card,
.profile-grid button,
.admin-panel,
.service-card,
.media-card,
.gift-card,
.feature-tile {
  background: var(--panel);
  border: 1px solid rgba(221, 229, 231, .72);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(20, 36, 41, .06);
}

.quick-card {
  position: relative;
  min-height: 116px;
  padding: 16px;
  text-align: left;
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card strong {
  font-size: 16px;
}

.quick-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.quick-card svg {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: var(--green-dark);
}

.feature-strip {
  display: grid;
  gap: 12px;
}

.feature-tile {
  overflow: hidden;
}

.feature-tile img,
.feature-tile video {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
}

.feature-tile div {
  padding: 14px;
}

.feature-tile span,
.gift-body span,
.media-badge,
.service-cover span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.feature-tile h3,
.service-body h3,
.media-info h3,
.gift-body h3 {
  margin: 9px 0 0;
  font-size: 17px;
}

.feature-tile p,
.gift-body p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.page-title {
  margin-bottom: 16px;
  padding: 4px 2px;
}

.service-list {
  display: grid;
  gap: 12px;
}

.service-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.service-cover {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #dfe8eb;
}

.service-cover img,
.service-cover video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.service-cover span {
  position: absolute;
  left: 7px;
  top: 7px;
  background: var(--gold);
}

.service-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.service-meta strong {
  color: #e77a1b;
}

.service-meta small,
.media-info small,
.gift-body small {
  color: #879195;
}

.pill-button {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--blue);
}

.media-grid,
.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.media-card,
.gift-card {
  overflow: hidden;
}

.media-cover {
  position: relative;
  background: #111;
}

.media-cover img,
.media-cover video,
.gift-card > img,
.gift-card > video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.media-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  background: var(--green-dark);
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, .46);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
}

.media-info,
.gift-body {
  padding: 12px;
}

.gift-body div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.gift-body .pill-button {
  grid-column: auto;
  min-height: 34px;
  padding: 0 14px;
}

.profile-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mine-guest {
  position: relative;
  grid-template-columns: 86px minmax(0, 1fr) 32px;
  align-items: center;
  box-shadow: none;
  background: transparent;
}

.mine-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #b9c3c6;
  background: transparent;
}

.mine-arrow svg {
  width: 18px;
  height: 18px;
}

.login-prompt {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 2px;
  padding: 22px 16px;
  background: #fff;
  border: 1px solid rgba(221, 229, 231, .72);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(20, 36, 41, .06);
}

.login-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-prompt .primary-action {
  min-width: 150px;
  margin-top: 0;
}

.login-page {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: start center;
  padding-top: 10px;
  background: #fff;
  border-radius: var(--radius);
}

.login-card {
  width: min(100%, 420px);
  padding: 8px 22px 32px;
  text-align: center;
}

.login-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #41c9ea, #8ce58c);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(37, 178, 151, .24);
}

.login-logo span {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  min-height: 52px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #edf1f2;
}

.login-form label span {
  display: grid;
  place-items: center;
  color: #f0bd48;
}

.login-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.login-form input::placeholder {
  color: #9aa3a6;
}

.login-form input.is-error {
  color: var(--red);
}

.login-form label:has(input.is-error) {
  border-bottom-color: rgba(168, 50, 70, .42);
}

.login-error {
  min-height: 0;
  margin-top: 4px;
  padding: 0;
  color: var(--red);
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.login-error.is-visible {
  min-height: 20px;
  opacity: 1;
  transform: translateY(0);
}

#send-code {
  min-height: 30px;
  padding: 0 10px;
  color: #f1a11d;
  background: #fff;
  border: 1px solid #f1c45b;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

#send-code:disabled {
  color: #a5b0b4;
  border-color: #dce4e6;
}

.login-submit {
  width: min(100%, 260px);
  margin: 28px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #b6e99b, #32cf68);
}

.login-note {
  margin: 26px 0 0;
  color: #879195;
  font-size: 13px;
  line-height: 1.6;
}

.login-note strong,
.login-note span {
  display: block;
}

.login-note strong {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 500;
}

.login-note span {
  color: #a4adb1;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 100;
  max-width: calc(100vw - 40px);
  padding: 10px 14px;
  color: #fff;
  background: rgba(17, 24, 25, .92);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.avatar-ring {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: #ecf7f1;
  border-radius: 50%;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profile-grid button {
  min-height: 72px;
  background: var(--panel);
  font-weight: 700;
}

.admin-link {
  color: #fff;
  background: var(--text);
}

.admin-body {
  background: #edf2f3;
}

.admin-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-header a,
.ghost-button,
.tools button,
.import-button {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.admin-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.admin-title {
  margin-bottom: 14px;
}

.admin-title h2 {
  margin: 0;
  font-size: 18px;
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.field,
.file-field {
  display: grid;
  gap: 7px;
}

.field span,
.file-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 185, 104, .12);
}

.file-field input {
  width: 100%;
}

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

.admin-tabs button {
  min-height: 42px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.admin-tabs button.is-active {
  color: #fff;
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.admin-actions,
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.import-button input {
  display: none;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 58px 58px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row img,
.admin-row video {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.admin-row strong,
.admin-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-row button {
  min-height: 36px;
  border-radius: 8px;
  background: #eef4f5;
}

.media-fallback {
  aspect-ratio: 3 / 4;
  background: #dfe8eb;
}

@media (min-width: 720px) {
  .app-main {
    padding: 78px 24px 112px;
  }

  .hero {
    min-height: 500px;
  }

  .hero-content {
    left: 36px;
    right: 36px;
    bottom: 42px;
  }

  .hero h1,
  .page-title h1,
  .profile-panel h1,
  .admin-header h1 {
    font-size: 34px;
  }

  .feature-strip,
  .gift-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .app-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .app-shell.is-login {
    display: block;
  }

  .desktop-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 14px;
    background: #111819;
    color: #fff;
  }

  .desktop-nav .brand {
    padding: 10px 10px 20px;
  }

  .desktop-nav .brand strong,
  .desktop-nav .brand span {
    display: block;
  }

  .desktop-nav .brand span {
    margin-top: 6px;
    color: rgba(255, 255, 255, .56);
    font-size: 13px;
  }

  .desktop-nav .nav-item {
    min-height: 48px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 10px;
    color: rgba(255, 255, 255, .72);
  }

  .desktop-nav .nav-item span {
    font-size: 14px;
  }

  .desktop-nav .nav-item.is-active {
    color: #fff;
    background: rgba(22, 185, 104, .24);
  }

  .desktop-nav > a {
    margin-top: auto;
    padding: 12px;
    color: rgba(255, 255, 255, .74);
  }

  .mobile-header,
  .mobile-nav {
    display: none;
  }

  .is-login .mobile-header {
    display: flex;
  }

  .app-main {
    padding: 28px 32px 48px;
  }

  .is-login .app-main {
    padding: 76px 0 0;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    min-height: 560px;
  }
}
