/* ============ 沐浴打卡 全局样式 ============ */
:root {
  --bg0: #0b1526;
  --bg1: #0f2030;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #e3eef3;
  --text-dim: #8fb3c0;
  --accent: #2bbd8f;
  --accent2: #1f9d8a;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

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

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(43, 189, 143, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31, 120, 180, 0.10), transparent 60%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ============ 登录 ============ */
#login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0b1526, #10323a 70%, #0d3b33);
}
.login-card {
  width: min(360px, 90vw); text-align: center; padding: 40px 32px;
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border);
  border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.login-icon { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
#login-password {
  width: 100%; padding: 13px 15px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.3); color: #fff; font-size: 15px; outline: none; margin-bottom: 14px;
}
#login-password:focus { border-color: var(--accent); }
#btn-login {
  width: 100%; padding: 13px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff;
  font-size: 16px; font-weight: 600;
}
#btn-login:hover { filter: brightness(1.1); }
#btn-login:disabled { opacity: .6; cursor: wait; }
.login-error { color: #ff8f8f; font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-lock-hint { color: #ffd479; font-size: 12px; margin-top: 8px; }

/* ============ 标题栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 58px;
  background: rgba(11, 21, 38, 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-icon { font-size: 22px; }
.brand-text { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: var(--text-dim); margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.today-chip {
  font-size: 12.5px; color: var(--text-dim);
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border);
  padding: 6px 12px; border-radius: 20px;
}
.today-chip.has { color: #7ff0c8; border-color: rgba(43,189,143,.45); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 17px;
  background: rgba(255,255,255,.07); border: 1px solid var(--panel-border); color: var(--text);
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.ghost-btn {
  padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
  background: transparent; border: 1px solid rgba(255,255,255,.2); color: var(--text-dim);
}
.ghost-btn:hover { color: var(--text); border-color: rgba(255,255,255,.4); }

/* ============ 三栏布局 ============ */
.layout {
  display: grid; grid-template-columns: 285px minmax(0, 1fr) 300px;
  gap: 14px; padding: 14px; max-width: 1560px; margin: 0 auto;
  align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.panel-title {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ============ 左侧：日历 ============ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-size: 15px; font-weight: 600; }
.cal-nav {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px;
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); color: var(--text);
}
.cal-nav:hover { background: rgba(255,255,255,.14); }
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13.5px; cursor: pointer; position: relative;
  background: rgba(255,255,255,.03); border: 1px solid transparent; user-select: none;
}
.cal-cell:hover { background: rgba(255,255,255,.09); }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.checked { background: rgba(43,189,143,.16); border-color: rgba(43,189,143,.4); color: #8df0cc; }
.cal-cell.today { border-color: #ffd479; }
.cal-cell.selected { background: rgba(43,189,143,.30); }
.cal-cell .cal-dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 3px; background: transparent; }
.cal-cell.checked .cal-dot { background: var(--accent); }
.cal-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.checked { background: var(--accent); }
.dot.today { background: transparent; border: 2px solid #ffd479; }
.cal-day-info {
  margin-top: 12px; padding: 12px; border-radius: 10px; font-size: 13px;
  background: rgba(0,0,0,.2); border: 1px dashed rgba(255,255,255,.12);
  max-height: 190px; overflow-y: auto;
}
.cal-day-info-empty { color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }
.cal-day-info .day-title { font-weight: 600; margin-bottom: 6px; }
.cal-day-info .day-parts { color: var(--text-dim); line-height: 1.8; }
.cal-day-info .day-parts .part-chip {
  display: inline-block; padding: 2px 9px; margin: 2px 3px 2px 0; border-radius: 20px;
  background: rgba(43,189,143,.13); border: 1px solid rgba(43,189,143,.3); font-size: 12px; color: #9fe9cd;
}

/* ============ 中间：相机打卡 ============ */
.cam-status { font-size: 12.5px; color: var(--text-dim); }
.cam-status.on { color: #7ff0c8; }

.part-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.part-chip {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--panel-border); color: var(--text-dim);
  transition: all .15s; user-select: none;
}
.part-chip:hover { background: rgba(255,255,255,.10); }
.part-chip.selected { background: rgba(43,189,143,.20); border-color: var(--accent); color: #8df0cc; }
.part-chip .chip-icon { font-size: 20px; }
.part-chip .chip-name { font-size: 12.5px; }

.upload-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.ctrl-btn.big { flex: 1; padding: 14px; font-size: 15px; font-weight: 600; }

.pending-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pending-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-border); border-radius: 10px;
}
.pending-item .thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #000; flex-shrink: 0; }
.pending-item .meta { flex: 1; font-size: 12.5px; color: var(--text-dim); line-height: 1.7; min-width: 0; }
.pending-item .meta .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-actions { display: flex; gap: 10px; margin-bottom: 8px; }
.pending-actions .ctrl-btn { flex: 1; }
.upload-status { font-size: 13px; min-height: 18px; color: #7ff0c8; margin-bottom: 6px; }
.upload-status.err { color: #ff8f8f; }

.cam-controls { display: flex; gap: 10px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.ctrl-btn {
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
  background: rgba(255,255,255,.07); border: 1px solid var(--panel-border); color: var(--text);
  transition: filter .15s;
}
.ctrl-btn:hover { filter: brightness(1.2); }
.ctrl-btn:disabled { opacity: .45; cursor: not-allowed; }
.ctrl-btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none; font-weight: 600; color: #fff;
}
.ctrl-btn.record.recording {
  background: rgba(255, 80, 80, .9); border: none; color: #fff; font-weight: 600;
  animation: pulse 1.2s infinite;
}
.ctrl-btn.small { padding: 7px 12px; font-size: 13px; }

.today-block { margin-top: 16px; }
.sub-title { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; color: var(--text-dim); }
.count-badge {
  display: inline-block; min-width: 22px; text-align: center; padding: 2px 7px;
  background: var(--accent); color: #04261c; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.media-item {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  aspect-ratio: 1; background: rgba(0,0,0,.35); border: 1px solid var(--panel-border);
}
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; filter: blur(14px); transform: scale(1.08); }
.media-item .media-tag {
  position: absolute; left: 4px; bottom: 4px; right: 4px; font-size: 10.5px;
  color: #fff; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 6px;
  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-item .media-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.media-item.empty { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12px; cursor: default; }
.privacy-note { margin-top: 14px; font-size: 11.5px; color: #5f8492; text-align: center; line-height: 1.8; }

/* ============ 右侧：放松区 ============ */
.amb-title { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.amb-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.amb-btn {
  padding: 12px 8px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); color: var(--text);
}
.amb-btn:hover { background: rgba(255,255,255,.13); }
.amb-btn.playing { background: rgba(43,189,143,.22); border-color: var(--accent); color: #8df0cc; }
.amb-btn.stop { grid-column: span 2; }
.music-block { margin-top: 18px; }
#music-player { width: 100%; margin-bottom: 10px; border-radius: 8px; }
.music-list { list-style: none; max-height: 200px; overflow-y: auto; }
.music-list li {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 8px; color: var(--text-dim);
}
.music-list li:hover { background: rgba(255,255,255,.08); color: var(--text); }
.music-list li.playing { color: #8df0cc; background: rgba(43,189,143,.12); }
.music-hint { margin-top: 10px; font-size: 11.5px; color: #5f8492; line-height: 1.8; }
.music-hint code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 5px; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 10, 18, 0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box {
  width: min(720px, 96vw); max-height: 88vh; display: flex; flex-direction: column;
  background: #10202f; border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--panel-border); font-weight: 600;
}
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
  background: rgba(255,255,255,.07); border: 1px solid var(--panel-border); color: var(--text);
}
.modal-close:hover { background: rgba(255,80,80,.25); }
.tabs { display: flex; gap: 8px; padding: 12px 18px 0; }
.tab {
  padding: 9px 18px; border-radius: 10px 10px 0 0; cursor: pointer; font-size: 14px;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  border-bottom: none;
}
.tab.active { background: rgba(255,255,255,.07); color: var(--text); border-color: var(--panel-border); }
.tab-page { padding: 16px 18px 18px; overflow-y: auto; }
.opt-tip { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.opt-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.opt-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-border); border-radius: 10px;
}
.opt-row .opt-icon { font-size: 17px; width: 26px; text-align: center; }
.opt-row .opt-name { flex: 1; font-size: 14px; }
.opt-row .opt-name input {
  width: 100%; padding: 6px 9px; border-radius: 7px; font-size: 14px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.18); color: #fff; outline: none;
}
.opt-row.disabled .opt-name, .opt-row.disabled .opt-icon { opacity: .4; }
.opt-row .opt-actions { display: flex; gap: 5px; }
.mini-btn {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px;
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); color: var(--text);
}
.mini-btn:hover { background: rgba(255,255,255,.16); }
.mini-btn.danger:hover { background: rgba(255,80,80,.3); border-color: var(--danger); }
.opt-add { display: flex; gap: 8px; margin-top: 12px; }
.opt-icon-input { width: 62px; padding: 9px; border-radius: 9px; font-size: 14px; text-align: center; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); color: #fff; outline: none; }
.opt-name-input { flex: 1; padding: 9px 12px; border-radius: 9px; font-size: 14px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); color: #fff; outline: none; }

.content-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.date-input {
  padding: 8px 12px; border-radius: 9px; font-size: 14px; color-scheme: dark;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); color: #fff; outline: none;
}
.content-list { max-height: 56vh; overflow-y: auto; }
.content-list .media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.content-empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 40px 0; }
.content-summary { font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; }

/* ============ 邮件提醒配置 ============ */
.mail-form { display: flex; flex-direction: column; gap: 10px; }
.mail-check {
  display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border); user-select: none;
}
.mail-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.mail-row { display: flex; flex-direction: column; gap: 5px; }
.mail-row-2col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.mail-row label { font-size: 12.5px; color: var(--text-dim); }
.mail-row input, .mail-row select {
  padding: 10px 12px; border-radius: 9px; font-size: 14px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); color: #fff; outline: none;
}
.mail-row input:focus, .mail-row select:focus { border-color: var(--accent); }
.mail-actions { display: flex; gap: 10px; margin-top: 4px; }
.mail-status { font-size: 12.5px; min-height: 16px; color: #7ff0c8; }
.mail-status.err { color: #ff8f8f; }
.cron-box {
  margin-top: 18px; padding: 13px; border-radius: 12px;
  background: rgba(0,0,0,.22); border: 1px dashed rgba(255,255,255,.16);
}
.cron-item { font-size: 12.5px; color: var(--text-dim); margin: 8px 0 6px; line-height: 1.7; }
.cron-code {
  font-family: Consolas, Monaco, monospace; font-size: 12px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 9px 11px; color: #8df0cc;
  word-break: break-all; user-select: all; line-height: 1.7;
}
.cron-tip { font-size: 11.5px; color: #5f8492; margin-top: 8px; line-height: 1.7; }

/* ============ 内容查看弹窗 ============ */
.viewer-box {
  width: min(860px, 94vw); max-height: 90vh; display: flex; flex-direction: column;
  background: #0a1420; border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--panel-border);
}
.viewer-media { padding: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 1; min-height: 0; }
.viewer-media img, .viewer-media video { max-width: 100%; max-height: 62vh; border-radius: 10px; cursor: zoom-in; }
.viewer-media.blurred img, .viewer-media.blurred video { filter: blur(26px); transform: scale(1.05); cursor: pointer; }
.viewer-tip { text-align: center; font-size: 12px; color: #5f8492; padding: 0 0 10px; }
.danger-btn {
  margin: 0 14px 14px; padding: 11px; border-radius: 10px; cursor: pointer; font-size: 14px;
  background: rgba(255,80,80,.12); border: 1px solid rgba(255,80,80,.45); color: var(--danger);
}
.danger-btn:hover { background: rgba(255,80,80,.28); }

/* ============ 离开页面自动模糊（隐私） ============ */
body.privacy-blur #app { filter: blur(18px); transition: filter .25s; }
body.privacy-blur #app::after {
  content: "🔒 已隐藏内容（离开页面自动保护）";
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-dim); z-index: 60; pointer-events: none;
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .cal-panel { order: 2; }
  .cam-panel { order: 1; }
  .relax-panel { order: 3; }
  .cal-day-info { max-height: none; }
}
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .topbar { padding: 0 12px; }
  .cam-controls { gap: 7px; }
  .ctrl-btn { padding: 10px 12px; font-size: 13px; }
}
