/* ================================================
   空调遥控器 PWA — Frosted Glass 风格
   模式动态配色: 制冷=青蓝 送风=薄荷绿 除湿=暖橙
   ================================================ */

* { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg-deep: #08080f;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.06);
  --text: #e8e8ec;
  --text-dim: #6b6b76;
  --radius: 20px;
  --accent-cool: #5ec5f7;
  --accent-fan: #6dd98a;
  --accent-dry: #f0a860;
  --accent-off: #3a3a44;
  --accent: var(--accent-cool);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  overflow-x: hidden;
}

/* 柔光背景 */
body::before {
  content: '';
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,197,247,0.06) 0%, transparent 70%);
  pointer-events: none;
  transition: background 0.8s;
}

#app {
  width: 100%; max-width: 420px;
  padding: 16px; padding-bottom: 32px;
  position: relative; z-index: 1;
}

/* === 状态栏 === */
#statusBar {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 6px; font-size: 11px; color: var(--text-dim);
}
#connDot { width:6px; height:6px; border-radius:50%; background:#555; transition:background .4s; }
#connDot.on  { background:#4ecca3; box-shadow:0 0 6px rgba(78,204,163,.5); }
#connDot.busy { background:#f0a860; animation:pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* === 头部 === */
.header {
  display: flex; justify-content: center; align-items: center;
  position: relative; margin-bottom: 12px;
}
.header h1 { font-size:15px; font-weight:500; color:var(--text-dim); letter-spacing:.5px; }
.header .gear-btn {
  position: absolute; right:0;
  width:36px; height:36px; border-radius:50%;
  border:none; background:var(--glass); color:var(--text-dim);
  font-size:18px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* === 温度区 === */
.temp-section { text-align: center; margin: 16px 0; }
.temp-ring {
  width:170px; height:170px; border-radius:50%;
  background: var(--glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--glass-border);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  margin:0 auto;
  transition: border-color .5s, box-shadow .5s;
}
.temp-ring.on {
  border-color: var(--accent);
  box-shadow: 0 0 60px rgba(94,197,247,.12), inset 0 0 30px rgba(94,197,247,.04);
}
.temp-value { font-size:72px; font-weight:200; line-height:1; letter-spacing:-3px; }
.temp-unit  { font-size:16px; color:var(--text-dim); margin-top:2px; }
.mode-label { margin-top:14px; font-size:14px; color:var(--accent); font-weight:500; transition:color .5s; }

/* === 温度调节 === */
.temp-control {
  display:flex; justify-content:center; align-items:center;
  gap:28px; margin: 20px 0 24px;
}
.temp-btn {
  width:48px; height:48px; border-radius:50%;
  border:1.5px solid rgba(255,255,255,.08);
  background:var(--glass); color:var(--text);
  font-size:26px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .2s;
}
.temp-btn:active { background:var(--accent); border-color:var(--accent); }
.power-btn {
  width:72px; height:72px; border-radius:50%; border:none;
  cursor:pointer; font-size:30px;
  display:flex; align-items:center; justify-content:center;
  transition: all .35s;
}
.power-btn.off { background:#2a2a34; color:#555; }
.power-btn.on  { background:var(--accent); color:#fff; box-shadow:0 0 30px rgba(94,197,247,.25); }

/* === 卡片 === */
.card {
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.card-title { font-size:11px; color:var(--text-dim); text-transform:uppercase; letter-spacing:1px; margin-bottom:12px; }

/* === Chip === */
.chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.chip {
  padding:10px 18px; border-radius:24px; border:none;
  background:rgba(255,255,255,.04); color:var(--text);
  font-size:14px; cursor:pointer; transition:all .2s;
  white-space:nowrap;
}
.chip:active { transform:scale(.96); }
.chip.active { background:var(--accent); color:#fff; font-weight:500; }
.chip.scene { border:1px solid rgba(255,255,255,.06); background:transparent; }

/* === 设置抽屉 === */
#settingsOverlay {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  z-index:100; display:none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#settingsOverlay.open { display:block; }

#settingsDrawer {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%) translateY(100%);
  width:100%; max-width:420px;
  background:rgba(22,22,30,.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius:24px 24px 0 0;
  padding:12px 20px 32px;
  z-index:101;
  transition:transform .35s cubic-bezier(.4,0,.2,1);
}
#settingsDrawer.open { transform:translateX(-50%) translateY(0); }

.drawer-handle {
  width:36px; height:4px; background:rgba(255,255,255,.15);
  border-radius:2px; margin:0 auto 16px;
}
#settingsDrawer h3 { font-size:16px; font-weight:600; margin-bottom:16px; }

.form-group { margin-bottom:12px; }
.form-group label { display:block; font-size:11px; color:var(--text-dim); margin-bottom:4px; text-transform:uppercase; letter-spacing:.5px; }
.form-group input, .form-group select {
  width:100%; padding:12px; border:1px solid rgba(255,255,255,.06);
  border-radius:14px; background:rgba(255,255,255,.03); color:var(--text);
  font-size:15px; outline:none;
}
.form-group input:focus { border-color:var(--accent); }

.btn-primary {
  width:100%; padding:14px; border:none; border-radius:16px;
  background:var(--accent); color:#fff; font-size:16px; font-weight:600;
  cursor:pointer; margin-top:8px; transition:opacity .2s;
}
.btn-primary:active { opacity:.8; }
.btn-ghost {
  width:100%; padding:12px; border:none; background:transparent;
  color:var(--text-dim); font-size:14px; cursor:pointer; margin-top:4px;
}

/* === Toast === */
.toast {
  position:fixed; top:24px; left:50%; transform:translateX(-50%);
  background:rgba(40,40,50,.95);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color:#fff; padding:10px 24px; border-radius:24px;
  font-size:13px; z-index:200;
  animation:toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(-8px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}
