:root {
  color-scheme: dark;
  --ink: #16110f;
  --panel: #211a17;
  --panel-2: #2a211d;
  --line: rgba(255, 224, 176, 0.13);
  --gold: #d5aa68;
  --gold-2: #f3cf90;
  --cream: #fff1cf;
  --muted: #a99e93;
  --danger: #e45e68;
  --radius: 24px;
}

* { box-sizing: border-box; }

html { background: #0e0b0a; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgba(182, 115, 56, .22), transparent 30rem),
    #0e0b0a;
  color: #f7efe4;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(94px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(31, 23, 19, .96), rgba(14, 11, 10, .98)),
    #15110f;
  position: relative;
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image: repeating-linear-gradient(90deg, transparent 0 26px, rgba(255,255,255,.12) 27px);
}

.topbar, .section-heading, .feature-row, .device-strip, .bottom-nav { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.eyebrow, .section-kicker { margin: 0 0 3px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font: 600 24px/1.2 Georgia, "Noto Serif SC", serif; letter-spacing: .01em; }
h2 { margin: 0; font-size: 18px; line-height: 1.2; }

.icon-button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--gold-2); background: rgba(255,255,255,.04); display: grid; place-items: center;
}
.signal { display: flex; gap: 3px; align-items: end; height: 18px; }
.signal i { display: block; width: 3px; border-radius: 3px; background: currentColor; }
.signal i:nth-child(1) { height: 6px; } .signal i:nth-child(2) { height: 11px; } .signal i:nth-child(3) { height: 16px; }

.lamp-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  position: relative;
  margin: 0 -18px 12px;
  overflow: hidden;
}
.orbital-pattern {
  position: absolute; width: 430px; height: 430px; border-radius: 50%;
  border: 1px solid rgba(213,170,104,.14);
  background: repeating-radial-gradient(circle, transparent 0 34px, rgba(213,170,104,.05) 35px, transparent 36px 55px);
}
.orbital-pattern::after { content: "楚 · 光 · 意 · 境 · CHU · LUCE ·"; position: absolute; left: 93px; top: 18px; color: rgba(243,207,144,.24); font: 11px/1 serif; letter-spacing: .24em; }
.lamp-aura {
  --aura-rgb: 255, 181, 92;
  --aura-alpha: .26;
  position: absolute;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--aura-rgb), var(--aura-alpha)) 0%, rgba(var(--aura-rgb), .14) 38%, rgba(var(--aura-rgb), .06) 62%, rgba(var(--aura-rgb), 0) 82%);
  transition: opacity .35s ease, background .35s ease;
  pointer-events: none;
}
.lamp-product { width: 302px; height: 318px; position: relative; z-index: 2; }
.lamp-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; transform: scale(.82); filter: brightness(1.04) saturate(.94) drop-shadow(0 20px 18px rgba(0,0,0,.35)); transition: filter .35s ease, opacity .35s ease; }
.lamp-3d-view { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; background: transparent; touch-action: pan-y; transition: opacity .35s ease; }
.lamp-product.is-model-ready .lamp-3d-view { opacity: 1; }
.lamp-product.is-model-ready .lamp-image { opacity: 0; visibility: hidden; }
.live-pill { position: absolute; left: 26px; top: 16px; display: flex; align-items: center; gap: 7px; font-size: 12px; color: #d7cec5; background: rgba(15,12,10,.68); border: 1px solid var(--line); padding: 7px 10px; border-radius: 99px; backdrop-filter: blur(12px); z-index: 3; }
.status-dot { width: 7px; height: 7px; background: #67d39a; border-radius: 50%; box-shadow: 0 0 0 4px rgba(103,211,154,.12); }
.power-button { position: absolute; right: 26px; bottom: 22px; z-index: 4; border: 1px solid var(--line); border-radius: 99px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: #b8ada2; background: rgba(18,14,12,.86); }
.power-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.power-button.is-on { color: var(--cream); border-color: rgba(243,207,144,.42); box-shadow: 0 0 22px rgba(213,170,104,.12); }

.control-panel { position: relative; z-index: 2; padding: 20px; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(45,35,30,.96), rgba(29,23,20,.98)); box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.value-badge { color: var(--cream); font: 600 18px/1 Georgia, serif; background: rgba(213,170,104,.1); border: 1px solid rgba(213,170,104,.18); padding: 9px 12px; border-radius: 12px; }
.slider-label, .angle-marks { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.slider-row { display: grid; grid-template-columns: 22px 1fr 22px; gap: 10px; align-items: center; margin: 10px 0 18px; color: var(--gold-2); }
.sun-icon { font-size: 20px; } .sun-icon.small { font-size: 15px; }
.range { width: 100%; appearance: none; height: 6px; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--gold) var(--progress, 68%), rgba(255,255,255,.09) var(--progress, 68%)); }
.range::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); border: 5px solid #7c5930; box-shadow: 0 2px 12px rgba(0,0,0,.45); }
.range::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--cream); border: 5px solid #7c5930; }
.sub-control { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.control-copy { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.control-copy span { color: #d9d0c7; } .control-copy strong { color: var(--gold-2); font-size: 14px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; gap: 4px; border-radius: 16px; background: rgba(0,0,0,.22); }
.temp-option { border: 0; min-height: 44px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 14px; }
.temp-option.active { color: var(--cream); background: #4a3728; box-shadow: inset 0 0 0 1px rgba(255,224,176,.12); }
.temp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; } .warm { background: #ffb45f; } .natural { background: #ffe0a3; } .focus { background: #eef4ff; }
.range.compact { margin-top: 4px; } .angle-marks { margin-top: 8px; }
.quiet-label { color: var(--muted); font-size: 13px; }

.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-card { min-height: 80px; display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line); border-radius: 18px; color: #e6ddd4; background: rgba(255,255,255,.025); padding: 12px; }
.scene-card.active { border-color: rgba(213,170,104,.55); background: linear-gradient(145deg, rgba(139,93,48,.3), rgba(76,50,31,.24)); }
.scene-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--gold-2); background: rgba(213,170,104,.12); font: 600 16px Georgia, serif; }
.scene-card strong, .scene-card small { display: block; } .scene-card strong { font-size: 15px; } .scene-card small { margin-top: 2px; font-size: 12px; color: var(--muted); }

.sensory-panel { padding-bottom: 6px; }
.feature-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--gold-2); background: rgba(213,170,104,.1); font: 600 15px Georgia, serif; }
.feature-copy strong, .feature-copy span { display: block; } .feature-copy span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch { width: 52px; height: 30px; border: 0; border-radius: 99px; padding: 3px; background: #514944; transition: .2s; }
.switch span { display: block; width: 24px; height: 24px; border-radius: 50%; background: #e9ded3; box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: .2s; }
.switch[aria-checked="true"] { background: var(--gold); } .switch[aria-checked="true"] span { transform: translateX(22px); background: #fff8e8; }
.secondary-button { border: 1px solid rgba(213,170,104,.32); border-radius: 12px; color: var(--gold-2); background: rgba(213,170,104,.08); padding: 8px 13px; }

.device-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--line); }
.device-strip div { padding: 14px 10px; background: #1b1513; text-align: center; }
.device-strip span, .device-strip strong { display: block; } .device-strip span { color: var(--muted); font-size: 11px; } .device-strip strong { margin-top: 4px; font-size: 12px; color: #e9ded3; }

.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 460px); display: grid; grid-template-columns: repeat(3,1fr); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(20,15,13,.93); border-top: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 20; }
.nav-item { border: 0; background: transparent; color: #857a71; display: grid; place-items: center; gap: 2px; font-size: 11px; }
.nav-item span { font-size: 22px; line-height: 1; } .nav-item.active { color: var(--gold-2); }

.sheet { width: min(calc(100% - 24px), 430px); margin: auto auto 0; border: 1px solid var(--line); border-radius: 28px 28px 0 0; color: #f5ece3; background: #211a17; padding: 12px 20px max(22px, env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.45); }
.sheet::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.sheet-handle { width: 42px; height: 4px; border-radius: 99px; background: #5f554e; margin: 0 auto 20px; }
.sheet h2 { font-size: 22px; } .sheet p { color: var(--muted); margin: 8px 0 18px; }
.timer-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.timer-options button, .cancel-button, .stop-timer-button { min-height: 48px; border-radius: 14px; border: 1px solid var(--line); color: #f1e6da; background: #302622; }
.timer-options button { color: var(--gold-2); }
.cancel-button, .stop-timer-button { width: 100%; margin-top: 12px; }
.stop-timer-button { color: #ffd7ca; border-color: rgba(217,119,91,.36); background: rgba(125,55,39,.22); }
.stop-timer-button:disabled { color: #756a63; border-color: var(--line); background: rgba(255,255,255,.025); cursor: not-allowed; }
.detail-list { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); } .detail-list span { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 40; opacity: 0; pointer-events: none; white-space: nowrap; color: #20170f; background: var(--cream); border-radius: 99px; padding: 10px 16px; font-size: 13px; font-weight: 700; transition: .25s; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-shell.is-off .lamp-image { filter: brightness(.38) saturate(.45) drop-shadow(0 16px 14px rgba(0,0,0,.28)); opacity: .72; }
.app-shell.is-off .lamp-product.is-model-ready .lamp-3d-view { opacity: .42; }
.app-shell.is-off .lamp-aura { opacity: 0; }
.app-shell.is-off .status-dot { background: #8a8078; box-shadow: none; }

@media (max-width: 699px) {
  .lamp-image { filter: none; }
  .app-shell.is-off .lamp-image { filter: none; opacity: .42; }
}

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { border-radius: 38px; min-height: calc(100svh - 48px); box-shadow: 0 30px 100px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.06); }
  .bottom-nav { bottom: 24px; border-radius: 0 0 38px 38px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
