/* ============================================================
   style.css — 日程助手样式
   ============================================================ */

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

:root {
  --bg:        #f5f5f0;
  --surface:   #ffffff;
  --border:    rgba(0,0,0,0.08);
  --border-md: rgba(0,0,0,0.15);
  --text:      #1a1a1a;
  --text-2:    #666660;
  --text-3:    #999993;
  --blue:      #378ADD;
  --green:     #1D9E75;
  --red:       #E24B4A;
  --amber:     #EF9F27;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #1a1a1a;
    --surface: #2a2a2a;
    --border:  rgba(255,255,255,0.08);
    --border-md: rgba(255,255,255,0.15);
    --text:    #f0f0ea;
    --text-2:  #aaa9a3;
    --text-3:  #777772;
  }
}

html, body {
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── 页面切换 ── */
.page { min-height: 100vh; }
.hidden { display: none !important; }

/* ── 全局错误 ── */
.global-error {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--red); color: #fff;
  padding: 12px 20px; font-size: 14px;
  text-align: center; z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.2s;
}
.global-error.show { transform: translateY(0); }

/* ── 登录页 ── */
.login-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 24px;
  gap: 16px;
}

.login-logo { font-size: 56px; line-height: 1; }

.login-title {
  font-size: 28px; font-weight: 600;
  color: var(--text); letter-spacing: -0.5px;
}

.login-sub {
  font-size: 14px; color: var(--text-2);
  margin-bottom: 8px;
}

.btn-google {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  background: var(--surface);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 500;
  color: var(--text); cursor: pointer;
  width: 100%; max-width: 320px;
  justify-content: center;
  transition: background 0.15s;
}
.btn-google:hover { background: var(--bg); }

.invite-section {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; gap: 8px;
}
.invite-label { font-size: 13px; color: var(--text-2); text-align: center; }

input[type="text"] {
  width: 100%; padding: 11px 14px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text); font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--blue); }

/* ── 顶部栏 ── */
.top-bar {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.top-bar-inner {
  max-width: 640px; margin: 0 auto;
  padding: 12px 20px 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
}

.app-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.app-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.top-right { display: flex; align-items: center; gap: 10px; }

.date-chip {
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  background: #E6F1FB; color: #185FA5;
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0.5px solid var(--border);
  object-fit: cover;
}

/* ── Tab栏 ── */
.tab-bar {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
}
.tab-bar-inner {
  max-width: 640px; margin: 0 auto;
  display: flex;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar-inner::-webkit-scrollbar { display: none; }

.tab {
  flex: 1; min-width: 60px;
  padding: 14px 8px 12px; border: none; background: none;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s; white-space: nowrap;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.tab .tab-icon { font-size: 22px; }
.tab.active {
  color: var(--text); font-weight: 600;
  border-bottom-color: var(--text);
}

/* ── 内容区 ── */
.content { padding: 16px; max-width: 640px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

.view-desc {
  font-size: 13px; color: var(--text-2);
  line-height: 1.6; margin-bottom: 20px;
}

/* ── 分组标签 ── */
.section-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  margin: 0 0 8px;
}
.section-label:not(:first-child) { margin-top: 20px; }

.holiday-tag {
  font-size: 11px; font-weight: 500;
  color: #854F0B; background: #FAEEDA;
  padding: 2px 7px; border-radius: 6px;
  margin-left: 6px; text-transform: none; letter-spacing: 0;
}

/* ── 日程卡片 ── */
.event-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.event-card:hover { border-color: var(--border-md); }

.event-color-bar {
  width: 3px; border-radius: 2px;
  align-self: stretch; min-height: 36px; flex-shrink: 0;
}

.event-info { flex: 1; min-width: 0; }
.event-title { font-size: 14px; font-weight: 500; color: var(--text); }
.event-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.event-tag {
  display: inline-block; font-size: 11px;
  padding: 2px 8px; border-radius: 10px; margin-top: 6px;
}

.source-badge {
  font-size: 10px; padding: 2px 7px;
  border-radius: 6px; flex-shrink: 0; margin-top: 2px;
  background: var(--bg); color: var(--text-3);
  border: 0.5px solid var(--border);
}

.empty-day {
  font-size: 13px; color: var(--text-3);
  padding: 8px 0 16px; text-align: center;
}

/* ── 语音播报按钮 ── */
.speak-btn {
  width: 100%; padding: 12px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  background: none; color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; transition: background 0.15s;
}
.speak-btn:hover { background: var(--surface); }

/* ── 语音录入 ── */
.voice-fab {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px; margin: 8px 0 24px;
}

.voice-btn {
  width: 72px; height: 72px; border-radius: 50%;
  border: none; background: var(--text);
  color: var(--surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.2s;
}
.voice-btn:hover { transform: scale(1.05); }
.voice-btn.recording { background: var(--red); }

.voice-hint { font-size: 13px; color: var(--text-2); }

.transcript-box {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px; display: none;
}
.transcript-box.show { display: block; }

.transcript-text {
  font-size: 14px; color: var(--text);
  line-height: 1.6; margin-bottom: 12px;
  font-style: italic;
}

/* ── 解析结果 ── */
.parsed-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  margin-bottom: 8px;
}
.parsed-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 0.5px solid var(--border);
}
.parsed-row:last-child { border-bottom: none; }
.parsed-key { font-size: 13px; color: var(--text-2); }
.parsed-val { font-size: 13px; font-weight: 500; color: var(--text); }

/* ── 操作按钮行 ── */
.action-row {
  display: flex; gap: 8px; margin-top: 14px;
}
.btn-confirm {
  flex: 1; padding: 10px; border: none;
  border-radius: var(--radius-sm);
  background: var(--text); color: var(--surface);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-confirm:hover { opacity: 0.85; }
.btn-cancel {
  padding: 10px 16px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: none; color: var(--text-2);
  font-size: 14px; cursor: pointer;
}

/* ── 图片上传 ── */
.upload-area {
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius-md);
  padding: 32px; text-align: center;
  color: var(--text-2); cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  transition: border-color 0.15s;
  font-size: 14px;
}
.upload-area:hover { border-color: var(--blue); color: var(--blue); }

.image-preview-wrap { margin: 16px 0; }
.image-preview {
  width: 100%; border-radius: var(--radius-md);
  border: 0.5px solid var(--border); max-height: 300px;
  object-fit: contain;
}

/* ── 提醒视图 ── */
.reminder-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 8px;
}
.reminder-top {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.reminder-title { font-size: 14px; font-weight: 500; }
.reminder-time { font-size: 12px; color: var(--blue); font-weight: 500; }
.reminder-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.query-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.query-btn {
  padding: 8px 16px;
  border: 0.5px solid var(--border-md);
  border-radius: 20px; background: var(--surface);
  color: var(--text); font-size: 13px; cursor: pointer;
  transition: background 0.15s;
}
.query-btn:hover { background: var(--bg); }

/* ── 来源视图 ── */
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-item {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px; display: flex; align-items: center; gap: 12px;
}
.source-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.source-text { flex: 1; }
.source-name { font-size: 14px; font-weight: 500; }
.source-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ── Toggle开关 ── */
.toggle-pill {
  width: 44px; height: 24px; border-radius: 12px;
  border: none; cursor: pointer; flex-shrink: 0;
  position: relative; transition: background 0.2s;
}
.toggle-pill::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; transition: left 0.2s;
}
.toggle-pill.on  { background: var(--green); }
.toggle-pill.on::after  { left: 23px; }
.toggle-pill.off { background: var(--border-md); }
.toggle-pill.off::after { left: 3px; }

/* ── 管理员区域 ── */
.admin-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.admin-title { font-size: 14px; font-weight: 500; }
.admin-row { display: flex; gap: 8px; }
.admin-row input { flex: 1; }
.admin-row button {
  padding: 10px 16px; border: none;
  border-radius: var(--radius-sm);
  background: var(--text); color: var(--surface);
  font-size: 14px; cursor: pointer;
}
#invite-result { font-size: 13px; color: var(--green); }

/* ── 日程详情弹窗 ── */
.detail-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: flex-end;
}
.detail-overlay.show { display: flex; }

.detail-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
}
.detail-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 40px; width: 100%;
  display: flex; flex-direction: column; gap: 0;
}
.detail-title {
  font-size: 18px; font-weight: 600;
  margin-bottom: 16px; color: var(--text);
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 14px;
}
.detail-row span:first-child { color: var(--text-2); }
.detail-row span:last-child  { color: var(--text); font-weight: 500; text-align: right; max-width: 60%; }
.detail-actions {
  display: flex; gap: 8px; margin-top: 20px;
}
.detail-actions button {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: 0.5px solid var(--border-md);
  background: none; color: var(--text);
  transition: background 0.15s;
}
.detail-actions button:first-child {
  background: var(--text); color: var(--surface); border: none;
}

/* ── 加载/空状态 ── */
.loading, .empty, .error {
  text-align: center; padding: 24px;
  font-size: 14px; color: var(--text-3);
}
.error { color: var(--red); }

/* ── Gmail 连接按钮 ── */
.connect-btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--blue);
  color: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
  box-shadow: 0 2px 8px rgba(55,138,221,0.35);
}
.connect-btn:active { opacity: 0.8; }
.connect-btn.connected {
  background: var(--bg);
  color: var(--text-2);
  border: 0.5px solid var(--border-md);
  box-shadow: none;
  font-weight: 500;
}

/* ── 周导航 ── */
.week-nav {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; justify-content: center;
}
.week-nav-btn {
  padding: 12px 20px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 16px; cursor: pointer;
  flex-shrink: 0; font-weight: 600; min-width: 90px;
  -webkit-tap-highlight-color: transparent;
}
.week-label-btn {
  flex: 1; padding: 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 15px; cursor: pointer;
  text-align: center; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

/* ── 天分组 ── */
.day-section { margin-bottom: 8px; }

/* ── 今日高亮 ── */
.today-section {
  background: rgba(55, 138, 221, 0.07);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue);
  padding: 10px 12px 10px 14px;
  margin-left: -2px;
  margin-bottom: 8px;
}
.today-section .section-label {
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ── 月历 ── */
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; margin-bottom: 8px;
}
.cal-nav-btn {
  padding: 6px 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 16px; cursor: pointer;
}
.cal-month-label { font-size: 15px; font-weight: 600; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; margin-bottom: 16px;
}
.cal-header { font-size: 11px; color: var(--text-3); text-align: center; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border-radius: 50%; cursor: pointer;
  transition: background 0.15s; position: relative;
}
.cal-day:hover { background: var(--bg); }
.cal-today { background: var(--text); color: var(--surface); font-weight: 600; }
.cal-today:hover { background: var(--text); }
.cal-has-event::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--blue);
}
.cal-has-holiday::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--amber);
}

/* ── 悬浮添加按钮 ── */
.fab {
  position: fixed; bottom: 28px; right: 20px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--text); color: var(--surface);
  border: none; font-size: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 150; transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.93); }

/* ── 手动添加/编辑表单 ── */
.form-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: flex-end;
}
.form-overlay.show { display: flex; }
.form-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
}
.form-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 40px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.form-title { font-size: 17px; font-weight: 600; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; color: var(--text-2); }
.form-input {
  padding: 10px 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 15px; outline: none;
}
.form-input:focus { border-color: var(--blue); }
.form-select {
  padding: 10px 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 15px; outline: none;
  appearance: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-delete {
  width: 100%; margin-top: 10px; padding: 12px;
  border: 0.5px solid var(--red); border-radius: var(--radius-sm);
  background: none; color: var(--red);
  font-size: 14px; cursor: pointer;
}

/* ── 详情弹窗底部删除行 ── */
.detail-delete-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.detail-delete-row .btn-delete {
  flex: 1; margin-top: 0;
}
.btn-delete-future {
  flex: 1.4;
  padding: 12px;
  border: 1.5px solid var(--amber);
  border-radius: var(--radius-md);
  background: rgba(239,159,39,0.08);
  color: #C47E0A;
  font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: background 0.15s;
}
.btn-delete-future:hover { background: rgba(239,159,39,0.18); }

.btn-delete-batch {
  width: 100%; padding: 12px;
  margin-top: 8px;
  border: 1.5px solid var(--amber);
  border-radius: var(--radius-md);
  background: rgba(239,159,39,0.08);
  color: #C47E0A;
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: background 0.15s;
}
.btn-delete-batch:hover { background: rgba(239,159,39,0.18); }

/* ── 冲突弹窗 ── */
.conflict-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
}
.conflict-overlay.show { display: flex; }
.conflict-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px 20px; width: calc(100% - 40px); max-width: 340px;
  display: flex; flex-direction: column; gap: 16px;
}
.conflict-msg { font-size: 14px; line-height: 1.6; color: var(--text); }
.conflict-actions { display: flex; gap: 8px; }

/* ── 语言按钮 ── */
.lang-btn {
  padding: 4px 10px; border-radius: 6px;
  border: 0.5px solid var(--border-md);
  background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.lang-btn-large {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-md);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  flex-shrink: 0;
}

/* ── 多次提醒输入（竖排）── */
.remind-list {
  display: flex; flex-direction: column; gap: 10px;
}
.remind-item {
  display: flex; align-items: center; gap: 10px;
}
.remind-label {
  font-size: 13px; color: var(--text-2); width: 72px; flex-shrink: 0;
}
.remind-input-wrap {
  display: flex; gap: 6px; flex: 1;
}
.remind-num {
  width: 72px; flex-shrink: 0; padding: 10px 8px; text-align: center;
}
.remind-unit {
  flex: 1; padding: 10px 10px 10px 12px;
  font-size: 14px; font-weight: 500;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  /* 自定义箭头 */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.remind-unit:focus {
  border-color: var(--blue); outline: none;
}

/* ── 提醒横幅 ── */
.reminder-banner {
  position: fixed; bottom: 80px; left: 16px; right: 16px;
  background: var(--text); color: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  z-index: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(20px); opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  max-width: 640px; margin: 0 auto;
}
.reminder-banner.show { transform: translateY(0); opacity: 1; }
.reminder-banner-content { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.reminder-banner-icon { font-size: 20px; flex-shrink: 0; }
.reminder-banner-text { min-width: 0; }
.reminder-banner-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder-banner-time { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.reminder-banner-close {
  flex-shrink: 0; padding: 6px 12px;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  background: none; color: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
}
.reminder-banner-close:active { opacity: 0.7; }

/* ── Admin 用户选择器 ── */
.admin-user-select {
  padding: 4px 24px 4px 10px;
  border: 0.5px solid var(--border-md);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px; font-weight: 500;
  cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  max-width: 90px;
}

/* ── 待确认事件弹窗 ── */
.pending-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: flex-end;
}
.pending-overlay.show { display: flex; }
.pending-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.pending-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px 40px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.pending-header { padding-bottom: 8px; border-bottom: 0.5px solid var(--border); }
.pending-title { font-size: 16px; font-weight: 600; }
.pending-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item {
  background: var(--bg); border-radius: var(--radius-md);
  padding: 12px; display: flex; gap: 10px; align-items: flex-start;
}
.pending-item-info { flex: 1; min-width: 0; }
.pending-item-title { font-size: 14px; font-weight: 500; }
.pending-item-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.pending-item-notes { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.pending-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.pending-confirm-btn {
  padding: 6px 12px; border: none; border-radius: var(--radius-sm);
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.pending-dismiss-btn {
  padding: 6px 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: none;
  color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.pending-close-btn {
  padding: 12px; border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm); background: none;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  text-align: center;
}

/* ── 动态视图 ── */
.activity-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.activity-card:hover { border-color: var(--border-md); }

/* 待确认卡片：amber左边线 + 淡背景 */
.activity-card--pending {
  cursor: default;
  border-color: rgba(239,159,39,0.35);
  background: rgba(239,159,39,0.04);
}
.activity-card--pending:hover { border-color: rgba(239,159,39,0.5); }

/* 卡片顶部：来源 + 状态并排 */
.activity-card-top {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px; flex-wrap: wrap;
}

/* 来源标签（带颜色）*/
.activity-source-badge {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid; display: inline-flex;
  align-items: center; gap: 3px;
}

/* 状态标签 */
.activity-status-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  letter-spacing: 0.02em;
}
.activity-status-badge.pending {
  background: rgba(239,159,39,0.15);
  color: #C47E0A;
  border: 1px solid rgba(239,159,39,0.3);
}
.activity-status-badge.confirmed {
  background: rgba(29,158,117,0.12);
  color: #1D9E75;
  border: 1px solid rgba(29,158,117,0.25);
}

/* 底部元信息行 */
.activity-meta-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 6px;
}
.activity-added-at {
  font-size: 11px; color: var(--text-3);
}
.activity-notes {
  font-size: 12px; color: var(--text-2);
  margin-top: 3px; line-height: 1.4;
  opacity: 0.8;
}

/* 待确认操作按钮 */
.activity-pending-actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.activity-btn-confirm {
  flex: 1; padding: 7px 0;
  background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.activity-btn-confirm:hover { opacity: 0.88; }
.activity-btn-dismiss {
  flex: 1; padding: 7px 0;
  background: none; color: var(--text-2);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s;
}
.activity-btn-dismiss:hover { border-color: var(--red); color: var(--red); }

/* 旧的 activity-added 保留兼容 */
.activity-added {
  font-size: 11px; color: var(--text-3); margin-top: 4px;
  display: flex; align-items: center; gap: 4px;
}

/* ── 回到今天按钮 ── */
.week-today-btn {
  padding: 12px 16px; border: none;
  border-radius: var(--radius-sm);
  background: var(--blue); color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════════════════════════
   批量弹窗（居中设计）
   ══════════════════════════════════════════════════════════════ */
.batch-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  pointer-events: none; opacity: 0;
  transition: opacity .2s;
}
.batch-overlay.show { pointer-events: auto; opacity: 1; }
.batch-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}
.batch-card {
  position: relative; width: 100%; max-width: 380px;
  max-height: 85vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 0 0 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: scale(0.92) translateY(16px);
  transition: transform .25s cubic-bezier(.32,1,.6,1);
  -webkit-overflow-scrolling: touch;
}
.batch-overlay.show .batch-card { transform: scale(1) translateY(0); }

/* 标题栏 */
.batch-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 0.5px solid var(--border);
}
.batch-icon { font-size: 22px; flex-shrink: 0; }
.batch-title { font-size: 16px; font-weight: 700; color: var(--text); }
.batch-subtitle {
  font-size: 13px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.batch-close-x {
  margin-left: auto; flex-shrink: 0;
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: var(--bg); color: var(--text-2);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* 信息条 */
.batch-info-strip {
  display: flex; gap: 8px; padding: 12px 20px;
}
.batch-info-chip {
  flex: 1; background: var(--bg);
  border-radius: 10px; padding: 8px 12px;
}
.batch-info-chip-label {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  display: block; margin-bottom: 3px;
}
.batch-info-chip-val {
  font-size: 13px; font-weight: 600; color: var(--text);
}

/* 核心次数输入 */
.batch-count-hero {
  padding: 4px 20px 16px;
  border-bottom: 0.5px solid var(--border);
}
.batch-count-hero-label {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 12px; text-align: center;
}
.batch-count-hero-row {
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
.batch-stepper-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--bg); color: var(--text);
  font-size: 20px; font-weight: 300; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.batch-stepper-btn:hover { background: var(--border); }
.batch-count-hero-input {
  width: 80px; text-align: center;
  font-size: 32px; font-weight: 700; color: var(--blue);
  background: none; border: none; outline: none;
  -moz-appearance: textfield;
}
.batch-count-hero-input::-webkit-inner-spin-button,
.batch-count-hero-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.batch-count-unit-select {
  flex: 1; max-width: 90px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-md);
  background: var(--bg); color: var(--text);
  font-size: 14px; cursor: pointer;
}
.batch-preview-summary {
  margin-top: 10px; text-align: center;
  font-size: 13px; color: var(--blue);
  font-weight: 500; min-height: 18px;
}

/* 提醒折叠区 */
.batch-remind-details { margin: 0 20px; }
.batch-remind-summary {
  padding: 12px 4px;
  font-size: 13px; color: var(--text-2); font-weight: 500;
  cursor: pointer; list-style: none;
}
.batch-remind-summary::-webkit-details-marker { display: none; }
.batch-remind-body { padding-top: 8px; }

/* 操作按钮 */
.batch-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 20px 12px;
}
.batch-btn-confirm {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #378ADD, #2563c4);
  color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer; letter-spacing: .02em;
  transition: opacity .15s;
  box-shadow: 0 4px 14px rgba(55,138,221,.4);
}
.batch-btn-confirm:hover { opacity: .9; }
.batch-btn-confirm:disabled {
  background: var(--border-md); box-shadow: none; cursor: default;
}
.batch-btn-cancel {
  width: 100%; padding: 12px;
  background: none; color: var(--text-2);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: 14px; cursor: pointer;
  transition: border-color .15s;
}
.batch-btn-cancel:hover { border-color: var(--text-3); color: var(--text); }
