:root {
  color-scheme: dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --red: #ff4d4f;
  --green: #21c56e;
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; background: #0d0d0d; color: #fff; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 4px; }

.project-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  position: relative;
  isolation: isolate;
}

.project-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 22%, rgba(255, 77, 79, 0.07), transparent 30%), #0d0d0d;
}

.video-header { flex: 0 0 auto; padding: 22px 20px 12px; text-align: center; }
.page-kicker { margin: 0 0 7px; color: rgba(255, 255, 255, 0.38); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.2em; }
.video-header h1 { margin: 0; font-size: clamp(1.08rem, 4.7vw, 1.35rem); line-height: 1.45; letter-spacing: 0.02em; }
.title-rule { width: 44px; height: 2px; margin: 12px auto 0; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.title-rule span { display: block; width: 58%; height: 100%; background: var(--red); }

.video-section { min-height: 0; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 8px 16px; }
.video-frame { position: relative; width: 100%; max-width: calc(70vh * 9 / 16); aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: #000; box-shadow: 0 20px 55px rgba(0, 0, 0, 0.58); }
video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }

.play-overlay,
.media-overlay { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.play-overlay { width: 100%; border: 0; padding: 24px; background: rgba(0, 0, 0, 0.64); color: #fff; cursor: pointer; }
.play-overlay:hover .play-button { transform: scale(1.05); }
.play-overlay:active .play-button { transform: scale(0.94); }
.play-button { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: var(--red); box-shadow: 0 8px 28px rgba(255, 77, 79, 0.35); transition: transform 160ms ease; }
.play-button i { width: 0; height: 0; margin-left: 5px; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 17px solid #fff; }
.play-overlay strong { margin-top: 16px; font-size: 0.9rem; }
.play-overlay small { margin-top: 6px; color: rgba(255, 255, 255, 0.46); font-size: 0.72rem; }

.media-overlay { background: rgba(0, 0, 0, 0.86); text-align: center; padding: 24px; }
.spinner { width: 42px; height: 42px; margin-bottom: 15px; border: 3px solid rgba(255, 255, 255, 0.14); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; }
.media-overlay strong { font-size: 0.9rem; }
.error-overlay { z-index: 5; background: rgba(0, 0, 0, 0.92); }
.error-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 14px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-size: 1.5rem; font-weight: 900; }
.error-overlay p { max-width: 280px; margin: 8px 0 12px; color: rgba(255, 255, 255, 0.56); font-size: 0.82rem; line-height: 1.65; }
.error-overlay small { max-width: 280px; color: rgba(255, 255, 255, 0.3); font: 0.68rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.visitor-footer { flex: 0 0 auto; padding: 13px 20px 21px; text-align: center; }
.visitor-footer p { margin: 0; color: rgba(255, 255, 255, 0.3); font-size: 0.72rem; line-height: 1.65; }
.visitor-footer small { display: block; margin-top: 6px; color: rgba(255, 255, 255, 0.14); font-size: 0.62rem; letter-spacing: 0.08em; }

.customer-link {
  position: fixed;
  z-index: 10;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.9);
  color: #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.48);
  text-decoration: none;
  backdrop-filter: blur(12px);
  animation: float-in 400ms ease-out both;
}
.customer-link:active { transform: scale(0.95); }
.customer-link > span:last-child { font-size: 0.8rem; font-weight: 800; }
.customer-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--green); box-shadow: 0 3px 12px rgba(33, 197, 110, 0.35); }
.customer-icon svg { width: 20px; height: 20px; fill: #fff; }

.route-state { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; }
.route-brand { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 8px; background: #fff; }
.route-brand img { width: 84%; height: 84%; display: block; object-fit: contain; }
.route-state h1 { margin: 0; font-size: clamp(1.7rem, 7vw, 2.8rem); letter-spacing: -0.04em; }
.route-state > p:not(.page-kicker) { max-width: 420px; margin: 12px 0 0; color: rgba(255, 255, 255, 0.48); line-height: 1.7; }
.route-state a { margin-top: 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.4); color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: 800; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 500px) {
  .video-header { padding-top: 25px; }
  .visitor-footer { padding-bottom: 25px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .video-header, .visitor-footer { display: none; }
  .video-section { padding: 0; }
  .video-frame { max-width: calc(96vh * 9 / 16); border-radius: 0; }
  .customer-link { right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
