/* ===================== 小空调 ===================== */

.ac-app {
  --ac-accent: #4aa8ff;
  --ac-glow: rgba(74, 168, 255, 0.55);
  --ac-soft: rgba(74, 168, 255, 0.14);
  --ac-speed: 3.2s;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 0 4px;
  font-size: 15px;
  color: var(--anzhiyu-fontcolor);
}

/* 四种模式的配色 */
.ac-app[data-mode="cool"] {
  --ac-accent: #4aa8ff;
  --ac-glow: rgba(74, 168, 255, 0.55);
  --ac-soft: rgba(74, 168, 255, 0.14);
}
.ac-app[data-mode="heat"] {
  --ac-accent: #ff8a3d;
  --ac-glow: rgba(255, 138, 61, 0.55);
  --ac-soft: rgba(255, 138, 61, 0.14);
}
.ac-app[data-mode="dry"] {
  --ac-accent: #2fd3c6;
  --ac-glow: rgba(47, 211, 198, 0.5);
  --ac-soft: rgba(47, 211, 198, 0.14);
}
.ac-app[data-mode="wind"] {
  --ac-accent: #5ecb7a;
  --ac-glow: rgba(94, 203, 122, 0.5);
  --ac-soft: rgba(94, 203, 122, 0.14);
}

/* 风力档位 */
.ac-app[data-fan="0"] { --ac-speed: 3.2s; }
.ac-app[data-fan="1"] { --ac-speed: 4.4s; }
.ac-app[data-fan="2"] { --ac-speed: 2.6s; }
.ac-app[data-fan="3"] { --ac-speed: 1.7s; }

/* ---------------------------- 卡片 ---------------------------- */
.ac-card {
  padding: 22px 22px 18px;
  border-radius: 20px;
  background: var(--anzhiyu-card-bg, #fff);
  border: 1px solid var(--style-border, rgba(0, 0, 0, 0.08));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.ac-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ac-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

.ac-title i {
  color: var(--ac-accent);
  font-size: 20px;
  transition: color 0.3s;
}

.ac-title em {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--anzhiyu-secondtext);
}

.ac-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--ac-soft);
  color: var(--ac-accent);
  transition: all 0.3s;
}

.ac-app[data-on="false"] .ac-status {
  background: rgba(150, 150, 150, 0.14);
  color: #999;
}

/* ---------------------------- 机身 ---------------------------- */
.ac-machine {
  position: relative;
  padding: 14px 16px 0;
  border-radius: 18px;
  background: linear-gradient(160deg, #fbfcfe, #e9edf3);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

[data-theme="dark"] .ac-machine {
  background: linear-gradient(160deg, #23262e, #15171c);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ac-brand {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .ac-brand {
  color: rgba(255, 255, 255, 0.3);
}

/* ---------------------------- 显示屏 ---------------------------- */
.ac-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, #10151f, #0a0e15);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.6);
  transition: opacity 0.4s;
}

.ac-app[data-on="false"] .ac-display {
  opacity: 0.4;
}

.ac-mode-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--ac-glow));
  transition: filter 0.3s;
}

.ac-temp {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  color: var(--ac-accent);
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  text-shadow: 0 0 14px var(--ac-glow);
  transition: color 0.3s, text-shadow 0.3s;
}

.ac-temp span {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ac-temp em {
  margin-top: 6px;
  font-style: normal;
  font-size: 15px;
  opacity: 0.85;
}

.ac-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.ac-fan-bars {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}

.ac-fan-bars i {
  display: block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.3s;
}

.ac-app[data-fan="1"] .ac-fan-bars i:nth-child(1),
.ac-app[data-fan="2"] .ac-fan-bars i:nth-child(-n + 2),
.ac-app[data-fan="3"] .ac-fan-bars i {
  background: var(--ac-accent);
  box-shadow: 0 0 8px var(--ac-glow);
}

/* 自动风：三格呼吸 */
.ac-app[data-fan="0"] .ac-fan-bars i {
  background: var(--ac-accent);
  opacity: 0.35;
  animation: acBreath 1.8s ease-in-out infinite;
}
.ac-app[data-fan="0"] .ac-fan-bars i:nth-child(2) { animation-delay: 0.2s; }
.ac-app[data-fan="0"] .ac-fan-bars i:nth-child(3) { animation-delay: 0.4s; }

@keyframes acBreath {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ---------------------------- 出风口 ---------------------------- */
.ac-vent {
  position: relative;
  height: 46px;
  margin: 0 -16px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #d9dee7, #c7ccd6);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ac-vent {
  background: linear-gradient(180deg, #1a1d23, #101318);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.ac-blade {
  height: 4px;
  margin-bottom: 5px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.16);
  transform-origin: center;
  transition: transform 0.6s ease;
}

[data-theme="dark"] .ac-blade {
  background: rgba(255, 255, 255, 0.1);
}

.ac-app[data-on="true"] .ac-vent .ac-blade {
  box-shadow: 0 0 12px var(--ac-glow);
}

/* 扫风：百叶左右摆动 */
.ac-app[data-swing="true"] .ac-blade {
  animation: acSwing 2.4s ease-in-out infinite alternate;
}
.ac-app[data-swing="true"] .ac-blade:nth-child(2) { animation-delay: 0.15s; }
.ac-app[data-swing="true"] .ac-blade:nth-child(3) { animation-delay: 0.3s; }
.ac-app[data-swing="true"] .ac-blade:nth-child(4) { animation-delay: 0.45s; }

@keyframes acSwing {
  0% { transform: rotate(-1.6deg) scaleY(1); }
  100% { transform: rotate(1.6deg) scaleY(1.4); }
}

/* 风线 */
.ac-wind {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 150px;
  pointer-events: none;
  overflow: hidden;
}

.ac-wind span {
  position: absolute;
  top: 0;
  width: 46px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ac-accent), transparent);
  opacity: 0;
  filter: blur(0.5px);
  animation: acWind var(--ac-speed) linear infinite;
}

.ac-wind span:nth-child(1) { left: 12%; animation-delay: 0s; }
.ac-wind span:nth-child(2) { left: 32%; animation-delay: 0.6s; }
.ac-wind span:nth-child(3) { left: 50%; animation-delay: 1.2s; }
.ac-wind span:nth-child(4) { left: 68%; animation-delay: 1.8s; }
.ac-wind span:nth-child(5) { left: 86%; animation-delay: 2.4s; }

@keyframes acWind {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scaleX(0.5);
  }
  15% {
    opacity: 0.85;
  }
  80% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translate3d(14px, 130px, 0) scaleX(1.6);
  }
}

/* 关机 / 送风模式：风线减弱或消失 */
.ac-app[data-on="false"] .ac-wind span {
  animation: none;
  opacity: 0;
}

.ac-app[data-fan="1"] .ac-wind span:nth-child(n + 4) {
  display: none;
}
.ac-app[data-fan="1"] .ac-wind span:nth-child(-n + 3) {
  animation-duration: 4.4s;
}
.ac-app[data-fan="2"] .ac-wind span:nth-child(5) {
  display: none;
}

/* 底部指示灯 */
.ac-feet {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 14px;
}

.ac-feet i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  transition: background 0.3s, box-shadow 0.3s;
}

.ac-app[data-on="true"] .ac-feet i:first-child {
  background: var(--ac-accent);
  box-shadow: 0 0 8px var(--ac-glow);
}

/* ---------------------------- 按键 ---------------------------- */
.ac-panel {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.ac-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  height: 56px;
  padding: 0 14px;
  border: 1px solid var(--style-border, rgba(0, 0, 0, 0.08));
  border-radius: 14px;
  background: var(--anzhiyu-secondbg, #f4f6f9);
  color: var(--anzhiyu-fontcolor);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ac-btn:hover {
  transform: translateY(-2px);
  border-color: var(--ac-accent);
  box-shadow: 0 6px 16px var(--ac-soft);
}

.ac-btn:active {
  transform: translateY(0) scale(0.96);
}

.ac-group {
  display: flex;
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: var(--anzhiyu-secondbg, #f4f6f9);
  border: 1px solid var(--style-border, rgba(0, 0, 0, 0.06));
}

.ac-group .ac-btn {
  min-width: 50px;
  border: none;
  background: transparent;
  font-size: 24px;
}

.ac-group .ac-btn:hover {
  background: var(--ac-soft);
  box-shadow: none;
  transform: none;
}

.ac-power {
  color: #fff;
  background: linear-gradient(140deg, #ff7b7b, #e0453f);
  border: none;
  box-shadow: 0 6px 16px rgba(224, 69, 63, 0.28);
}

.ac-power:hover {
  box-shadow: 0 8px 22px rgba(224, 69, 63, 0.38);
}

.ac-app[data-on="false"] .ac-power {
  background: linear-gradient(140deg, #9aa0aa, #6f7683);
  box-shadow: 0 6px 16px rgba(120, 126, 138, 0.25);
}

.ac-btn-text {
  flex: 1;
  min-width: 84px;
  height: 56px;
  gap: 3px;
}

.ac-btn-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
}

.ac-btn-sub {
  font-size: 15px;
  font-weight: 700;
  color: var(--ac-accent);
  transition: color 0.3s;
}

.ac-tip {
  margin: 14px 0 0;
  font-size: 12.5px;
  text-align: center;
  color: var(--anzhiyu-secondtext);
  opacity: 0.85;
}

/* 温度到达上下限时的抖动提示 */
.ac-temp.ac-bump {
  animation: acBump 0.32s ease;
}

@keyframes acBump {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ---------------------------- 移动端 ---------------------------- */
@media screen and (max-width: 768px) {
  .ac-card {
    padding: 16px 14px 14px;
    border-radius: 16px;
  }

  .ac-title {
    font-size: 16px;
  }

  .ac-title em {
    display: none;
  }

  .ac-temp span {
    font-size: 38px;
  }

  .ac-mode-icon {
    font-size: 22px;
  }

  .ac-panel {
    gap: 8px;
  }

  .ac-btn {
    min-width: 48px;
    height: 50px;
    padding: 0 10px;
  }

  .ac-btn-text {
    min-width: 70px;
    height: 50px;
  }

  .ac-panel .ac-btn-text {
    flex: 1 1 calc(33% - 8px);
  }

  .ac-wind {
    height: 110px;
  }
}
