:root {
  --bg: #efefef;
  --bg-2: #eef1f8;
  --surface: #efefef;
  --text: #3b4152;
  --text-2: #7a8196;
  --text-3: #a3aabf;
  --accent: #ff7a5a;
  --accent-soft: rgba(255, 122, 90, .14);
  --gold: #e8b04b;
  --shadow-dark: rgba(163, 169, 191, .38);
  --shadow-light: rgba(255, 255, 255, .92);
  --sh-out: 5px 5px 12px var(--shadow-dark), -5px -5px 12px var(--shadow-light);
  --sh-out-sm: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  --sh-in: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  --sh-in-deep: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #23262e;
  --bg-2: #272b34;
  --surface: #23262e;
  --text: #e4e7ef;
  --text-2: #9097ab;
  --text-3: #6b7285;
  --accent: #ff8a6e;
  --accent-soft: rgba(255, 138, 110, .16);
  --shadow-dark: rgba(0, 0, 0, .42);
  --shadow-light: rgba(255, 255, 255, .045);
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
  overflow-x: hidden;
}

.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .14;
}
.blob.b1 {
  width: 320px; height: 320px; left: -110px; top: -60px;
  background: radial-gradient(circle, rgba(255,122,90,.22), transparent 70%);
}
.blob.b2 {
  width: 360px; height: 360px; right: -140px; top: 32%;
  background: radial-gradient(circle, rgba(120,160,255,.2), transparent 70%);
}
.blob.b3 {
  width: 300px; height: 300px; left: -80px; bottom: 4%;
  background: radial-gradient(circle, rgba(232,176,75,.18), transparent 70%);
}
[data-theme="dark"] .blob { opacity: .08; }

button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ol, ul { list-style: none; }

.page {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 18px calc(40px + env(safe-area-inset-bottom));
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-out);
  transition: background .35s ease, box-shadow .35s ease;
}

.block { margin-top: 26px; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  color: var(--text-2);
  transition: box-shadow .2s ease, color .2s ease, transform .15s ease;
}
.icon-btn:active { box-shadow: var(--sh-in); transform: scale(.94); }
.icon-btn .ico-moon { display: none; }
[data-theme="dark"] .icon-btn .ico-sun { display: none; }
[data-theme="dark"] .icon-btn .ico-moon { display: block; }

.subbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 16px;
}
.subbar-back { flex-shrink: 0; }
.subbar-title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subbar-theme { flex-shrink: 0; }

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

.nav-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: none;
  border: 1px solid rgba(128, 134, 155, .1);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  position: relative;
  overflow: hidden;
}
.win-card .nav-entry { box-shadow: var(--sh-out-sm); }
.nav-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .75;
}
.nav-entry.c-blue::before { background: #78a0ff; }
.nav-entry.c-gold::before { background: var(--gold); }
.nav-entry.c-coral::before { background: var(--accent); }
.nav-entry:active { transform: scale(.98); box-shadow: var(--sh-in); }

.nav-entry-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--bg-2);
  box-shadow: var(--sh-in);
}
.nav-entry-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.nav-entry.c-coral .nav-entry-ico { background: rgba(255,122,90,.14); }
.nav-entry.c-blue .nav-entry-ico { background: rgba(120,160,255,.16); }
.nav-entry.c-gold .nav-entry-ico { background: rgba(232,176,75,.16); }

.nav-entry-body { flex: 1; min-width: 0; }
.nav-entry-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .3px;
}
.nav-entry-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-entry-arrow {
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.22, 1, .36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

.panel-in {
  background: var(--bg-2);
  border-radius: 10px;
  box-shadow: var(--sh-out-sm);
  border: 1px solid rgba(128, 134, 155, .1);
  padding: 14px;
}

.win-card { overflow: hidden; }

.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(128, 134, 155, .12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent),
    linear-gradient(90deg, var(--accent-soft), transparent 60%);
}
.win-bar.accent {
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent),
    linear-gradient(90deg, rgba(120,160,255,.16), transparent 65%);
}
.win-bar.heart {
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent),
    linear-gradient(90deg, rgba(255,90,120,.14), transparent 70%);
}
.win-bar.gold {
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent),
    linear-gradient(90deg, rgba(232,176,75,.18), transparent 70%);
}
[data-theme="dark"] .win-bar,
[data-theme="dark"] .win-bar.accent,
[data-theme="dark"] .win-bar.heart,
[data-theme="dark"] .win-bar.gold {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    linear-gradient(90deg, var(--accent-soft), transparent 60%);
}

.win-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.win-title .wt-ico,
.win-title svg.wt-ico {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  max-width: 15px;
  flex-shrink: 0;
  display: block;
  color: var(--accent);
}
.weather-card .win-title .wt-ico { color: #3aa8c8; }
[data-theme="dark"] .weather-card .win-title .wt-ico { color: #7ed7f0; }
.win-title em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 1px;
}

.win-dots { display: flex; gap: 5px; flex-shrink: 0; }
.win-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
.win-dots i:nth-child(1) { background: #ff5f57; }
.win-dots i:nth-child(2) { background: #febc2e; }
.win-dots i:nth-child(3) { background: #28c840; }

.win-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.win-body { padding: 16px; }

.hero-card { padding: 24px 20px 16px; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.hero-card {
  position: relative;
  text-align: center;
}

.hero-theme {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding-right: 36px;
}

.hero-id { min-width: 0; flex: 1; }

.hero-badges { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }

.chip-mini {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.chip-mini.coral {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(255,122,90,.2);
}
.chip-mini.blue {
  color: #5a8dee;
  background: rgba(120,160,255,.16);
  box-shadow: inset 0 0 0 1px rgba(120,160,255,.25);
}
[data-theme="dark"] .chip-mini.blue { color: #8fb0ff; }

.hero-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
}
.hero-divider i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(128, 134, 155, .25), transparent);
}
.hero-divider em {
  font-style: normal;
  font-size: 11px;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-soft);
}

.avatar-ring {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--sh-out);
  display: grid;
  place-items: center;
  position: relative;
  padding: 6px;
}

.avatar-orbit {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 122, 90, .28);
  animation: orbitSpin 18s linear infinite;
  pointer-events: none;
}
@keyframes orbitSpin { to { transform: rotate(360deg); } }

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--sh-in);
  background: var(--bg-2);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}

.status-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4cd07d;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 0 rgba(76, 208, 125, .5);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 208, 125, .45); }
  70% { box-shadow: 0 0 0 8px rgba(76, 208, 125, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 208, 125, 0); }
}

.profile-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-in);
}

.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4cd07d;
}

.time-clock {
  font-size: 40px;
  font-weight: 200;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  background: linear-gradient(180deg, var(--text) 30%, var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.time-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.time-week {
  color: var(--accent);
  font-weight: 600;
}

.day-track {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--sh-in);
  overflow: hidden;
}

.day-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffb199);
  transition: width 1s ease;
}

.day-hint {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .5px;
}
.day-hint span { color: var(--accent); font-weight: 700; }

.hero-quote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(128, 134, 155, .22);
  text-align: left;
}
.hero-quote .hk-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  min-height: 2.4em;
  color: var(--text-2);
  quotes: none;
}
.hero-quote .hk-row { margin-top: 8px; }
.hero-quote .hk-from { font-size: 11.5px; }
.hero-quote .mini-btn { padding: 5px 12px; font-size: 11.5px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 10px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--sh-out-sm);
  border: 1px solid rgba(128, 134, 155, .08);
  transition: box-shadow .18s ease, transform .18s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.contact-btn::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity .18s ease, transform .18s ease;
}
.contact-btn:active {
  box-shadow: var(--sh-in);
  transform: scale(.96);
}
.contact-btn:active::after { opacity: 1; transform: scaleX(1); }

.contact-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--sh-in);
  overflow: hidden;
}
.contact-btn:nth-child(4n+1) .contact-ico { box-shadow: var(--sh-in), inset 0 0 0 2px rgba(255,122,90,.28); }
.contact-btn:nth-child(4n+2) .contact-ico { box-shadow: var(--sh-in), inset 0 0 0 2px rgba(120,160,255,.3); }
.contact-btn:nth-child(4n+3) .contact-ico { box-shadow: var(--sh-in), inset 0 0 0 2px rgba(232,176,75,.35); }
.contact-btn:nth-child(4n+4) .contact-ico { box-shadow: var(--sh-in), inset 0 0 0 2px rgba(76,208,125,.3); }
.contact-ico img { width: 24px; height: 24px; object-fit: contain; }

.contact-letter {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.contact-name {
  font-size: 11.5px;
  color: var(--text-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.split > .win-card { min-width: 0; }

.flip-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.flip-card .win-bar { flex-shrink: 0; }

.win-flip-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  transition: transform .45s ease, color .2s ease;
  flex-shrink: 0;
}
.flip-card.is-flipped .win-flip-ico {
  transform: rotate(180deg);
  color: var(--accent);
}

.flip-scene {
  flex: 1;
  perspective: 1200px;
  padding: 14px 12px 0;
}

.flip-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
.flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }

.flip-face {
  grid-area: 1 / 1;
  min-width: 0;
  position: relative;
  background: var(--surface);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: visibility 0s linear .55s;
}

.deco-sticker {
  position: absolute;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  z-index: 1;
}
.wc-sticker {
  top: 42px;
  right: 0;
  width: 52px;
  height: 52px;
}
.fc-sticker {
  top: 0;
  right: 0;
  width: 56px;
  height: auto;
  opacity: .92;
}
.flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.flip-card:not(.is-flipped) .flip-front,
.flip-card.is-flipped .flip-back {
  visibility: visible;
  transition-delay: 0s;
}
.flip-card.is-flipped .flip-front,
.flip-card:not(.is-flipped) .flip-back {
  visibility: hidden;
  transition-delay: .55s;
}

.flip-hint {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 10px 0 12px;
  margin-top: auto;
}
.flip-hint span {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-3);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: var(--sh-in);
  opacity: .85;
}

.weather-card .flip-scene { padding: 14px 12px 0; }

.weather-card .win-bar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent),
    linear-gradient(90deg, rgba(94,200,232,.18), transparent 65%);
}
.weather-card .win-title { font-size: 12.5px; }

.wc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: var(--sh-out-sm);
  gap: 6px;
}

.wc-city {
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-badge {
  font-size: 10px;
  color: #3aa8c8;
  background: rgba(94,200,232,.18);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
}
[data-theme="dark"] .wc-badge { color: #7ed7f0; }

.wc-main {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.wc-icon { width: 44px; height: 44px; object-fit: contain; }

.wc-temps { flex: 1; min-width: 0; width: 100%; }

.wc-temp {
  font-size: 30px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 1px;
}

.wc-cond { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.wc-back-label {
  display: inline-flex;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #3aa8c8;
  background: rgba(94,200,232,.14);
  border: 1px solid rgba(94,200,232,.28);
  padding: 3px 10px;
  border-radius: 999px;
}
[data-theme="dark"] .wc-back-label { color: #7ed7f0; }

.wc-detail {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
  min-height: 2.8em;
}

.wc-foot {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(128, 134, 155, .22);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.wc-error {
  font-size: 13px;
  color: var(--text-2);
  padding: 18px 0;
  text-align: center;
}

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sk-temp { width: 130px; height: 40px; }
.sk-line { width: 90px; height: 16px; margin-top: 10px; }

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

.flip-card .flip-scene { min-height: 168px; }

.fc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.fc-badge {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff9d72);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px var(--accent-soft);
  letter-spacing: 2px;
}

.fc-stars { display: flex; gap: 3px; align-items: center; }
.star {
  width: 14px;
  height: 14px;
  display: inline-flex;
  color: var(--text-3);
  opacity: .35;
  filter: grayscale(1);
  transition: transform .3s ease, color .3s ease;
}
.star svg {
  width: 100%;
  height: 100%;
  display: block;
}
.star.on {
  color: var(--gold);
  opacity: 1;
  filter: none;
  filter: drop-shadow(0 2px 6px rgba(232, 176, 75, .4));
}
.reveal.is-in .star.on { animation: starPop .45s cubic-bezier(.22,1,.36,1) both; }
.reveal.is-in .star.on:nth-child(2) { animation-delay: .05s; }
.reveal.is-in .star.on:nth-child(3) { animation-delay: .1s; }
.reveal.is-in .star.on:nth-child(4) { animation-delay: .15s; }
.reveal.is-in .star.on:nth-child(5) { animation-delay: .2s; }
@keyframes starPop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

.fc-dims { display: grid; gap: 8px; }

.dim-row {
  display: grid;
  grid-template-columns: 30px 1fr 26px;
  align-items: center;
  gap: 6px;
}

.dim-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--sh-in);
  overflow: hidden;
  padding: 1.5px;
}

.dim-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.bars-in .dim-track i,
#fortuneScores.bars-in .dim-track i { width: var(--w); }

.dim-track i.c1 { background: linear-gradient(90deg, #f0a08c, #ffc4b0); }
.dim-track i.c2 { background: linear-gradient(90deg, #8fb0f0, #b8ccf8); }
.dim-track i.c3 { background: linear-gradient(90deg, #b49ae8, #d0c0f5); }
.dim-track i.c4 { background: linear-gradient(90deg, #7dcf9a, #a8e0bc); }
.dim-track i.c5 { background: linear-gradient(90deg, #e0b86a, #f0d49a); }

.dim-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.dim-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fc-lucky {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.lucky-chip {
  flex: 1;
  min-width: 0;
  padding: 8px 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.lucky-chip.pink {
  background: rgba(255,122,90,.12);
  border-color: rgba(255,122,90,.22);
  color: var(--accent);
  box-shadow: var(--sh-out-sm);
}
.lucky-chip.cyan {
  background: rgba(94,200,232,.14);
  border-color: rgba(94,200,232,.28);
  color: #3aa8c8;
  box-shadow: var(--sh-out-sm);
}
[data-theme="dark"] .lucky-chip.cyan { color: #7ed7f0; }

.lucky-chip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.fc-panel { padding: 9px 11px; }

.fc-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.fc-yiji {
  display: flex;
  gap: 8px;
}

.fc-yiji span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  box-shadow: var(--sh-out-sm);
  border: 1px dashed rgba(128,134,155,.2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-yiji .yi { color: var(--accent); border-color: rgba(255,122,90,.3); }
.fc-yiji .ji { color: var(--text-3); }

.hk-text {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.8;
  min-height: 3.6em;
  transition: opacity .3s ease;
  quotes: none;
}
.hk-text.is-fading { opacity: 0; }

.hk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.hk-from {
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
}

.mini-btn {
  font-size: 12px;
  color: var(--accent);
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  font-weight: 600;
  transition: box-shadow .18s ease, transform .15s ease;
}
.mini-btn:active { box-shadow: var(--sh-in); transform: scale(.95); }

.tip-card { padding: 0; overflow: hidden; }

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

.amt-btn {
  padding: 12px 0;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  transition: all .18s ease;
  border: 1px solid transparent;
}
.amt-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(255,122,90,.35);
  box-shadow: var(--sh-in);
}

.tip-panel { padding: 14px; margin-bottom: 14px; }
.tip-panel .field:last-of-type { margin-bottom: 12px; }

.pay-types { margin-bottom: 0; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 7px;
  padding-left: 2px;
}

.input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--sh-in);
  color: var(--text);
  transition: box-shadow .2s ease;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus { box-shadow: var(--sh-in-deep), 0 0 0 2px var(--accent-soft); }

textarea.input { resize: vertical; min-height: 76px; line-height: 1.6; }
.input-file { padding: 11px 14px; font-size: 13px; }
.input-file::file-selector-button {
  border: none;
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  border-radius: 8px;
  padding: 6px 14px;
  margin-right: 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
  padding-left: 2px;
}

.pay-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 0;
}

.pay-chip {
  position: relative;
  text-align: center;
}
.pay-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pay-chip span {
  display: block;
  padding: 11px 0;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  border: 1px solid transparent;
  transition: all .18s ease;
}
.pay-chip.is-active span {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(255,122,90,.35);
  box-shadow: var(--sh-in);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff9a6b 55%, var(--gold));
  box-shadow: 6px 6px 16px var(--accent-soft), -2px -2px 8px var(--shadow-light), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .15s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
}
.btn-primary:active { transform: scale(.97); filter: brightness(.95); }
.btn-primary:active::after { left: 120%; transition: left .45s ease; }
.btn-primary:disabled { opacity: .6; pointer-events: none; }

.rank-card { padding: 0; overflow: hidden; }
.rank-card .win-body { padding: 8px 16px 14px; }

.rank-list { padding: 4px 0; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  margin: 4px 0;
  border-radius: 10px;
  border-bottom: none;
  background: var(--bg-2);
  box-shadow: var(--sh-out-sm);
  border: 1px solid rgba(128,134,155,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rank-item:last-child { border-bottom: none; box-shadow: var(--sh-out-sm); }
.rank-item:nth-child(even) { background: var(--surface); }
.rank-1 { border-color: rgba(232,176,75,.4); background: rgba(232,176,75,.1) !important; }
.rank-2 { border-color: rgba(168,179,197,.45); }
.rank-3 { border-color: rgba(217,149,95,.4); background: rgba(217,149,95,.08) !important; }

.rank-no {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--sh-out-sm);
  flex-shrink: 0;
}

.rank-1 .rank-no { color: #fff; background: linear-gradient(135deg, var(--gold), #f5cd7a); box-shadow: 0 3px 10px rgba(232, 176, 75, .4); }
.rank-2 .rank-no { color: #fff; background: linear-gradient(135deg, #a8b3c5, #cdd6e4); box-shadow: 0 3px 10px rgba(168, 179, 197, .4); }
.rank-3 .rank-no { color: #fff; background: linear-gradient(135deg, #d9955f, #eab58e); box-shadow: 0 3px 10px rgba(217, 149, 95, .4); }

.rank-name {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta { font-size: 11.5px; color: var(--text-3); }

.rank-total {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 30px 10px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-3);
}

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

.site-card {
  display: block;
  background: var(--bg-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-out-sm);
  border: 1px solid rgba(128,134,155,.08);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}
.site-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2;
  background: var(--accent);
  opacity: .7;
}
.site-card:active { transform: scale(.98); box-shadow: var(--sh-in); }

.site-cover {
  height: 148px;
  background: var(--bg-2);
  overflow: hidden;
  border-bottom: 1px solid rgba(128,134,155,.1);
}
.site-cover img { width: 100%; height: 100%; object-fit: cover; }

.site-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-3);
  background:
    radial-gradient(circle at 20% 30%, var(--accent-soft), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(120, 160, 255, .12), transparent 45%),
    var(--bg-2);
}

.site-info {
  position: relative;
  padding: 15px 18px 17px;
  background: linear-gradient(180deg, rgba(255,255,255,.25), transparent);
}

[data-theme="dark"] .site-info {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}

.site-name { font-size: 15.5px; font-weight: 700; }

.site-desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
  padding-right: 30px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--accent);
}

.link-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--sh-out-sm);
  border: 1px solid rgba(128,134,155,.08);
  transition: box-shadow .18s ease, transform .18s ease;
  position: relative;
  overflow: hidden;
}
.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .18s ease;
}
.link-card:active { box-shadow: var(--sh-in); transform: scale(.95); }
.link-card:active::before { opacity: 1; }

.link-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--sh-in);
  overflow: hidden;
}
.link-logo img { width: 30px; height: 30px; object-fit: contain; }

.link-name {
  font-size: 11.5px;
  color: var(--text-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer {
  margin-top: 36px;
  text-align: center;
  padding: 8px 0 6px;
}
.foot-line { font-size: 13px; color: var(--text-2); font-weight: 600; }
.foot-sub { font-size: 11.5px; margin-top: 4px; letter-spacing: 1px; font-weight: 600; }
.foot-sub .fs-c1 { color: var(--accent); }
.foot-sub .fs-c2 { color: #5b9bff; }
.foot-sub .fs-c3 { color: var(--gold); }
.foot-sub .fs-c4 { color: #3aa8c8; }
.foot-sub .fs-c5 { color: #a78bfa; }
[data-theme="dark"] .foot-sub .fs-c2 { color: #86aaff; }
[data-theme="dark"] .foot-sub .fs-c4 { color: #6ecbe8; }
[data-theme="dark"] .foot-sub .fs-c5 { color: #b9a4fc; }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 24, 34, .45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .25s ease;
}
.modal-mask[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp .32s cubic-bezier(.22, 1, .36, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 { font-size: 17px; font-weight: 800; }

.form-msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 14px;
  line-height: 1.5;
}
.form-msg.ok { color: #2f9e63; background: rgba(76, 208, 125, .14); }
.form-msg.err { color: #d4553a; background: rgba(212, 85, 58, .12); }

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%) translateY(-12px);
  z-index: 200;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--sh-out);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: block; }

@media (min-width: 420px) {
  .split { gap: 18px; }
  .win-card { min-height: 100%; }
  .weather-card .flip-scene,
  .flip-card .flip-scene { padding: 16px 16px 0; }
  .weather-card .win-title { font-size: 13.5px; }
  .wc-head { padding: 8px 12px; margin-bottom: 12px; }
  .wc-city { font-size: 14px; }
  .wc-badge { font-size: 11px; padding: 3px 10px; }
  .wc-main { min-height: 108px; gap: 6px; }
  .wc-icon { width: 52px; height: 52px; }
  .wc-temp { font-size: 36px; }
  .wc-cond { font-size: 13.5px; }
  .wc-sticker { top: 46px; width: 56px; height: 56px; }
  .fc-sticker { top: 6px; width: 64px; }
  .wc-detail { font-size: 13px; }
  .fc-badge { font-size: 14px; padding: 6px 14px; letter-spacing: 3px; }
  .star { width: 15px; height: 15px; }
  .dim-row { grid-template-columns: 34px 1fr 28px; gap: 8px; }
  .dim-label { font-size: 12px; }
  .dim-val { font-size: 12px; }
  .lucky-chip { font-size: 12.5px; padding: 9px 11px; }
  .fc-text { font-size: 13px; }
  .fc-yiji span { font-size: 11.5px; }
  .flip-card .flip-scene { min-height: 186px; }
}

@media (hover: hover) and (pointer: fine) {
  .card.reveal.is-in:hover { transform: translateY(-2px); }
  .contact-btn:hover { transform: translateY(-2px); }
  .link-card:hover { transform: translateY(-2px); }
  .site-card:hover { transform: translateY(-3px); box-shadow: 9px 10px 22px var(--shadow-dark), -6px -6px 16px var(--shadow-light); }
  .rank-item:hover { transform: translateX(3px); }
  .mini-btn:hover { transform: translateY(-1px); }
  .nav-entry:hover {
    transform: translateY(-2px);
    box-shadow: 9px 10px 22px var(--shadow-dark), -6px -6px 16px var(--shadow-light);
  }
}

@media (min-width: 768px) {
  .page { max-width: 520px; padding-top: 28px; }
  .time-clock { font-size: 52px; }
}
