/* ============================================================
   智能提醒器 V10.25 — 全新现代 UI（卡片式设计）
   设计体系: 蓝色品牌色 / 卡片圆角阴影 / 表单聚焦高亮
             弹窗居中模态 + 半透明遮罩 / 全平台响应式
   兼容: 全部历史类名 + JS 动态类（alarming/flash-executing 等）
   ============================================================ */

/* ===== 设计变量 ===== */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #60A5FA;
  --primary-soft: #EFF6FF;
  --accent: #10b981;
  --accent-dark: #0d9668;
  --danger: #e74c3c;
  --danger-soft: #fdecea;
  --warn: #f59e0b;
  --warn-soft: #fef3e2;
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e2e8f0;
  --border-focus: #2563EB;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.18);
  --overlay: rgba(15, 23, 42, 0.55);
  --transition: all 0.2s ease;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius:6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== 布局 ===== */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--primary-light));
  color: #fff;
  box-shadow: 0 2px 12px rgba(30, 80, 160, 0.35);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.title-bar h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-content {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.calendar-panel {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

.side-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ===== 通用表单 ===== */
.form-group { margin-bottom: 14px; }

label, .form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 4px rgba(30, 80, 160, 0.15);
  background: #fff;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 90px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ===== 按钮 ===== */
button { font-family: inherit; cursor: pointer; }

.btn-primary, .btn-save, .btn-admin, .btn-create, .btn-vip,
.btn-alarm-confirm, .btn-alarm-ack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(30, 80, 160, 0.25);
}

.btn-primary:hover, .btn-save:hover, .btn-admin:hover, .btn-create:hover,
.btn-vip:hover, .btn-alarm-confirm:hover, .btn-alarm-ack:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 80, 160, 0.35);
}

.btn-primary:active, .btn-save:active, .btn-admin:active, .btn-create:active,
.btn-vip:active, .btn-alarm-confirm:active, .btn-alarm-ack:active {
  transform: translateY(0) scale(0.98);
}

.btn-close, .btn-close-vip, .btn-del-all, .btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-close:hover, .btn-close-vip:hover, .btn-del-all:hover, .btn-delete:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn-delete, .btn-del-all { color: var(--danger); border-color: #f5c6c0; }
.btn-delete:hover, .btn-del-all:hover { background: var(--danger-soft); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: linear-gradient(135deg, #f07060, var(--danger));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-danger:hover { filter: brightness(0.92); transform: translateY(-1px); }

.btn-vip {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.btn-vip:hover { background: linear-gradient(135deg, #d97706, #ea580c); }

.btn-save:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.btn-row button { flex: 1; min-width: 100px; }

/* ===== 弹窗（Modal）===== */
.alarm-overlay, .plan-modal-overlay, .notes-overlay, .vip-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.alarm-overlay.active, .plan-modal-overlay.active, .notes-overlay.active, .vip-overlay.active {
  display: flex;
  animation: overlayFade 0.25s ease;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.alarm-modal, .plan-modal, .notes-modal, .vip-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.alarm-modal { width: 460px; padding: 28px; }
.plan-modal { padding: 0; }
.notes-modal { width: 600px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.vip-modal { width: 420px; padding: 32px; text-align: center; }

.plan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.plan-modal-header h3 { font-size: 17px; font-weight: 600; }

.plan-modal-close, .alarm-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.plan-modal-close:hover, .alarm-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

.notes-modal h3, .alarm-modal h2, .vip-modal h2 {
  color: var(--text);
  margin-bottom: 14px;
}

.notes-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

/* 弹窗内表单规范（新建/编辑提醒等） */
.modal-body { padding: 24px; }

.modal-body .form-group { margin-bottom: 16px; }
.modal-body label, .modal-body .form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* ===== 提醒闹钟弹窗 ===== */
.alarm-modal h2 { display: flex; align-items: center; gap: 8px; color: var(--danger); }

.alarm-item {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 16px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  margin: 10px 0;
}

.alarm-time {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.alarm-modal hr { border: none; height: 1px; background: var(--border); margin: 16px 0; }

.subtask-section { margin-top: 8px; }
.subtask-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.btn-alarm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: var(--transition);
}

.btn-alarm-ack { background: linear-gradient(135deg, #34d399, var(--accent)); }
.btn-alarm-ack:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-alarm-confirm { background: linear-gradient(135deg, #60a5fa, var(--primary)); }
.btn-alarm-confirm:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-alarm-delay5 { background: linear-gradient(135deg, #fbbf24, var(--warn)); color: #fff; }
.btn-alarm-delay5:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-alarm-delay10 { background: linear-gradient(135deg, #fb923c, #f97316); }
.btn-alarm-delay10:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-alarm-weblinks { background: linear-gradient(135deg, #818cf8, #6366f1); }
.btn-alarm-weblinks:hover { filter: brightness(0.92); }

.alarm-flash {
  animation: alarmPulse 0.6s ease-in-out 4;
}
@keyframes alarmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(231, 76, 60, 0); }
}

/* ===== 日历 ===== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-header h2 { font-size: 18px; color: var(--text); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  min-height: 84px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.cal-cell:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); background: #fff; }

.cal-cell-empty { background: transparent; border-color: transparent; cursor: default; }

.cal-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-date-today {
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-cell-today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30, 80, 160, 0.12); }

.cal-pill {
  display: block;
  font-size: 11px;
  color: #fff;
  background: var(--primary-light);
  border-radius:8px;
  padding: 2px 6px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-more { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== 事项列表 / 提醒条目 ===== */
.reminder-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.plan-item, .reminder-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-item:hover, .reminder-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.plan-item.pending { border-left: 4px solid var(--warn); }
.plan-item.alarming { border-left: 4px solid var(--danger); animation: alarmPulse 0.8s infinite; }
.plan-item.executing { border-left: 4px solid var(--primary); }
.plan-item.completed { border-left: 4px solid var(--accent); opacity: 0.85; }
.plan-item.danger { border-left: 4px solid var(--danger); }

.plan-pill-reminder {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius:14px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}

.item-title { font-size: 15px; font-weight: 600; color: var(--text); }

.item-meta { font-size: 13px; color: var(--text-secondary); }

.item-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag { font-size: 12px; padding: 2px 10px; border-radius:14px; background: var(--primary-soft); color: var(--primary); }

/* ===== 徽章/状态 ===== */
.normal-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius:14px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 600;
}

.vip-badge {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  border-radius:14px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge { display: inline-block; padding: 3px 12px; border-radius:14px; font-size: 12px; font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.completed, .badge.success { background: #d1fae5; color: var(--accent-dark); }

/* ===== 表格 ===== */
.notes-table, .admin-table, .history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.notes-table th, .admin-table th, .history-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.notes-table td, .admin-table td, .history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.notes-table tr:hover td, .admin-table tr:hover td, .history-table tr:hover td {
  background: #f8fafc;
}

.notes-table-wrap, .table-wrap { overflow: auto; flex: 1; min-height: 0; }

/* ===== AI 聊天面板 ===== */
.ai-panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
  position: relative;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-header-left { display: flex; align-items: center; gap: 10px; }
.ai-header-avatar { font-size: 22px; }
.ai-header-title { font-size: 15px; font-weight: 600; }
.ai-status { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.ai-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; }

.ai-header-right { display: flex; gap: 8px; }
.ai-header-btn, .ai-header-clear, .ai-header-toggle, .ai-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius:8px;
  font-size: 13px;
  transition: var(--transition);
}
.ai-header-btn:hover, .ai-header-clear:hover, .ai-header-toggle:hover, .ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ai-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.ai-placeholder, .ai-chat-placeholder {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}

.ai-bubble { max-width: 85%; padding: 12px 16px; border-radius:14px; font-size: 14px; line-height: 1.7; }

.ai-bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.ai-bubble-ai {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.ai-bubble-role { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.ai-bubble-ai .ai-bubble-role { color: var(--primary); }
.ai-bubble-user .ai-bubble-role { color: rgba(255, 255, 255, 0.8); }

.ai-bubble-text { word-break: break-word; white-space: pre-wrap; }
.ai-bubble-text code { background: #f1f5f9; padding: 2px 6px; border-radius:6px; font-size: 13px; }
.ai-bubble-text pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius:10px; overflow-x: auto; font-size: 13px; }
.ai-bubble-text p code { background: #f1f5f9; }

.ai-bubble-system { align-self: center; font-size: 12px; color: var(--text-muted); }

.ai-typing { display: flex; gap: 4px; padding: 8px 0; }
.ai-typing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: typing 1.2s infinite; }
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.ai-thinking-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ai-thinking-badge .spinner { width: 14px; height: 14px; }

.ai-input-area {
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ai-input-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius:14px;
  padding: 4px 6px 4px 16px;
  transition: var(--transition);
}
.ai-input-card:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(30, 80, 160, 0.1); }

.ai-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}
.ai-input:focus { box-shadow: none; border: none; }

.ai-attach-bar { display: flex; gap: 6px; align-items: center; }
.ai-attach-label {
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius:8px;
  transition: var(--transition);
}
.ai-attach-label:hover { background: var(--primary-soft); color: var(--primary); }
.ai-attach-label:active { transform: scale(0.95); }
.ai-attach-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
}
.ai-attach-btn:hover { color: var(--primary); transform: scale(1.1); }
.ai-attach-btn svg { width: 20px; height: 20px; }
.ai-attach-tag {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  padding: 3px 10px;
  border-radius:14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ai-attach-image-preview { max-width: 80px; border-radius:10px; border: 2px solid var(--border); }
.ai-attach-image-preview img { width: 100%; border-radius:8px; display: block; }
.ai-attach-image-preview img:hover { opacity: 0.8; }
.ai-attach-remove {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -26px;
  margin-left: 68px;
  position: absolute;
}
.ai-attach-remove:hover { background: #c0392b; }
.ai-attach-text { font-size: 12px; color: var(--text-secondary); }

.ai-input-actions { display: flex; gap: 8px; }
.ai-input-right { display: flex; gap: 8px; align-items: center; }
.ai-input-disclaimer { font-size: 11px; color: var(--text-muted); text-align: center; }

.ai-send-btn {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(30, 80, 160, 0.3);
  flex-shrink: 0;
}
.ai-send-btn:hover { transform: scale(1.06); filter: brightness(1.05); }
.ai-send-btn:active { transform: scale(0.94); }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ai-send-btn svg { width: 20px; height: 20px; }

.ai-model-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.ai-model-btn {
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  padding: 5px 12px;
  border-radius:14px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.ai-model-btn:hover { background: var(--primary); color: #fff; }
.ai-model-settings-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius:14px;
  font-size: 13px;
  transition: var(--transition);
}
.ai-model-settings-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 管理后台 ===== */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-header h2 { font-size: 20px; color: var(--text); }

.admin-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.admin-section h3 { font-size: 16px; margin-bottom: 14px; color: var(--text); }

.admin-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.admin-form-row .fg { flex: 1; min-width: 180px; }

/* ===== 设置页 ===== */
.settings-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.settings-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.settings-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.settings-row:last-child { border-bottom: none; }
.settings-msg { color: var(--accent-dark); font-size: 14px; padding: 8px 0; }

/* ===== 历史页 ===== */
.history-wrap { max-width: 1000px; margin: 0 auto; padding: 20px; }
.history-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}
.history-check { color: var(--accent); font-weight: 700; }
.history-check.disabled { color: var(--text-muted); }

/* ===== 认证页（登录/注册）===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #16294a 0%, var(--primary-dark) 40%, var(--primary) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 420px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card h1 {
  color: var(--primary);
  font-size: 26px;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 28px;
}

.auth-card .form-group { margin-bottom: 18px; }
.auth-card label { font-weight: 600; }
.auth-card input { padding: 12px 16px; }

.auth-card .btn-primary { width: 100%; padding: 14px; font-size: 16px; }
.auth-card .error-msg {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid #f5c6c0;
}

.auth-card .auth-links { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-card .auth-links a { color: var(--primary); font-weight: 600; }
.auth-card .auth-links a:hover { text-decoration: underline; }

/* ===== VIP ===== */
.btn-vip-buy {
  display: inline-block;
  margin: 14px 0;
  padding: 12px 28px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
.btn-vip-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45); }

/* ===== 杂项 ===== */
.quick-item-select { margin-bottom: 8px; }
.notes-cell-input { width: 100%; padding: 6px 10px; font-size: 14px; }
.notes-col-num { color: var(--text-muted); font-size: 13px; }

/* 子任务勾选行（label 容器：flex 对齐） */
.subtask-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  margin: 5px 0;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius:10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
}
.subtask-checkbox:hover { border-color: var(--primary-light); background: var(--primary-soft); }

.subtask-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.quota-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  border-radius:14px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.listening {
  background: var(--danger-soft);
  border-color: var(--danger);
  animation: alarmPulse 1s infinite;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.w3 { font-weight: 300; }
.org { color: var(--warn); }
.flash-executing { animation: alarmPulse 0.8s infinite; }

.cls { cursor: pointer; }
.links { color: var(--primary); }
.links:hover { text-decoration: underline; }

.chat-msg-ai { background: var(--primary-soft); color: var(--text); }
.chat-msg-user { background: var(--primary); color: #fff; }
.chat-time { font-size: 11px; color: var(--text-muted); }

.hidden { display: none !important; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius:8px; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .side-panel { width: 300px; }
}

@media (max-width: 900px) {
  .main-content { flex-direction: column; padding: 14px; }
  .side-panel { width: 100%; }
  .ai-panel { height: 480px; }
  .notes-modal { width: 94vw; height: 82vh; }
}

@media (max-width: 600px) {
  .title-bar { padding: 12px 16px; }
  .title-bar h1 { font-size: 17px; }
  .main-content { padding: 10px; gap: 12px; }
  .calendar-panel { padding: 12px; }
  .cal-cell { min-height: 62px; padding: 4px; }
  .cal-date { font-size: 12px; }
  .alarm-modal { width: 94vw; padding: 20px; }
  .notes-modal { width: 96vw; padding: 16px; }
  .vip-modal { width: 92vw; padding: 24px; }
  .auth-card { padding: 30px 22px; }
  .btn-row button { min-width: 80px; padding: 10px 12px; }
  .ai-bubble { max-width: 92%; }
  .admin-form-row { flex-direction: column; align-items: stretch; }
  .admin-form-row .fg { min-width: 0; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 54px; }
  .cal-pill { font-size: 10px; padding: 1px 4px; }
  .item-title { font-size: 14px; }
  .title-bar { gap: 6px; }
}

/* ============================================================
   V0.14 移动端适配 + AI 聊天体验优化（微信风格气泡/键盘适配）
   ============================================================ */

/* --- AI 聊天气泡：常规聊天软件风格（浅蓝窄款，紧凑）--- */
.chat-msg-user { display: flex; justify-content: flex-end; margin: 2px 0; }
.chat-msg-ai { display: flex; justify-content: flex-start; margin: 2px 0; }
.chat-bubble {
  max-width: 62%;
  width: auto;
  height: auto;
  padding: 5px 10px;
  border-radius:10px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  display: inline-block;
}
.chat-msg-user .chat-bubble {
  background: #dbeafe;            /* 浅蓝底（非深色大块） */
  color: #1e293b;
  border-bottom-right-radius: 4px;
}
.chat-msg-ai .chat-bubble {
  background: #f2f3f5;
  color: #303030;
  border-bottom-left-radius: 4px;
}
.ai-chat-area { padding: 6px 10px; gap: 0; }

/* 顶部标题栏：压缩高度、紧凑控件 */
.ai-header { padding: 5px 8px; gap: 6px; }
.ai-header-avatar { width: 24px; height: 24px; }
.ai-header-title { font-size: 13px; font-weight: 600; }
.ai-header-btn, .ai-close-btn, .ai-header select {
  height: 24px; font-size: 12px; padding: 0 7px;
}
.ai-header-divider { margin: 0; }

/* 模型状态提示：小字紧凑，占最少垂直空间 */
.ai-status { font-size: 11px; padding: 3px 10px; line-height: 1.4; color: var(--text-muted); }
.ai-status-dot { width: 7px; height: 7px; }

/* 底部输入区：高度适中、按钮紧凑 */
.ai-input-area { padding: 5px 8px 6px; }
.ai-input-card textarea { font-size: 14px; min-height: 36px; padding: 7px 10px; }
.ai-send-btn { width: 36px; height: 36px; }
.ai-voice-btn, .ai-attach-btn { padding: 4px 10px; font-size: 12px; }
.ai-toolbar { margin-top: 4px; gap: 8px; }
.ai-input-disclaimer { font-size: 10px; }

/* 待提醒清单：局部滚动（固定最大高度，页面不拉长） */
.reminder-list-scroll { max-height: 56vh; }
@media (max-width: 768px) {
  .reminder-list-scroll { max-height: 48vh; }
}

/* --- AI 面板移动端全屏 + 键盘不遮挡聊天记录 --- */
@media (max-width: 768px) {
  .ai-overlay { padding: 0; }
  .ai-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  /* 输入区吸附底部：键盘弹起时贴在键盘上方，聊天记录可见 */
  .ai-input-area {
    position: sticky;
    bottom: 0;
    background: var(--card);
    z-index: 10;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    border-top: 1px solid var(--border);
  }
  .ai-chat-area { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
}

@media (max-width: 600px) {
  /* iOS 防自动缩放：输入字号 ≥16px */
  .ai-input-card textarea { font-size: 16px !important; min-height: 40px; }
  /* 输入区按钮轻量化 */
  .ai-send-btn { width: 38px; height: 38px; }
  .ai-voice-btn { padding: 4px 10px; font-size: 12px; }
  .ai-attach-btn { padding: 4px 8px; font-size: 12px; }
  .ai-input-area { padding: 6px 8px; }
  .ai-toolbar { margin-top: 6px; }
  /* 气泡手机适读 */
  .chat-bubble { font-size: 15px; padding: 6px 10px; }
  .chat-msg-user, .chat-msg-ai { margin: 2px 0; }
  /* AI 头部紧凑单行 */
  .ai-header { padding: 6px 8px; gap: 4px; }
  .ai-header-right select { min-width: 84px; height: 26px; font-size: 11px; padding: 2px 18px 2px 6px; }
  .ai-header-right .ai-header-btn, .ai-header-right .ai-close-btn { height: 26px; padding: 0 6px; }
  /* 全站内容不横向溢出 */
  .main-content, .settings-page, .history-page { overflow-x: hidden; }
  .time-bar { gap: 6px; padding: 10px 12px; }
  .time-bar input[type="date"] { width: 150px !important; font-size: 14px; height: 34px; }
  .time-stepper { height: 34px; }
  .ts-num, .ts-colon { font-size: 16px; }
  .btn-time { width: 34px; height: 34px; font-size: 17px; }
}

/* ============================================================
   V0.19 报警闪烁增强 v2（动画挂 td 保证跨浏览器可靠渲染）
   ============================================================ */
@keyframes rowFlash {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(231, 76, 60, 0.25); }
}

/* 待提醒清单：执行中（已已知晓未闭环）行红色闪烁（tr + td 双保险） */
.reminder-table tr.executing { border-left: 3px solid #e74c3c; }
.reminder-table tr.executing td {
  animation: rowFlash 1s infinite;
  font-weight: 600;
}

/* 待提醒清单：待处理（报警中）行橙色闪烁 */
.reminder-table tr.alarming { border-left: 3px solid #f39c12; }
.reminder-table tr.alarming td {
  animation: rowFlash 0.8s infinite;
}

/* 报警弹窗脉冲光晕（复用 alarmPulse 红晕动画；active 挂在 overlay 上） */
.alarm-overlay.active .alarm-modal { animation: alarmPulse 1s infinite; }

/* ============================================================
   V0.6 移动端专项优化（AI 助手 / 设置页 / 主界面对齐）
   ============================================================ */

/* ===== 平板/小屏：AI 全屏化 + 设置页整理 ===== */
@media (max-width: 768px) {
  .ai-overlay { padding: 0; }
  .ai-panel { width: 100%; height: 100%; max-height: 100vh; border-radius: 0; }
  .ai-chat-area { padding: 10px; }
  .ai-input-area { padding: 8px 10px; }

  .settings-page { padding: 12px; }
  .settings-section { padding: 14px 16px; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .settings-select { width: 100% !important; }
}

/* ===== 手机（<600px）：紧凑对齐 ===== */
@media (max-width: 600px) {
  /* 时间设置栏：label 独占一行，控件紧凑 */
  .time-bar { gap: 6px; padding: 10px 12px; }
  .time-bar .label { width: 100%; margin-bottom: 2px; }
  .time-bar input[type="date"] { width: 150px !important; font-size: 14px; height: 34px; }
  .time-stepper { height: 34px; }
  .ts-num, .ts-colon { font-size: 16px; }
  .ts-col { width: 26px; }
  .btn-time { width: 34px; height: 34px; font-size: 17px; }
  .btn-reset { padding: 7px 12px; font-size: 13px; }

  /* AI 头部：单行紧凑不溢出 */
  .ai-header { padding: 6px 8px; gap: 4px; }
  .ai-header-left { gap: 5px; }
  .ai-header-avatar { width: 22px; height: 22px; }
  .ai-header-title { font-size: 12px; }
  .ai-header-right select { min-width: 84px; height: 26px; font-size: 11px; padding: 2px 18px 2px 6px; }
  .ai-header-right .ai-model-btn,
  .ai-header-right .ai-header-btn,
  .ai-header-right .ai-close-btn { height: 26px; padding: 0 6px; }
  .ai-toolbar { gap: 6px; }
  .ai-voice-btn { padding: 4px 10px; font-size: 11px; }

  /* 主界面左右栏 */
  .left-panel { width: 100%; padding: 14px; }
  .right-panel { min-height: 380px; padding: 14px; }

  /* 表格横向滚动（防溢出挤压） */
  .reminder-table, .admin-table { min-width: 480px; }
  .reminder-table-wrap, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .settings-section table { display: block; overflow-x: auto; white-space: nowrap; }
  .settings-section table select { width: 84px !important; }

  /* 顶部导航 */
  .nav-links { gap: 8px; font-size: 13px; }
  .title-right { gap: 6px; }
  .clock { font-size: 13px; padding: 4px 10px; }

  /* 设置页 */
  .settings-page h2 { font-size: 18px; }
  .btn-save-settings { width: 100%; }
  .btn-play { padding: 8px 12px; font-size: 13px; }

  /* About 悬浮按钮缩小 */
  .about-fab { width: 30px; height: 30px; right: 10px; bottom: 10px; }
}

/* ===== 超小屏（<400px）极端压缩 ===== */
@media (max-width: 400px) {
  .ai-header-right select { min-width: 70px; }
  .ai-header-clear { display: none; }   /* 极窄屏隐藏清空按钮，避免挤压 */
  .time-bar input[type="date"] { width: 132px !important; }
  .ts-col { width: 22px; }
  .ts-num, .ts-colon { font-size: 15px; }
}

/* ============================================================
   补充块：主布局 / 工具栏 / 表格 / AI 面板 / 其他页面
   ============================================================ */

/* ===== 主布局 ===== */
.dashboard { display: flex; flex-direction: column; min-height: 100vh; }

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

.clock {
  font-size: 15px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius:14px;
  letter-spacing: 1px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius:14px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.view-toggle-btn:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }

.nav-links { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-links a { color: #fff; opacity: 0.9; transition: var(--transition); }
.nav-links a:hover { opacity: 1; text-decoration: underline; }

.team-name { font-weight: 600; color: #fff; background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius:14px; }

.super-vip-badge {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.4);
}

/* ===== 时间栏 ===== */
.time-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.time-bar .label { font-size: 14px; font-weight: 600; color: var(--text); }

.btn-time {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-time:hover { border-color: var(--primary); background: var(--primary-soft); }

.btn-minus, .btn-plus { font-weight: 700; }

.time-input {
  width: 90px !important;
  text-align: center;
  font-weight: 700;
  font-size: 18px !important;
  letter-spacing: 2px;
  color: var(--primary) !important;
}

.btn-reset, .btn-today {
  padding: 9px 18px;
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-reset:hover, .btn-today:hover { background: var(--primary); color: #fff; }

.hint, .hint-text { font-size: 12px; color: var(--text-muted); }

.hint-text { display: block; margin: 8px 0; }

/* ===== 左右面板 ===== */
.left-panel, .right-panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.left-panel { width: 300px; flex-shrink: 0; }
.right-panel { flex: 1; min-height: 480px; }

.left-panel h3, .right-panel h3 {
  font-size: 16px;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-soft);
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(30, 80, 160, 0.2);
}
.btn-action:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30, 80, 160, 0.3); filter: brightness(1.05); }

.btn-add { background: linear-gradient(135deg, #34d399, var(--accent)); box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3); }
.btn-del { background: linear-gradient(135deg, #f87171, var(--danger)); box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3); }
.btn-history, .btn-settings, .btn-weblinks { background: linear-gradient(135deg, #60a5fa, #3b82f6); }

.btn-filter, .btn-all, .btn-play {
  padding: 9px 16px;
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-filter:hover, .btn-all:hover, .btn-play:hover { background: var(--primary); color: #fff; }

.btn-save-settings {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(30, 80, 160, 0.25);
}
.btn-save-settings:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ===== 提醒表格 ===== */
.reminder-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.reminder-table th {
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.reminder-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.reminder-table tr { transition: var(--transition); cursor: pointer; }
.reminder-table tbody tr:hover { background: var(--primary-soft); }

.col-id { width: 90px; }
.col-time { width: 80px; }
.col-countdown { width: 110px; color: var(--warn); font-weight: 600; }
.col-status { width: 90px; }
.col-text { min-width: 160px; }

/* ===== 月历视图 ===== */
.month-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.month-title { font-size: 20px; font-weight: 700; color: var(--text); flex: 1; }

.month-nav {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--primary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.month-nav:hover { border-color: var(--primary); background: var(--primary-soft); }

.calendar-grid { display: flex; flex-direction: column; gap: 6px; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-header-cell {
  min-height: auto !important;
  background: var(--primary-soft) !important;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
  border-color: transparent !important;
  padding: 8px 4px !important;
  cursor: default !important;
}

/* ===== 状态栏 ===== */
.status-bar {
  text-align: center;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ===== AI 面板补充 ===== */
.ai-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.ai-overlay.active { display: flex; animation: overlayFade 0.25s ease; }

.ai-header-divider { height: 1px; background: var(--border); }

.ai-voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius:14px;
  border: 2px solid var(--border);
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.ai-voice-btn:hover { border-color: #7c3aed; background: rgba(124, 58, 237, 0.15); }
.ai-voice-btn.listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: alarmPulse 1s infinite; }

.ai-chat-placeholder-sub { font-size: 12px; color: var(--text-muted); }

/* ===== 设置/历史页 ===== */
.settings-page, .history-page { max-width: 1000px; margin: 0 auto; padding: 20px; }

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.settings-select {
  width: auto !important;
  min-width: 160px;
}

.auth-link { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--primary); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius:14px;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.quota-vip { color: var(--warn); font-weight: 700; }
.quota-super-vip { color: #8b5cf6; font-weight: 700; }

.notes-cell-num { color: var(--text-muted); font-size: 13px; text-align: center; }

/* ============================================================
   V0.2 修复块：时间框宽度 / 报警弹窗按钮排版 / AI 底栏
   ============================================================ */

/* ===== 时间设置框：缩短并排显示 ===== */
.time-bar input[type="date"] {
  width: 165px !important;
  flex: 0 0 auto;
}

.time-bar input[type="time"], .time-input {
  width: 100px !important;
  flex: 0 0 auto;
}

/* ===== 报警弹窗：按钮两列整齐排列 ===== */
.alarm-modal .btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.alarm-modal .btn-row button {
  width: 100%;
  margin: 0;
  padding: 13px 10px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.subtask-section .btn-alarm-ack { width: 100%; margin-bottom: 8px; }

.alarm-modal .subtask-label { font-size: 14px; font-weight: 600; }

/* ===== AI 底栏（ChatGPT/微信风格）===== */
.ai-input-card {
  display: block;
  background: transparent;
  border: none;
  padding: 0;
}

.ai-input-card:focus-within { border-color: transparent; box-shadow: none; }

.ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ai-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-toolbar-left .ai-input-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

.ai-send-btn:disabled { opacity: 0.45; }

/* ===== 中文字体栈强化（防豆腐块）===== */
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   V0.2 修复块：AI 顶部栏瘦身（聊天区最大化）/ 弹窗图标居中
   ============================================================ */

/* ===== AI 顶部栏：单行紧凑 ===== */
.ai-header {
  padding: 6px 12px;                        /* 高度压缩 */
  gap: 8px;
}

.ai-header-title { font-size: 13px; }        /* 标题缩小 */
.ai-header-avatar { width: 26px; height: 26px; }

.ai-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* 模型选择下拉框：瘦身 */
.ai-header-right select {
  width: auto;
  min-width: 110px;
  height: 28px;
  padding: 2px 24px 2px 8px;
  font-size: 12px;
  border-radius:8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.ai-header-right select option { color: #333; background: #fff; }

/* 刷新/清空/收起/关闭按钮：瘦身 */
.ai-header-right .ai-model-btn,
.ai-header-right .ai-header-btn,
.ai-header-right .ai-close-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius:8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-header-right .ai-model-btn svg,
.ai-header-right .ai-header-btn svg,
.ai-header-right .ai-close-btn svg { width: 13px; height: 13px; }

.ai-header-divider { height: 1px; }

/* 聊天区最大化 */
.ai-chat-area { flex: 1; min-height: 0; padding: 12px; }

/* ===== 报警弹窗：图标与文字严格垂直居中 ===== */
.alarm-modal h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.alarm-modal h2 svg { flex-shrink: 0; }

.alarm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.alarm-modal .subtask-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 子任务勾选行：图标文字居中 */
.alarm-modal #subtaskCheckboxes label,
.alarm-modal #subtaskCheckboxes div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alarm-modal .subtask-checkbox { margin: 0; }

/* 按钮内图标与文字居中 */
.btn-alarm { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ============================================================
   V0.5 修复块：About 弹窗（项目说明）
   ============================================================ */

/* 右下角 ℹ️ 悬浮按钮（SVG 图标） */
.about-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  transition: var(--transition);
}
.about-fab:hover { transform: scale(1.1); box-shadow: var(--shadow-lg); color: var(--primary-dark); }
.about-fab:active { transform: scale(0.95); }

/* About 半透明模态框 */
.about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.about-overlay.active { display: flex; animation: overlayFade 0.25s ease; }

.about-modal {
  background: #fff;
  border-radius:14px;
  padding: 30px 28px 22px;
  width: 380px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: center;
}

.about-modal h3 { font-size: 20px; color: var(--primary); margin-bottom: 12px; }
.about-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }

.about-contact {
  font-size: 13px;
  color: var(--text);
  background: var(--primary-soft);
  border-radius:10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.about-contact a { color: var(--primary); font-weight: 700; text-decoration: none; }
.about-contact a:hover { text-decoration: underline; }

.about-version { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

.about-close {
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  transition: var(--transition);
}
.about-close:hover { color: var(--danger); transform: rotate(90deg); }

/* ============================================================
   V0.2 修复块：日期/时间步进器 + 勾选列表对齐
   ============================================================ */

/* ===== 日期步进器（点击上下半区 ±1 天，不遮日历图标）===== */
.date-stepper { position: relative; display: inline-block; }

/* 隐藏原生 date 输入框自带的灰色日历图标（保留右侧彩色 SVG 图标，避免双图标） */
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* 日历提示图标（点击打开系统日历选择日期） */
.date-calendar-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #4a8f4a;
  pointer-events: auto;   /* 可点击：触发 showPicker 打开日历 */
  cursor: pointer;
  z-index: 3;             /* 高于 stepper，不被 ±1 天覆盖层遮挡 */
}
.date-calendar-icon:hover { color: #2f6b2f; }

.stepper-half {
  position: absolute;
  left: 0;
  width: calc(100% - 30px);   /* 右侧留出图标点击区 */
  height: 50%;
  z-index: 2;
  cursor: pointer;
  border-radius:8px;
  transition: background 0.15s;
}
.stepper-up { top: 0; }
.stepper-down { bottom: 0; }
.stepper-half:hover { background: rgba(30, 80, 160, 0.12); }
.stepper-half:active { background: rgba(30, 80, 160, 0.22); }

/* ===== 时间步进器（时:分 分列，点击上下半区 ±1）===== */
.time-stepper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 2px solid #c0dcc0;
  border-radius:8px;
  height: 38px;
  padding: 0 6px;
  user-select: none;
  flex: 0 0 auto;
}

.ts-col {
  position: relative;
  width: 30px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ts-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
  transition: background 0.15s;
}
.ts-up { top: 0; border-radius:6px 4px 0 0; }
.ts-down { bottom: 0; border-radius: 0 0 4px 4px; }
.ts-half:hover { background: rgba(30, 80, 160, 0.12); }
.ts-half:active { background: rgba(30, 80, 160, 0.22); }

.ts-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: "Courier New", monospace;
  line-height: 1;
  pointer-events: none;
}

.ts-colon {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 3px;
  pointer-events: none;
}
