/* ─── 设计令牌（浅色主题）────────────────────────────────────────────────────── */
:root {
  --bg:        #f4f6fb;
  --bg-card:   #ffffff;
  --bg-hover:  #f0f2f8;
  --border:    #e2e6f0;
  --text:      #1a1d2e;
  --text-muted:#6b7280;
  --text-sm:   0.8125rem;

  --accent:    #5b50e8;
  --accent-d:  #4840c8;
  --green:     #0db07a;
  --green-d:   #0a9468;
  --orange:    #e8820c;
  --orange-d:  #c96e08;
  --red:       #e63950;
  --red-d:     #c42a3f;
  --purple:    #9347e8;
  --blue:      #1c7ee8;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 20px rgba(91,80,232,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);

  --nav-h:     60px;
}

/* ─── 重置 ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  background: rgba(91,80,232,0.08);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ─── 导航栏 ─────────────────────────────────────────────────────────────────── */
.navbar {
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
}
.nav-logo { font-size: 1.4rem; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: rgba(91,80,232,0.08);
  color: var(--accent);
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.nav-username {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.nav-badge--admin  { background: rgba(147,71,232,0.1);  color: var(--purple); }
.nav-badge--ops    { background: rgba(28,126,232,0.1);  color: var(--blue); }
.nav-badge--editor { background: rgba(13,176,122,0.1);  color: var(--green); }

/* ─── 主内容区 ────────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: #fff;
}

/* ─── 页面标题 ───────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-title   { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.page-subtitle{ font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ─── 卡片 ────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card--narrow { max-width: 600px; padding: 2rem; }

.section { margin-top: 2.5rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title { font-size: 1.1rem; font-weight: 600; }

/* ─── 按钮 ────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.93); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary  { background: var(--accent); color: #fff; }
.btn--accent   { background: var(--orange); color: #fff; }
.btn--success  { background: var(--green);  color: #fff; }
.btn--warning  { background: var(--orange); color: #fff; }
.btn--danger   { background: var(--red);    color: #fff; }
.btn--released { background: var(--purple); color: #fff; }
.btn--ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); filter: none; }
.btn--full     { width: 100%; justify-content: center; }
.btn--sm       { padding: 0.28rem 0.65rem; font-size: 0.8rem; }

/* ─── 表单 ────────────────────────────────────────────────────────────────────── */
.form-group    { margin-bottom: 1.25rem; }
.form-label    { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; }
.required      { color: var(--red); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,80,232,0.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: #b0b8cc; }
.form-select   { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.2rem; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions  { margin-top: 1.5rem; }

.checkbox-group  { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0.5rem 0; }
.checkbox-label  { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.875rem; }
.checkbox-label input { accent-color: var(--accent); }

/* ─── 登录页 ─────────────────────────────────────────────────────────────────── */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 60px);
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo     { font-size: 3rem; margin-bottom: 0.5rem; }
.login-title    { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; }
.login-form     { text-align: left; }

/* ─── 统计卡片 ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: block;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.stat-icon  { font-size: 1.6rem; margin-bottom: 0.5rem; }
.stat-num   { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.stat-card--draft     { border-color: #e2e6f0; }
.stat-card--draft     .stat-num { color: var(--text-muted); }
.stat-card--published { border-color: rgba(28,126,232,0.25); }
.stat-card--published .stat-num { color: var(--blue); }
.stat-card--accepted  { border-color: rgba(232,130,12,0.25); }
.stat-card--accepted  .stat-num { color: var(--orange); }
.stat-card--completed { border-color: rgba(13,176,122,0.25); }
.stat-card--completed .stat-num { color: var(--green); }
.stat-card--revision  { border-color: rgba(230,57,80,0.25); }
.stat-card--revision  .stat-num { color: var(--red); }
.stat-card--released  { border-color: rgba(147,71,232,0.25); }
.stat-card--released  .stat-num { color: var(--purple); }

/* ─── 状态徽章 ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-draft     { background: #f0f2f8;                    color: var(--text-muted); }
.badge-published { background: rgba(28,126,232,0.1);       color: var(--blue); }
.badge-accepted  { background: rgba(232,130,12,0.1);       color: var(--orange); }
.badge-completed { background: rgba(13,176,122,0.1);       color: var(--green); }
.badge-revision  { background: rgba(230,57,80,0.1);        color: var(--red); }
.badge-released  { background: rgba(147,71,232,0.1);       color: var(--purple); }

/* ─── 角色徽章 ──────────────────────────────────────────────────────────────── */
.role-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.role-badge--admin  { background: rgba(147,71,232,0.1);  color: var(--purple); }
.role-badge--ops    { background: rgba(28,126,232,0.1);  color: var(--blue); }
.role-badge--editor { background: rgba(13,176,122,0.1);  color: var(--green); }

/* ─── 产品线标签 ─────────────────────────────────────────────────────────────── */
.pl-tag {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  background: rgba(91,80,232,0.08);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ─── 文件类型标签 ───────────────────────────────────────────────────────────── */
.file-type-badge {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: monospace;
  text-transform: uppercase;
}
.file-type-badge--docx { background: rgba(28,126,232,0.1);  color: var(--blue); }
.file-type-badge--xlsx { background: rgba(13,176,122,0.1);  color: var(--green); }

/* ─── 表格 ────────────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #fafbfd;
}
.table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-hover); }

.script-title-link {
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}
.script-title-link:hover { color: var(--accent); text-decoration: none; }
.script-title-cell { max-width: 280px; }

.revision-note {
  cursor: help;
  margin-left: 0.25rem;
  font-size: 0.85rem;
}

.action-cell {
  white-space: nowrap;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.text-muted { color: var(--text-muted); }
.text-sm    { font-size: var(--text-sm); }

/* ─── 筛选栏 ──────────────────────────────────────────────────────────────────── */
.filter-bar { margin-bottom: 1.25rem; }
.filter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filter-form .form-select { width: auto; min-width: 130px; }

.calendar-shell {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.calendar-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calendar-month {
  min-width: 8rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-filter-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 220px;
}

.calendar-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calendar-multiselect {
  background-image: none;
  padding-right: 0.85rem;
  min-height: 120px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-weekdays div {
  padding: 0 0.2rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
}

.calendar-day {
  min-height: 180px;
  background: #ffffff;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.calendar-day--muted {
  background: #f4f6fa;
  color: #9aa3b2;
}

.calendar-day--today {
  border-color: #d89b2b;
  box-shadow: inset 0 0 0 1px rgba(216,155,43,0.18);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calendar-day-num {
  font-size: 1rem;
  font-weight: 700;
}

.calendar-day-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.calendar-day-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
}

.calendar-event {
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #eef3f8;
  border-left: 3px solid #6b7280;
}

.calendar-event--piling { background: #f8efe5; border-left-color: #c96e08; }
.calendar-event--drill { background: #eaf4fb; border-left-color: #1c7ee8; }
.calendar-event--aerial { background: #eef7ed; border-left-color: #0db07a; }
.calendar-event--backhoe { background: #f5eefb; border-left-color: #9347e8; }

.calendar-event-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.calendar-event-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.calendar-event-link {
  color: inherit;
  text-decoration: none;
}

.calendar-event-link:hover {
  text-decoration: underline;
}

.calendar-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.calendar-empty {
  color: #a0a8b7;
  font-size: 0.76rem;
  padding-top: 0.25rem;
}

/* ─── 文件上传区 ─────────────────────────────────────────────────────────────── */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fafbfd;
}
.file-upload-area:hover, .file-upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(91,80,232,0.04);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-upload-text { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.file-upload-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ─── 空状态 ──────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ─── Toast 通知 ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--nav-h) + 1rem);
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 1000;
  max-width: 400px;
  animation: slideIn 0.25s ease;
  transition: opacity 0.4s, transform 0.4s;
}
.toast--success { background: #ecfdf5; border: 1px solid rgba(13,176,122,0.3); color: var(--green); }
.toast--error   { background: #fff1f2; border: 1px solid rgba(230,57,80,0.3);  color: var(--red); }
.toast--hide    { opacity: 0; transform: translateX(30px); }
@keyframes slideIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }

/* ─── 警告框 ─────────────────────────────────────────────────────────────────── */
.alert { padding: 0.7rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert--error   { background: #fff1f2; border: 1px solid rgba(230,57,80,0.25);   color: var(--red); }
.alert--success { background: #ecfdf5; border: 1px solid rgba(13,176,122,0.25);  color: var(--green); }

/* ─── 弹窗 ────────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.35);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title   { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal-desc    { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }
.modal-form    { margin-top: 0.75rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ─── AI 工作区 ──────────────────────────────────────────────────────────────── */
.ai-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .ai-workspace { grid-template-columns: 1fr; } }
.ai-input-panel, .ai-output-panel { padding: 1.5rem; }
.panel-title   { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; }
.panel-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.ai-message    { color: var(--text-muted); font-size: 0.875rem; padding: 1rem; }
.scripts-preview { display: flex; flex-direction: column; gap: 0.75rem; }
.script-card {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.script-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.script-card-num {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.script-card-meta { font-size: 0.8rem; color: var(--text-muted); margin-left: 2.1rem; }

/* ─── 错误页 ─────────────────────────────────────────────────────────────────── */
.error-card { text-align: center; padding: 2rem; }
.error-icon  { font-size: 4rem; margin-bottom: 1rem; }
.error-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.error-msg   { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── 响应式 ─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; gap: 1rem; }
  .nav-links { display: none; }
  .main-content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .page-header { flex-wrap: wrap; }
  .filter-form { flex-direction: column; }
  .filter-form .form-select { width: 100%; }
  .calendar-topbar { flex-direction: column; }
  .calendar-filter-form { width: 100%; }
  .calendar-weekdays,
  .calendar-grid { grid-template-columns: 1fr; }
  .calendar-day { min-height: 0; }
  .table { font-size: 0.8rem; }
  .table th, .table td { padding: 0.6rem 0.65rem; }
  .action-cell { flex-wrap: wrap; }
}

/* ─── HTMX 过渡 ──────────────────────────────────────────────────────────────── */
.htmx-swapping { opacity: 0; transition: opacity 0.2s; }
.htmx-settling { opacity: 1; }
.script-row { transition: opacity 0.2s; }
.script-row.htmx-swapping { opacity: 0; }

/* ─── 日历产品线复选框筛选 ───────────────────────────────────────────────────── */
.calendar-filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 120px;
}

.calendar-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  user-select: none;
}
.calendar-check-item:hover { background: var(--bg-hover); }

.calendar-check-all {
  padding-bottom: 0.25rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
}

.calendar-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.calendar-check-mark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.calendar-check-input:checked + .calendar-check-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.calendar-check-input:checked + .calendar-check-mark::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.calendar-check-input:indeterminate + .calendar-check-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.calendar-check-input:indeterminate + .calendar-check-mark::after {
  content: '';
  display: block;
  width: 8px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.calendar-check-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

/* ─── 日历条目折叠 ───────────────────────────────────────────────────────────── */
.calendar-event--hidden {
  display: none !important;
}

.calendar-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(91,80,232,0.07);
  border: 1px solid rgba(91,80,232,0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.calendar-expand-btn:hover {
  background: rgba(91,80,232,0.16);
}

/* ─── 多选复选框（脚本列表）────────────────────────────────────────────────── */
.select-col {
  width: 36px;
  padding-left: 0.5rem !important;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-mark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.checkbox-wrap input:checked + .checkbox-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-wrap input:checked + .checkbox-mark::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.checkbox-wrap input:indeterminate + .checkbox-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-wrap input:indeterminate + .checkbox-mark::after {
  content: '';
  display: block;
  width: 8px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* 选中行高亮 */
.script-row:has(.row-select-cb:checked) {
  background: rgba(91,80,232,0.05);
}

/* ─── 批量操作浮动工具栏 ────────────────────────────────────────────────────── */
.batch-toolbar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  z-index: 200;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.batch-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e5e7f0;
  white-space: nowrap;
}

.batch-toolbar .btn--ghost {
  color: #c8cad8;
  border-color: rgba(255,255,255,0.2);
}
.batch-toolbar .btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
