/* DC1 网页控制台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #333;
  min-height: 100vh;
}

.view { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.hidden { display: none !important; }

/* ---------- 通用 ---------- */
.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: #0e90d2;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.btn-primary:hover { background: #0c7cb8; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-link {
  background: none; border: none; color: #0e90d2; font-size: 14px; cursor: pointer; padding: 6px;
}
.btn-link.danger { color: #fa5151; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.form-msg { margin-top: 12px; text-align: center; font-size: 14px; color: #fa5151; min-height: 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 12px;
}
.topbar h2 { font-size: 20px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.status-badge { font-size: 13px; padding: 4px 14px; border-radius: 14px; }
.status-badge.on { color: #07c160; background: #e8f8f0; }
.status-badge.off { color: #fa5151; background: #fdecec; }

/* ---------- 登录 ---------- */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-box { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 32px 28px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.login-title { text-align: center; color: #0e90d2; font-size: 24px; }
.login-sub { text-align: center; color: #888; font-size: 14px; margin: 8px 0 28px; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-item input {
  width: 100%; height: 42px; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 0 12px; font-size: 15px; outline: none;
}
.form-item input:focus { border-color: #0e90d2; }
.login-toggle { margin-top: 16px; text-align: center; color: #0e90d2; font-size: 14px; cursor: pointer; }

/* ---------- 设备列表 ---------- */
.device-card {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.device-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.device-name { font-size: 17px; font-weight: 600; }
.device-meta { margin-top: 4px; color: #999; font-size: 12px; }
.device-online { font-size: 13px; padding: 4px 14px; border-radius: 14px; }
.device-online.on { color: #07c160; background: #e8f8f0; }
.device-online.off { color: #fa5151; background: #fdecec; }

.empty { text-align: center; padding: 80px 0; color: #999; }
.empty-title { font-size: 18px; color: #666; }
.empty-sub { margin-top: 8px; font-size: 13px; }

/* ---------- 详情 ---------- */
.detail-mac { color: #999; font-size: 12px; padding: 0 2px 12px; }

.metrics {
  display: flex; flex-wrap: wrap; background: #fff; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px;
}
.metric { width: 50%; text-align: center; padding: 18px 0; }
.metric-value { font-size: 22px; font-weight: 700; color: #0e90d2; }
.metric-value .unit { font-size: 12px; font-weight: 400; color: #999; margin-left: 2px; }
.metric-label { margin-top: 6px; color: #888; font-size: 12px; }

.switch-row { display: flex; justify-content: space-between; align-items: center; }
.switch-title { font-size: 16px; font-weight: 500; }
.switch-sub { margin-top: 4px; color: #999; font-size: 12px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc; border-radius: 28px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: #0e90d2; }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:disabled + .slider { opacity: .6; cursor: not-allowed; }

.link-row { display: flex; justify-content: space-between; align-items: center; font-size: 16px; cursor: pointer; }
.arrow { color: #ccc; font-size: 20px; }

/* ---------- 循环设置 ---------- */
.tip { color: #888; font-size: 13px; line-height: 1.6; margin: 4px 2px 12px; }
.loop-card { padding-bottom: 8px; }
.loop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.loop-title { font-size: 16px; font-weight: 600; }
.loop-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.loop-row:last-child { border-bottom: none; }
.row-label { color: #666; font-size: 14px; }
.row-input {
  width: 120px; text-align: right; border: 1px solid #e5e5e5; border-radius: 6px;
  padding: 6px 8px; font-size: 14px; outline: none;
}
.row-input:focus { border-color: #0e90d2; }
.loop-save { margin-top: 8px; }
