:root {
  --cream: #f7f3ec;
  --ink: #241c16;
  --muted: #8a7564;
  --line: rgba(36, 28, 22, 0.12);
  --amber: #c8843c;
  --card: rgba(255, 252, 246, 0.72);
  --shadow: 0 30px 60px -20px rgba(66, 45, 24, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 85% -10%, #f4e4cd 0%, transparent 55%),
    radial-gradient(900px 700px at 0% 100%, #ece2d3 0%, transparent 60%),
    var(--cream);
  overflow-x: hidden;
}

h1, .device-time {
  font-family: "Noto Serif SC", Georgia, "Songti SC", serif;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(200, 132, 60, 0.18), transparent 65%);
  transform: translate(-50%, -50%);
  left: 50%;
  top: 40%;
  transition: opacity 0.4s ease;
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding: clamp(32px, 6vh, 72px) clamp(20px, 5vw, 64px);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--amber);
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 66px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-solid {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 14px 26px -12px rgba(36, 28, 22, 0.6);
}

.btn-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 32px -12px rgba(36, 28, 22, 0.65);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.5);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 252, 246, 0.9);
}

.showcase {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.card {
  position: relative;
  width: min(360px, 100%);
  padding: 22px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, box-shadow 0.3s ease;
  animation: float 7s ease-in-out infinite;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent 45%);
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #3d6b4f;
  background: rgba(120, 190, 150, 0.18);
  transition: background 0.3s ease, color 0.3s ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f9d6c;
  box-shadow: 0 0 0 3px rgba(79, 157, 108, 0.2);
}

.card.is-off .status {
  color: var(--muted);
  background: rgba(138, 117, 100, 0.14);
}

.card.is-off .status-dot {
  background: var(--muted);
  box-shadow: none;
}

.device {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(155deg, #fdf9f1, #e9dfd0);
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.device::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 90deg, transparent, rgba(200, 132, 60, 0.18), transparent 55%);
  animation: spin 12s linear infinite;
}

.device-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 34px;
  border-radius: 14px;
  background: rgba(36, 28, 22, 0.9);
  color: #f7f3ec;
  box-shadow: 0 18px 30px -16px rgba(36, 28, 22, 0.8);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.device-time {
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.device-date {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(247, 243, 236, 0.55);
}

.device-led {
  position: absolute;
  bottom: 14px;
  right: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f9d6c;
  box-shadow: 0 0 10px 2px rgba(79, 157, 108, 0.5);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card.is-off .device-screen { opacity: 0.35; transform: scale(0.98); }
.card.is-off .device-led { background: #8a7564; box-shadow: none; }
.card.is-off .device::before { animation-play-state: paused; opacity: 0.3; }

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.metric {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(36, 28, 22, 0.06);
}

.metric-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease;
}

.switch-knob {
  position: absolute;
  top: 5px;
  left: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch::after {
  content: "关闭设备";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 40px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cream);
  transition: color 0.3s ease, padding 0.3s ease;
}

.card.is-off .switch {
  background: rgba(36, 28, 22, 0.16);
}

.card.is-off .switch .switch-knob {
  left: calc(100% - 42px);
}

.card.is-off .switch::after {
  content: "开启设备";
  color: var(--ink);
  padding-left: 0;
  padding-right: 44px;
}

.switch:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes spin {
  to { rotate: 360deg; }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: clamp(48px, 9vh, 80px);
    padding-bottom: 72px;
    text-align: center;
  }
  .actions { justify-content: center; }
  .showcase { order: 2; }
}

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