/* 大拜计数器 BLE 版 V1.0 样式 */

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

:root {
  --gold:    #c9a84c;
  --gold2:   #f0d080;
  --gold3:   #8a6820;
  --bg:      #0d0a1a;
  --bg2:     #120e22;
  --card:    #1a1428;
  --card2:   #1f1932;
  --text:    #e8e0d0;
  --muted:   #8a7a9a;
  --border:  #2a2040;
  --success: #4caf70;
  --warning: #d4a020;
  --danger:  #c04040;
  --primary: #7060c0;
  --karma:   #7b4fa0;
  --karma2:  #c080f0;
  --ble:     #4090e0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── 背景装饰 ── */
.bg-decoration { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.lotus-bg {
  position: absolute;
  font-size: 200px;
  opacity: 0.03;
  filter: blur(2px);
  animation: float 20s ease-in-out infinite;
}
.lotus-1 { top: -40px; left: -40px; }
.lotus-2 { top: 40%; right: -60px; font-size: 150px; animation-delay: -7s; }
.lotus-3 { bottom: 10%; left: -30px; font-size: 120px; animation-delay: -14s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-20px) rotate(5deg); }
  66%       { transform: translateY(10px) rotate(-3deg); }
}

.mandala-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.06);
  animation: spin-slow linear infinite;
}
.ring-1 { width: 600px; height: 600px; top: -200px; right: -200px; animation-duration: 60s; }
.ring-2 { width: 400px; height: 400px; bottom: -150px; left: -150px; animation-duration: 45s; animation-direction: reverse; }
.ring-3 { width: 300px; height: 300px; top: 30%; left: 40%; border-color: rgba(112, 96, 192, 0.05); animation-duration: 90s; }

@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ── 容器 ── */
.container {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto; padding: 16px;
}

/* ── 头部 ── */
header {
  text-align: center;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
/* 图标 + 标题 + 徽章 同排 */
.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.header-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin: 0;
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.5));
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(201, 168, 76, 0.4)); }
  50%       { filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.7)); }
}
h1 {
  font-size: 1.7rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold3), var(--gold), var(--gold2), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0; line-height: 1.05;
}
.header-badge {
  font-size: 0.72rem;
  color: var(--gold2);
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.status-bar {
  display: flex; justify-content: center; align-items: center;
  gap: 10px; font-size: 0.85rem; color: var(--muted);
}
.sep { opacity: 0.4; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); transition: all 0.3s;
}
.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── 连接面板 ── */
.connect-panel {
  padding: 30px 4px 0;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.connect-card {
  background: linear-gradient(135deg, rgba(64,144,224,0.08), rgba(123,79,160,0.08));
  border: 1px solid rgba(64,144,224,0.25);
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.connect-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top, rgba(64,144,224,0.12), transparent 60%);
  pointer-events: none;
}
.connect-icon {
  font-size: 3.2rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 14px rgba(64,144,224,0.4));
}
.connect-title {
  font-size: 1.3rem; font-weight: 700;
  color: var(--gold2);
  margin-bottom: 10px;
}
.connect-tip {
  color: var(--muted); font-size: 0.85rem;
  margin-bottom: 22px;
}
.connect-hint {
  color: var(--muted); font-size: 0.8rem;
  margin-top: 14px;
}
.connect-hint a {
  color: var(--gold); text-decoration: none; border-bottom: 1px dashed currentColor;
}
.connect-status {
  margin-top: 16px;
  font-size: 0.85rem;
  min-height: 1.4em;
}
.connect-status.info  { color: var(--gold); }
.connect-status.error { color: var(--danger); }

.connect-faq {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.connect-faq summary {
  cursor: pointer; font-size: 0.9rem; color: var(--gold);
  list-style: none;
}
.connect-faq summary::-webkit-details-marker { display: none; }
.connect-faq summary::before {
  content: '▸ '; transition: transform 0.2s;
}
.connect-faq[open] summary::before { content: '▾ '; }
.connect-faq ul {
  margin-top: 12px; padding-left: 20px;
  color: var(--muted); font-size: 0.83rem; line-height: 1.8;
}
.connect-faq li { margin-bottom: 4px; }

/* ── 励志横幅 ── */
.motivation-banner {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(112,96,192,0.08));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; line-height: 1.5;
  position: relative; overflow: hidden;
}
.motivation-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.04), transparent);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.motivation-banner strong { color: var(--gold2); font-size: 1.1rem; }
.om { color: var(--gold); font-size: 1.1rem; flex-shrink: 0; }

/* ── 计数卡片 ── */
.count-section { margin-bottom: 28px; }
.count-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.count-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.count-card.main-count { padding: 28px 20px; }
.count-card.main-count::before { opacity: 1; }
.count-label {
  font-size: 0.82rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.count-value {
  font-size: 4.2rem; font-weight: 700; color: #fff;
  font-family: 'SF Mono', 'Consolas', monospace;
  text-shadow: 0 0 30px rgba(201,168,76,0.3);
  transition: transform 0.15s ease;
  line-height: 1.1;
}
.count-value.small { font-size: 2.6rem; }
.count-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.progress-bar {
  height: 6px; background: var(--border); border-radius: 3px;
  margin: 16px 0 8px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold3), var(--gold), var(--gold2));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.target-info { font-size: 0.82rem; color: var(--muted); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 今日用时 */
.today-mins-bar {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin-top: 12px; padding: 7px 14px;
  background: rgba(201,168,76,0.07);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 8px;
}
.today-mins-label { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.5px; }
.today-mins-value {
  font-size: 0.95rem; font-weight: 700; color: var(--gold2);
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* ── 按钮 ── */
.btn {
  padding: 12px 18px; border: none; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.97); }
.btn-large { padding: 16px 22px; font-size: 1.05rem; letter-spacing: 0.5px; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  color: #1a1000;
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(201,168,76,0.3); transform: translateY(-1px); }

.btn-karma {
  background: linear-gradient(135deg, #4a2870, var(--karma), var(--karma2));
  color: #f0e8ff;
  border: 1px solid rgba(192,128,240,0.3);
}
.btn-karma:hover {
  box-shadow: 0 4px 20px rgba(123,79,160,0.45);
  transform: translateY(-1px);
}

.btn-secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn-warning   { background: rgba(212,160,32,0.15); color: var(--warning); border: 1px solid rgba(212,160,32,0.3); }
.btn-danger    { background: rgba(192,64,64,0.15);  color: var(--danger);  border: 1px solid rgba(192,64,64,0.3); }
.btn-reset     { background: rgba(192,64,64,0.1);   color: #e08080;        border: 1px solid rgba(192,64,64,0.3); }
.btn-block { width: 100%; margin-top: 14px; }

/* ── 设置区域 ── */
.settings-section, .history-section, .system-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}
h2 {
  font-size: 1.1rem; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.section-icon { font-size: 1.1rem; }
.sub-title { font-size: 0.92rem; color: var(--gold); margin-bottom: 6px; margin-top: 4px; }
.sub-hint  { font-size: 0.8rem; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.setting-item { margin-bottom: 18px; }
.setting-item label {
  display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px;
}
.setting-control { display: flex; align-items: center; gap: 14px; }

input[type=range] {
  flex: 1; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  cursor: pointer; border: none;
}

input[type=number], input[type=text], input[type=password] {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
input[type=number] { width: 100px; text-align: center; }
input[type=number]:focus,
input[type=text]:focus,
input[type=password]:focus { border-color: var(--gold); }

.setting-value { min-width: 80px; text-align: right; font-weight: 600; color: var(--gold); font-size: 0.9rem; }
.setting-hint  { font-size: 0.78rem; color: var(--muted); }

#init-days:focus,
#init-count:focus { border-color: var(--karma2); }

.init-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.init-item label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.init-item input[type=number] { width: 100%; }

/* ── 历史表格 ── */
.calendar-container { max-height: 280px; overflow-y: auto; margin-bottom: 14px; }
.calendar-container::-webkit-scrollbar { width: 4px; }
.calendar-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.history-table { width: 100%; border-collapse: collapse; }
.history-table th,
.history-table td {
  padding: 11px 8px; text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.history-table th { background: var(--bg); color: var(--muted); font-weight: 500; position: sticky; top: 0; }
.history-table tbody tr:hover { background: rgba(201,168,76,0.05); }
.no-data { color: var(--muted); font-style: italic; padding: 28px !important; }

/* ── 系统 ── */
.reset-hint { font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }

/* ── 页脚 ── */
footer { text-align: center; padding: 24px; color: var(--muted); font-size: 0.82rem; }
.footer-lotus { font-size: 1.4rem; margin-bottom: 8px; }
footer p { margin: 4px 0; }
.footer-quote { font-style: italic; opacity: 0.7; margin-top: 8px; font-size: 0.78rem; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30,22,50,0.95);
  color: var(--text); padding: 12px 24px; border-radius: 10px;
  font-size: 0.9rem; opacity: 0; transition: all 0.3s; z-index: 1000;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.toast.show    { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: rgba(76,175,112,0.4); color: #7de09a; }
.toast.error   { border-color: rgba(192,64,64,0.4);  color: #e08080; }
.toast.info    { border-color: rgba(64,144,224,0.4); color: #80c0f0; }

/* ── 目标完成 ── */
@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); box-shadow: 0 0 30px rgba(201,168,76,0.25); }
}
.count-card.completed { animation: celebrate 0.8s ease; border-color: rgba(201,168,76,0.4); }
.count-card.completed .count-value {
  color: var(--gold2);
  text-shadow: 0 0 20px rgba(201,168,76,0.5);
}

/* ── 弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-card {
  background: var(--card);
  border: 1px solid rgba(192,128,240,0.35);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 360px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(123,79,160,0.2);
  transform: scale(0.92);
  transition: transform 0.25s;
}
.modal-overlay.show .modal-card { transform: scale(1); }
.modal-icon  { font-size: 2.6rem; margin-bottom: 10px; }
.modal-title {
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(135deg, var(--karma), var(--karma2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.modal-body { font-size: 0.95rem; color: var(--text); line-height: 1.8; margin-bottom: 22px; }
.modal-sub { display: block; margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.modal-sub strong { color: var(--karma2); }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-btn { margin-top: 0 !important; }

.help-card { max-width: 420px; }
.help-body { text-align: left; font-size: 0.9rem; }
.help-body p { margin-bottom: 10px; }
.help-body code {
  background: var(--bg); padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono','Consolas',monospace; font-size: 0.85em; color: var(--gold);
}

/* ── 响应式 ── */
@media (max-width: 400px) {
  .count-value       { font-size: 3.2rem; }
  .count-value.small { font-size: 2rem; }
  .btn               { padding: 10px 14px; font-size: 0.88rem; }
  .btn-large         { padding: 14px 18px; font-size: 0.95rem; }
  h1                 { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════
 *  演示模式
 * ═══════════════════════════════════════════════ */

/* 连接面板 "或" 分隔线 */
.connect-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: rgba(201, 168, 76, 0.55);
  font-size: 0.85rem;
}
.connect-divider::before,
.connect-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(201, 168, 76, 0.35),
    transparent);
}

/* 底部悬浮演示控制条 */
.demo-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(180deg,
    rgba(13, 10, 26, 0.85),
    rgba(13, 10, 26, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(201, 168, 76, 0.35);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.demo-bar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.demo-tag {
  color: #ffd54a;
  font-weight: 600;
  font-size: 0.92rem;
  flex: 0 0 auto;
  text-shadow: 0 0 8px rgba(255, 213, 74, 0.4);
}
.demo-btn {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: 0.9rem;
  min-width: 76px;
  margin: 0;
}

/* 当演示条出现时,给 container 留出底部空间避免被遮挡 */
body:has(.demo-bar:not(.hidden)) .container {
  padding-bottom: 96px;
}

/* 演示模式状态点 (橙黄色,区别于真实连接的绿色) */
.status-dot.demo {
  background: #ffd54a !important;
  box-shadow: 0 0 8px #ffd54a, 0 0 14px rgba(255, 213, 74, 0.5);
  animation: pulse-demo 2s ease-in-out infinite;
}
@keyframes pulse-demo {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ═══════════════════════════════════════════════
 *  祈祷文 (blessing)
 * ═══════════════════════════════════════════════ */
.blessing-section {
  margin: 30px auto 18px;
  max-width: 540px;
  text-align: center;
  padding: 26px 22px 22px;
  background:
    radial-gradient(circle at 50% 0%,
      rgba(201, 168, 76, 0.12) 0%,
      transparent 70%),
    linear-gradient(135deg,
      rgba(123, 79, 160, 0.18),
      rgba(13, 10, 26, 0.4));
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 16px;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.3);
}
.blessing-section::before,
.blessing-section::after {
  content: '☸';
  position: absolute;
  top: 12px;
  font-size: 1rem;
  color: rgba(201, 168, 76, 0.5);
}
.blessing-section::before { left: 16px; }
.blessing-section::after  { right: 16px; }

.blessing-title {
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 2.5px;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.35);
}
.blessing-text {
  font-family: "Songti SC", "STSong", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 1rem;
  line-height: 2.0;
  color: rgba(255, 240, 200, 0.94);
  letter-spacing: 1.8px;
}
.blessing-deco {
  font-size: 1.2rem;
  margin-top: 16px;
  letter-spacing: 14px;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════
 *  打赏 & 添加作者（替换旧的客服二维码区）
 * ═══════════════════════════════════════════════ */
.donate-section {
  margin: 20px auto 24px;
  text-align: center;
  padding: 20px 16px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 16px;
}
.donate-title {
  color: var(--gold);
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.donate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}
.donate-item {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.donate-item:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.45);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.donate-item:active { transform: scale(0.97); }
.donate-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.donate-label {
  padding: 6px 4px 7px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
}
.donate-hint {
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 10px;
}

/* 通用图片放大弹窗（打赏三张图共用，替换旧版 .qr-modal）*/
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 5000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  cursor: zoom-out;
  -webkit-tap-highlight-color: transparent;
}
.qr-modal.show {
  display: flex;
  animation: fade-in 0.2s ease;
}
.qr-modal-title {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.qr-modal img {
  max-width: min(320px, 85vw);
  max-height: min(320px, 70vh);
  border-radius: 12px;
  object-fit: contain;
  pointer-events: none;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════
 *  上次设备提示 (连接面板)
 * ═══════════════════════════════════════════════ */
.last-device-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
  padding: 10px 14px;
  background: rgba(64, 144, 224, 0.12);
  border: 1px solid rgba(64, 144, 224, 0.3);
  border-radius: 10px;
  font-size: 0.88rem;
  color: rgba(255, 240, 200, 0.85);
}
.last-device-tip .ldt-label {
  color: rgba(255, 240, 200, 0.7);
}
.last-device-tip strong {
  color: #7fb6ff;
  font-weight: 600;
}
.btn-link {
  background: none;
  border: none;
  color: rgba(255, 240, 200, 0.55);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 4px;
}
.btn-link:hover {
  color: var(--gold);
}

/* ===================== V1.1 新增：OTA / 升级相关 ===================== */

/* 上次设备提示行布局 */
.ldt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 升级待确认横幅 */
.fw-pending-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.18), rgba(255, 152, 0, 0.12));
  border: 1px solid rgba(255, 193, 7, 0.55);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(255, 152, 0, 0.15);
}
.fwpb-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.fwpb-body {
  flex: 1;
  min-width: 0;
}
.fwpb-title {
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.fwpb-text {
  font-size: 0.84rem;
  color: var(--text);
  opacity: 0.88;
  line-height: 1.5;
}
.fwpb-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.fwpb-btns .btn {
  padding: 8px 10px;
  font-size: 0.85rem;
}

/* OTA 区块 */
.ota-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.ota-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ota-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
}
.ota-info-row:last-of-type {
  border-bottom: none;
}
.ota-info-label {
  color: var(--text-muted);
}
.ota-info-value {
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84rem;
}

.ota-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 8px 0 10px;
  line-height: 1.5;
}

.ota-file-info {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
}
.ota-file-info.empty {
  color: var(--text-muted);
  font-style: italic;
}

/* OTA 进度 */
.ota-progress-wrap {
  margin: 12px 0;
  padding: 14px;
  background: rgba(94, 53, 177, 0.12);
  border: 1px solid rgba(94, 53, 177, 0.35);
  border-radius: 12px;
}
.ota-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.ota-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7e57c2, #ffb74d, #ffd54f);
  background-size: 200% 100%;
  animation: otaShine 2s linear infinite;
  width: 0%;
  transition: width 0.25s ease;
}
@keyframes otaShine {
  0%   { background-position: 200% 0; }
  100% { background-position: 0 0; }
}
.ota-progress-text {
  text-align: center;
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
}
.ota-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.ota-warn {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(244, 67, 54, 0.1);
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.5;
}

/* 绿色成功按钮（用于"确认本固件正常") */
.btn-success {
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
}
.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.45);
}
.btn-success:active:not(:disabled) {
  transform: translateY(0);
}

/* 文件选择按钮样式（隐藏原生外观） */
.ota-file-input {
  display: none;
}
.ota-file-label {
  display: inline-block;
  cursor: pointer;
}

/* 在线更新结果 */
.update-available {
  margin: 12px 0;
  padding: 14px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(46, 125, 50, 0.08));
  border: 1px solid rgba(76, 175, 80, 0.45);
  border-radius: 12px;
}
.update-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.update-version {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.update-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.update-notes {
  font-size: 0.84rem;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}
.update-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.update-latest {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.25);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #81c784;
  text-align: center;
}
.update-error {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.25);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #ef9a9a;
  text-align: center;
}

/* 手动选文件折叠 */
.ota-manual-toggle {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}
.ota-manual-toggle summary {
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}
.ota-manual-toggle summary::-webkit-details-marker { display: none; }
.ota-manual-toggle summary::before {
  content: '▶ ';
  font-size: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}
.ota-manual-toggle[open] summary::before {
  transform: rotate(90deg);
}
.ota-manual-body {
  padding: 0 14px 14px;
}

/* 首页固件预下载区 */
.preload-section {
  margin-top: 16px;
}
.preload-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}
.preload-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
}
.preload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.preload-available {
  margin-top: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(46, 125, 50, 0.06));
  border: 1px solid rgba(76, 175, 80, 0.35);
  border-radius: 10px;
}
.preload-ready {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.35);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #81c784;
  line-height: 1.6;
  text-align: center;
}
.preload-dl-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* 已缓存固件横幅 */
.fw-cached-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(46, 125, 50, 0.08));
  border: 1px solid rgba(76, 175, 80, 0.5);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.15);
}
.fwcb-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.fwcb-body {
  flex: 1;
  min-width: 0;
}
.fwcb-title {
  font-weight: 600;
  color: #66bb6a;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.fwcb-text {
  font-size: 0.84rem;
  color: var(--text);
  opacity: 0.88;
  line-height: 1.5;
}
.fwcb-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.fwcb-btns .btn {
  padding: 8px 10px;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════
 *  好物推荐入口 + 弹窗
 *  类名统一带 ad- 前缀，与原有 .modal-overlay/.modal-title 等完全隔离
 * ═══════════════════════════════════════════════ */
.ad-entry-btn {
  display: block; width: 100%; max-width: 360px;
  margin: 0 auto 20px; padding: 13px 16px;
  background: linear-gradient(135deg, var(--gold3), var(--gold), var(--gold2));
  border: none; border-radius: 12px; color: #1a1000;
  font-size: 1rem; font-weight: 700; letter-spacing: .5px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,168,76,.28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ad-entry-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(201,168,76,.4); }
.ad-entry-btn:active { transform: scale(.98); }

.ad-modal-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(8,6,16,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: none; flex-direction: column;
}
.ad-modal-overlay.active { display: flex; animation: ad-fade .2s ease; }
@keyframes ad-fade { from { opacity: 0; } to { opacity: 1; } }

.ad-modal-header {
  flex: none; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.ad-modal-title { color: var(--gold); font-size: 1.05rem; font-weight: 600; letter-spacing: .5px; }
.ad-close-modal {
  font-size: 1.7rem; line-height: 1; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 0 6px;
}
.ad-close-modal:hover { color: var(--text); }

.ad-modal-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.ad-product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.ad-product-link { text-decoration: none; color: inherit; display: block; }
.ad-product-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ad-product-link:hover .ad-product-card {
  transform: translateY(-2px); border-color: rgba(201,168,76,.45);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.ad-product-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #0f0b1c; }
.ad-product-info { padding: 10px 11px 12px; }
.ad-product-name {
  font-size: .86rem; color: var(--text); line-height: 1.4; min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.ad-state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; line-height: 1.8; }
.ad-state-sub { font-size: .82rem; margin-top: 6px; }
.ad-state-sub b { color: var(--gold); }

@media (max-width: 340px) { .ad-product-grid { grid-template-columns: 1fr; } }

/* 好物推荐：分组标题、列表容器、价格 */
.ad-list { max-width: 540px; margin: 0 auto; }
.ad-section-title {
  color: var(--gold); font-size: .92rem; font-weight: 600; letter-spacing: .5px;
  margin: 20px 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.ad-section-title:first-child { margin-top: 2px; }
.ad-product-price { color: var(--gold2); font-weight: 700; font-size: .9rem; margin-top: 4px; }

/* 没填真实链接的商品：不可点击，淡化处理 + “敬请期待”角标 */
.ad-product-nolink { cursor: default; }
.ad-product-nolink .ad-product-card { opacity: .72; }
.ad-product-nolink:hover .ad-product-card { transform: none; border-color: var(--border); box-shadow: none; }
.ad-product-soon {
  display: inline-block; margin-top: 6px; font-size: .72rem; color: var(--muted);
  background: rgba(138,122,154,.14); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 8px;
}

/* ═══════════════════════════════════════════════
 *  首页小组件（Bug 4: homepage.json 装修系统）
 * ═══════════════════════════════════════════════ */
.homepage-widgets-wrap {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 公告横幅 */
.hw-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg,
    rgba(201,168,76,0.08), rgba(112,96,192,0.08));
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
}
a.hw-notice-link:hover {
  border-color: rgba(201,168,76,0.45);
  background: linear-gradient(135deg,
    rgba(201,168,76,0.13), rgba(112,96,192,0.12));
}
.hw-notice-icon { font-size: 1.05rem; flex-shrink: 0; }
.hw-notice-text { color: var(--text); }

/* 按钮组 */
.hw-button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.86rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  white-space: nowrap;
}
.hw-btn:hover {
  background: var(--card2);
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-1px);
}
.hw-btn:active { transform: scale(0.97); }
.hw-btn-icon  { font-size: 1rem; }
.hw-btn-label { color: var(--text); }

/* 上传的图片图标（按钮组 / 公告横幅通用，自动贴合大小） */
.hw-img-icon {
  width: 1.2em; height: 1.2em;
  object-fit: contain;
  border-radius: 4px;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

/* 链接卡片 */
.hw-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.hw-link-card:hover {
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.hw-link-card:active { transform: scale(0.98); }
.hw-card-img {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card2);
  border: 1px solid var(--border);
}
.hw-card-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.hw-card-body { flex: 1; min-width: 0; }
.hw-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
 *  历史记录日历弹窗
 * ═══════════════════════════════════════════════ */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(8, 6, 16, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 12px 24px;
  overflow-y: auto;
}
.cal-modal-overlay.show {
  display: flex;
  animation: cal-fade 0.22s ease;
}
@keyframes cal-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cal-modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65), 0 0 30px rgba(123,79,160,0.12);
  margin-top: 8px;
}

/* ── 弹窗标题栏 ── */
.cal-mh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.cal-mh-title {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.cal-mh-close {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}
.cal-mh-close:hover { color: var(--text); }

/* ── 月份导航 ── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.cal-nav-btn:hover {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.4);
  color: var(--gold);
}
.cal-nav-btn:active { transform: scale(0.94); }
.cal-month-sel {
  padding: 8px 14px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  min-width: 128px;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23c9a84c' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* ── 星期头 ── */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 12px 2px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 3px 0;
}
.cal-wkend { color: rgba(201,168,76,0.65) !important; }

/* ── 日历格 ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 4px 12px 14px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.cal-cell.cal-empty { cursor: default; pointer-events: none; }
.cal-cell:not(.cal-empty):hover {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.22);
}
.cal-cell:not(.cal-empty):active { transform: scale(0.94); }

/* 有数据的格：金色调 */
.cal-cell.cal-has-data {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.28);
}
.cal-cell.cal-has-data:hover {
  background: rgba(201,168,76,0.18);
  border-color: rgba(201,168,76,0.5);
}

/* 今天 */
.cal-cell.cal-today {
  background: rgba(112,96,192,0.18);
  border-color: rgba(112,96,192,0.45);
}
.cal-cell.cal-today.cal-has-data {
  background: rgba(201,168,76,0.18);
  border-color: rgba(201,168,76,0.65);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.2);
}

/* 选中 */
.cal-cell.cal-selected {
  background: rgba(64,144,224,0.22) !important;
  border-color: rgba(64,144,224,0.6) !important;
}

.cal-dn {
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1;
}
.cal-dc {
  font-size: 0.6rem;
  color: var(--gold2);
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}

/* ── 月份记录列表 ── */
.cal-list-section {
  border-top: 1px solid var(--border);
  padding: 13px 16px 16px;
  max-height: 280px;
  overflow-y: auto;
}
.cal-list-section::-webkit-scrollbar { width: 3px; }
.cal-list-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cal-list-title {
  font-size: 0.84rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.cal-month-stats {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 7px 12px;
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 8px;
  text-align: center;
}

.cal-list-row {
  display: flex;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(42,32,64,0.6);
  gap: 0;
  border-radius: 6px;
  transition: background 0.2s;
}
.cal-list-row:last-child { border-bottom: none; }
.cal-row-hl { background: rgba(201,168,76,0.1) !important; }

.cal-lr-date {
  font-size: 0.86rem;
  color: var(--text);
  font-family: 'SF Mono','Consolas',monospace;
  flex: 0 0 54px;
}
.cal-lr-count {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold2);
  flex: 1;
}
.cal-lr-dur {
  font-size: 0.78rem;
  color: var(--muted);
}

.cal-no-data {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 22px 0;
}
