*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --room-bg: linear-gradient(165deg, #e8f4fc 0%, #d4e8f7 45%, #c5dff0 100%);
  --room-bg-on: linear-gradient(165deg, #dceefb 0%, #b8ddf5 40%, #9ecde8 100%);
  --ac-body: linear-gradient(180deg, #f8f9fb 0%, #e8ecf0 35%, #d5dce4 100%);
  --ac-edge: #b8c4d0;
  --ac-shadow: rgba(40, 60, 90, 0.22);
  --display-bg: #0a1628;
  --display-glow: #00d4aa;
  --wind-color: rgba(180, 230, 255, 0.75);
  --remote-bg: #2a3142;
  --remote-btn: #3d4659;
  --remote-btn-active: #4a90d9;
  --power-on: #00c896;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--room-bg);
  color: #2c3e50;
  transition: background 0.6s ease;
}

body.ac-on {
  background: var(--room-bg-on);
}

.room {
  max-width: 420px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-header {
  text-align: center;
  margin-bottom: 1.9rem;
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.tip {
  font-size: 0.8rem;
  color: #5a7a94;
  margin-top: 0.35rem;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.05rem;
}

/* —— 壁挂室内机 —— */
.ac-unit {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin-top: 0.4rem; /* 额外与上方 Tip 拉开距离 */
}

.indoor-body {
  position: relative;
  width: 100%;
  background: var(--ac-body);
  border: 2px solid var(--ac-edge);
  border-radius: 10px 10px 14px 14px;
  box-shadow:
    0 8px 24px var(--ac-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px;
  gap: 10px;
  overflow: visible;
}

/* 上区：左上能效标 + 右侧显示屏 */
.ac-top {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

/* 中国能效标识（左上，贴近真机贴纸位置） */
.energy-label {
  flex-shrink: 0;
  width: 36px;
  align-self: start;
  margin-top: 6px;
  padding: 4px 3px;
  background: #fff;
  border: 2px solid #6eb5e8;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.energy-chart {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 1px;
}

.energy-bar {
  display: block;
  height: 3px;
  border-radius: 1px;
}

.energy-bar.bar-1 {
  width: 42%;
  background: #1a6b3c;
}

.energy-bar.bar-2 {
  width: 55%;
  background: #7cb342;
}

.energy-bar.bar-3 {
  width: 68%;
  background: #fdd835;
}

.energy-bar.bar-4 {
  width: 82%;
  background: #fb8c00;
}

.energy-bar.bar-5 {
  width: 100%;
  background: #e53935;
}

.energy-arrow {
  position: absolute;
  right: -1px;
  top: 1px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-right: 5px solid #1a6b3c;
}

.energy-grade {
  font-family: Orbitron, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1a6b3c;
  line-height: 1;
}

.display-panel {
  flex-shrink: 0;
  width: 100px;
  justify-self: end;
  background: var(--display-bg);
  border-radius: 8px;
  border: 2px solid #1e3a5f;
  box-shadow:
    inset 0 0 22px rgba(0, 212, 170, 0.18),
    0 0 14px rgba(0, 180, 140, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 8px;
  transition: box-shadow 0.35s, opacity 0.35s;
}

.ac-unit:not(.is-on) .display-panel {
  opacity: 0.5;
  box-shadow: none;
}

.display-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.mode-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.temp-value {
  font-family: Orbitron, monospace;
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--display-glow);
  text-shadow: 0 0 9px rgba(0, 212, 170, 0.65);
  line-height: 1;
}

.temp-unit {
  font-family: Orbitron, monospace;
  font-size: 0.72rem;
  color: #5a9a88;
  align-self: flex-start;
  margin-top: 6px;
}

.status-line {
  font-size: 0.58rem;
  color: #4a8a78;
  margin-top: 6px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* 导风板：上沿为轴 — 开机向上掀起，关机向下合上；五片同步 */
.louver-wrap {
  position: relative;
  height: 38px;
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #98a8b8;
  background: linear-gradient(180deg, #9aaab8 0%, #8898a8 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: visible;
  perspective: 280px;
  perspective-origin: 50% 0%;
  transform-style: preserve-3d;
  transition: gap 1.4s ease-in-out;
}

.ac-unit.is-on .louver-wrap {
  gap: 5px;
}

.louver {
  flex: 1;
  min-height: 3px;
  background: linear-gradient(180deg, #f8fafc 0%, #d0dae4 50%, #9aaab8 100%);
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transform-origin: 50% 0%;
  transform: rotateX(0deg);
  transition: transform 1.4s ease-in-out;
  backface-visibility: hidden;
}

.ac-unit:not(.is-on) .louver {
  transform: rotateX(0deg);
}

.ac-unit.is-on .louver {
  transform: rotateX(44deg);
}

/* 出风：从翻开的导风板下方吹出 */
.wind-zone {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(100% - 2px);
  height: 64px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s;
}

.ac-unit.is-on .wind-zone {
  opacity: 1;
  /* 等导风板开到位后再出风 */
  transition: opacity 0.85s ease 1.35s;
}

.ac-unit:not(.is-on) .wind-zone {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.wind-particle {
  position: absolute;
  top: 1px;
  width: 2.5px;
  height: 20px;
  background: linear-gradient(to bottom, transparent, var(--wind-color), transparent);
  border-radius: 1px;
  animation: wind-fall linear forwards;
  opacity: 0.75;
}

.wind-particle.snow {
  width: 4px;
  height: 4px;
  background: rgba(210, 240, 255, 0.65);
  box-shadow: 0 0 3px rgba(180, 225, 255, 0.6);
  border-radius: 50%;
}

@keyframes wind-fall {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.65;
  }
  20% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(58px) translateX(var(--drift, 0));
    opacity: 0;
  }
}

/* 遥控器 */
.remote {
  margin-top: 1.5rem;
  background: var(--remote-bg);
  border-radius: 16px;
  padding: 14px 16px 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
}

.remote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a8b8c8;
  font-size: 0.75rem;
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}

.remote-power-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a5568;
  transition: background 0.3s, box-shadow 0.3s;
}

.remote-power-led.on {
  background: var(--power-on);
  box-shadow: 0 0 8px var(--power-on);
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #e8eef4;
  background: var(--remote-btn);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  user-select: none;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.96);
  background: var(--remote-btn-active);
}

.btn-power {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #3d5a80, #2a4060);
  font-weight: 600;
  letter-spacing: 0.15em;
}

.btn-power:active {
  background: linear-gradient(180deg, #4a6a90, #355070);
}

.remote-hint {
  text-align: center;
  font-size: 0.7rem;
  color: #6a7a8a;
  margin-top: 12px;
}

.page-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.65rem;
  color: #7a92a8;
}

/* 制热模式 */
.ac-unit.mode-heat .display-panel {
  --display-glow: #ff8844;
  box-shadow: inset 0 0 20px rgba(255, 136, 68, 0.15), 0 0 12px rgba(255, 120, 60, 0.25);
}

.ac-unit.mode-heat .temp-value {
  color: #ff8844;
  text-shadow: 0 0 8px rgba(255, 136, 68, 0.5);
}

body.ac-on.mode-heat {
  --room-bg-on: linear-gradient(165deg, #fff0e8 0%, #ffe0d0 40%, #ffd0c0 100%);
}
