/* 设计稿 token：与 Ardot「定时通知提醒 · App 界面设计」保持一致 */
:root {
  --bg: #F9F9FB;
  --card: #FFFFFF;
  --text: #0F1419;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --border: #E7E7EA;
  --accent: #5046E5;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(15,20,25,.04), 0 4px 12px rgba(15,20,25,.06);
  --shadow-float: 0 8px 24px rgba(15,20,25,.10);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: Inter, "SF Pro Text", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: #E9EAEF;
  font-family: var(--font);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }

.app {
  position: relative;
  width: 390px;
  height: 844px;
  background: var(--bg);
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15,20,25,.18);
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }

/* 状态栏：浏览器 / WebView 已有系统状态栏，模拟层统一隐藏（HTML 节点保留） */
.statusbar { display: none; }

/* 内容区：单列 wrapper，统一左右 padding 与垂直 gap
   顶部安全区由内容区承担；前一条 padding / padding-top 是不支持 env() 时的回退值 */
.content {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 18px;
  padding: 14px 20px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  overflow-y: auto; overscroll-behavior: contain;
}
.content-form {
  gap: 16px;
  padding-top: 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: 24px;
}
.pagehead h1, .navbar-title { margin: 0; font-size: 28px; font-weight: 600; line-height: 36px; letter-spacing: -.02em; }
.pagehead p { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.pagehead { display: flex; flex-direction: column; gap: 6px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.overview {
  padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; font-weight: 500;
}
.overview-accent { color: var(--accent); }

.groupline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.demo-badge {
  font-size: 10px; line-height: 1; padding: 5px 8px; border-radius: 100px;
  color: var(--warning); background: rgba(245,158,11,.10); white-space: nowrap;
}
.demo-badge[hidden] { display: none; }

/* 提醒卡片 */
.reminder-list, .log-list { display: flex; flex-direction: column; gap: 12px; }
.reminder-card {
  padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.reminder-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.reminder-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.reminder-meta { font-size: 13px; color: var(--muted); line-height: 1.3; }
.reminder-card.is-paused .reminder-title { color: var(--faint); }
.reminder-card.is-paused .reminder-meta { color: var(--warning); }
.reminder-card.is-empty { justify-content: center; color: var(--muted); font-size: 14px; }

.switch {
  position: relative; flex: 0 0 40px; width: 40px; height: 24px; border-radius: 100px;
  background: #D1D5DB; transition: background .18s ease;
}
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFF; transition: transform .18s ease; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(16px); }

.btn-primary {
  flex: 0 0 48px; height: 48px; width: 100%; border-radius: 8px;
  background: var(--accent); color: #FFF; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s ease;
}
.btn-primary:active { opacity: .82; }
.btn-primary[disabled] { opacity: .55; pointer-events: none; }

/* 底部胶囊导航 */
.tabbar { flex: 0 0 auto; padding: 12px 21px 21px; }
.tabpill {
  height: 62px; display: flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 36px; box-shadow: var(--shadow-card);
}
.tab {
  flex: 1; min-width: 0; border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); font-size: 10px; font-weight: 500;
}
.tab span { color: var(--muted); }
.tab.active { background: var(--accent); color: #FFF; }
.tab.active span { color: #FFF; }

/* 表单页 */
.navbar { display: flex; align-items: center; gap: 12px; }
.navbar-title { font-size: 22px; line-height: 30px; }
.iconbtn { width: 20px; height: 20px; display: flex; align-items: center; }
.formcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.field {
  height: 44px; padding: 0 12px; border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.field-multiline { height: 64px; }
.field-label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.field-value {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  text-align: right; font-size: 14px; font-weight: 500; color: var(--text);
}
.field-time { font-family: var(--font-num); font-size: 15px; color: var(--accent); font-weight: 600; }
.field-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.switchrow {
  padding: 14px; display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 500;
}
.hint { margin: 0; font-size: 12px; line-height: 18px; color: var(--muted); }

/* 通知预览与记录 */
.noticecard { padding: 16px; border-radius: 16px; box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 8px; }
.notice-top { display: flex; align-items: center; justify-content: space-between; }
.notice-source { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.notice-now { font-size: 12px; color: var(--faint); }
.notice-title { font-size: 16px; font-weight: 600; }
.notice-body { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.log-card { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.log-card.is-empty { justify-content: center; color: var(--muted); }
.log-status { font-size: 13px; font-weight: 500; white-space: nowrap; }
.log-status.sent { color: var(--success); }
.log-status.failed { color: var(--error); }

/* 设置占位页 */
.settingcard { padding: 4px 14px; }
.settingrow { padding: 14px 0; display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px solid var(--border); }
.settingrow:last-child { border-bottom: 0; }
.settingval { color: var(--muted); font-size: 13px; }

/* Toast */
.toast {
  position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%);
  max-width: 320px; padding: 10px 16px; border-radius: 100px;
  background: rgba(15,20,25,.88); color: #FFF; font-size: 13px;
  text-align: center; z-index: 10; box-shadow: var(--shadow-float);
}
.toast[hidden] { display: none; }

@media (max-width: 430px) {
  body { background: var(--bg); display: block; }
  .app { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
  .tabbar { padding-bottom: max(21px, env(safe-area-inset-bottom)); }
  /* 顶部安全区已上移到 .content / .content-form，状态栏不再占据高度 */
}
