/* ===========================================
   作业管理系统 · 样式（简洁版）
   =========================================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e7e9ee;
  --text: #1a1d24;
  --text-dim: #5b616e;
  --text-soft: #9aa1ae;

  --primary: #4f5bd5;
  --primary-soft: #eceefe;

  --green: #16a34a;
  --green-soft: #e8f6ee;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --gray-soft: #f1f2f5;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .04);

  /* ---- 统一动画规范 ---- */
  --dur-fast: .15s;      /* 微小反馈：hover 颜色、按压 */
  --dur-base: .25s;      /* 常规过渡：按钮、卡片 hover */
  --dur-slow: .4s;       /* 面板/视图级过渡 */
  --ease-out: cubic-bezier(.4, 0, .2, 1);          /* 标准缓出 */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);  /* 弹性（强调类） */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- 顶部 ---------- */
.site-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.head-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand h1 {
  font-size: 20px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.head-side { display: flex; align-items: center; gap: 14px; flex: none; }
.head-stat { font-size: 14px; color: var(--text-dim); }
.head-stat b { color: var(--text); font-weight: 700; }
.btn-ghost {
  font-size: 14px; font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn-ghost:hover { color: var(--primary); border-color: #c7caf0; background: var(--primary-soft); }
.btn-ghost:active { transform: scale(.97); }

/* ---------- 主区域 ---------- */
.wrap {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 20px 40px;
  flex: 1;
}

/* ---------- 提醒块 ---------- */
.alert {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid;
}
.alert-overdue { background: var(--red-soft); border-color: #f5cccc; }
.alert-urgent  { background: var(--amber-soft); border-color: #f5e0bd; }

.alert-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700;
  margin-bottom: 10px;
}
.alert-overdue .alert-title { color: #b91c1c; }
.alert-urgent .alert-title { color: #b45309; }

.alert-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.alert-list li {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; flex-wrap: wrap;
}
.alert-name { font-weight: 600; }
.alert-time { margin-left: auto; color: var(--text-dim); font-size: 13px; white-space: nowrap; }

/* ---------- 标签 ---------- */
.tag-subject {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}

/* ---------- 图例 ---------- */
.legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 16px;
  padding-left: 2px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-normal  { background: var(--green); }
.dot-urgent  { background: var(--amber); }
.dot-overdue { background: var(--red); }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; }

.tl-group {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0 20px;
  position: relative;
}

.tl-day {
  padding-top: 20px;
  position: relative;
  text-align: right;
  padding-right: 22px;
}
.tl-day-label {
  display: block;
  font-size: 16px; font-weight: 700;
  color: var(--text);
}
.tl-group.is-past .tl-day-label { color: var(--text-soft); }
.tl-day-date {
  display: block;
  font-size: 12px; color: var(--text-soft);
  margin-top: 1px;
}

.tl-day::after {
  content: "";
  position: absolute;
  right: 6px; top: 26px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  z-index: 2;
}
.tl-group.is-past .tl-day::after { border-color: #c7cbd6; }

.tl-day::before {
  content: "";
  position: absolute;
  right: 10px; top: 26px; bottom: -6px;
  width: 1px;
  background: var(--line);
  z-index: 1;
}
.tl-group:last-child .tl-day::before { display: none; }

.tl-items {
  padding: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* ---------- 作业卡片 ---------- */
.hw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.hw-card.state-urgent  { border-left-color: var(--amber); }
.hw-card.state-overdue { border-left-color: var(--red); background: #fffafa; }
.hw-card.state-done    { border-left-color: #d1d5db; opacity: .72; }

.hw-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
  flex-wrap: wrap;
}
.hw-status {
  font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.hw-status.normal  { background: var(--green-soft); color: #15803d; }
.hw-status.urgent  { background: var(--amber-soft); color: #b45309; }
.hw-status.overdue { background: var(--red-soft); color: #b91c1c; }
.hw-status.done    { background: var(--gray-soft); color: var(--text-dim); }

.hw-title {
  font-size: 17px; font-weight: 700;
  line-height: 1.45;
  margin-bottom: 6px;
  word-break: break-word;
}
.hw-card.state-done .hw-title { text-decoration: line-through; color: var(--text-dim); }

.hw-detail {
  font-size: 14px; color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 8px;
  word-break: break-word;
}
.hw-foot { display: flex; align-items: center; gap: 12px; }
.hw-due { font-size: 12px; color: var(--text-soft); }

/* ---------- 空状态 ---------- */
.empty-hero {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.empty-hero p { font-size: 15px; }

/* ---------- 页脚 ---------- */
.site-foot {
  max-width: 900px; width: 100%;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-soft);
}

/* ---------- 移动端（前台） ---------- */
@media (max-width: 680px) {
  .head-inner { padding: 12px 16px; }
  .brand h1 { font-size: 17px; }
  .head-stat { display: none; }
  .wrap { padding: 18px 14px 32px; }

  .tl-group { grid-template-columns: 1fr; gap: 0; }
  .tl-day { text-align: left; padding: 16px 0 8px 20px; padding-right: 0; }
  .tl-day::after { right: auto; left: 2px; top: 22px; }
  .tl-day::before { right: auto; left: 6px; top: 22px; bottom: -100vh; height: auto; }
  .tl-items { padding: 0 0 16px 20px; }

  .alert-time { margin-left: 0; width: 100%; }
  .hw-title { font-size: 16px; }
  .hw-detail { font-size: 13.5px; }
}

/* ===========================================
   后台 · 表单与面板
   =========================================== */

/* ---------- 登录页 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: #f5f6f8;
}
.login-card {
  width: 100%; max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.login-brand h1 { font-size: 19px; font-weight: 700; }
.login-card .field { margin-bottom: 14px; }
.login-back {
  display: block; text-align: center;
  margin-top: 18px; font-size: 14px; color: var(--text-dim);
}
.login-back:hover { color: var(--primary); }

/* ---------- 提示条 ---------- */
.form-alert {
  background: var(--red-soft);
  border: 1px solid #f5cccc;
  color: #b91c1c;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.flash-ok {
  background: var(--green-soft);
  border: 1px solid #bfe5d2;
  color: #15803d;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ---------- 表单元素 ---------- */
.field { display: block; }
.field > span {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field > span em { color: var(--red); font-style: normal; }

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
input:focus, textarea:focus {
  background: #fff;
  border-color: #b6b9ee;
  box-shadow: 0 0 0 3px rgba(79, 91, 213, .12);
}
textarea { resize: vertical; line-height: 1.6; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.hw-form > .field { margin-bottom: 14px; }

.form-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #3f4ac0; }
.btn-primary:active { transform: scale(.97); }
.btn-plain { background: #f3f4f8; color: var(--text-dim); border-color: var(--line); }
.btn-plain:hover { background: #eceef5; }
.btn-block { width: 100%; }

.mini-btn {
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.mini-btn:hover { color: var(--primary); border-color: #c7caf0; background: var(--primary-soft); }
.mini-btn:active { transform: scale(.96); }
.mini-danger:hover { color: var(--red); border-color: #f2c4c4; background: var(--red-soft); }

/* ---------- 面板 ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.count-badge {
  font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  padding: 1px 8px; border-radius: 999px;
}
.panel-empty { font-size: 14px; color: var(--text-dim); padding: 12px 0; }

/* ---------- 后台列表 ---------- */
.admin-list { display: flex; flex-direction: column; }
.admin-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.admin-item:first-child { border-top: none; padding-top: 0; }
.admin-item.is-done { opacity: .6; }
.ai-main { min-width: 0; flex: 1; }
.ai-top {
  display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap; margin-bottom: 4px;
}
.ai-time { font-size: 12px; color: var(--text-soft); }
.ai-title {
  font-size: 15px; font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}
.admin-item.is-done .ai-title { text-decoration: line-through; }
.ai-detail { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.ai-acts { display: flex; gap: 6px; flex: none; align-items: center; flex-wrap: wrap; }
.ai-acts form { display: inline; }

/* ---------- 设置区 ---------- */
.settings-grid { display: flex; flex-direction: column; gap: 20px; }
.settings-block h3 {
  font-size: 13.5px; font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 9px;
}
.inline-form { display: flex; gap: 9px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 140px; }

/* ---------- 后台移动端 ---------- */
@media (max-width: 680px) {
  .panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .admin-item { flex-direction: column; gap: 9px; }
  .ai-acts { width: 100%; }
  .inline-form { flex-direction: column; }
  .inline-form input { min-width: 0; }
  .inline-form .btn { width: 100%; }
}

/* ---------- 额外文本展开 ---------- */
.hw-extra-wrap { margin: 4px 0 8px; }
.hw-extra-toggle {
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: none;
  border-radius: 7px;
  padding: 4px 11px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.hw-extra-toggle:hover { background: #e0e2fa; }
.hw-extra-toggle::after { content: " ▾"; font-size: 10px; }
.hw-extra-toggle.open::after { content: " ▴"; }
.hw-extra {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.hw-extra.open { display: block; }

/* ===========================================
   UI 模式切换：正常 / 课堂大屏
   =========================================== */
.screen-view { display: none; }

body.screen-mode .view-toggle {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

body.screen-mode .normal-view { display: none; }
body.screen-mode .screen-view { display: block; }

body.screen-mode .site-foot { display: none; }

body.screen-mode { overflow: hidden; }
body.screen-mode .screen-view {
  display: block;
  height: calc(100vh - 72px);
  overflow: hidden;
  padding: 14px 0 0;
  box-sizing: border-box;
}

body.screen-mode .wrap { max-width: none; width: 100%; padding: 14px 22px 0; }
body.screen-mode .head-inner { max-width: none; padding: 13px 22px; }

/* ---------- 大屏：默认网格排版，点附件后切换两栏 ---------- */
.screen-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
  align-content: start;
  height: 100%;
  position: relative;
  transition: grid-template-columns var(--dur-slow) var(--ease-out);
}

/* 连体框 SVG：铺在内容下面，绘制「凸」字形外轮廓 */
.connector-frame {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.screen-grid, .screen-extra-panel { position: relative; z-index: 1; }

/* 左栏作业列表（默认就是网格本体） */
.screen-grid {
  display: contents;
}

/* 附件面板默认隐藏 */
.screen-extra-panel {
  display: none;
}

/* 点附件后：切换为左右两栏（左窄右宽），gap 归零让选中卡片能贴面板 */
.screen-layout.has-open {
  grid-template-columns: 300px 1fr;
  align-items: stretch;
  gap: 0;
}
.screen-layout.has-open .screen-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  min-width: 0;
  height: 100%;
  padding-right: 16px;
  box-sizing: border-box;
}
.screen-layout.has-open .screen-extra-panel {
  display: block;
}

/* 左栏作业卡片：白底 + 浅色边框 */
.screen-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.screen-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 24, 40, .1);
}
.screen-card.state-urgent  { border-left-color: var(--amber); }
.screen-card.state-overdue { border-left-color: var(--red); }

/* 选中的作业卡片：位置不变（右缘贴面板），边框和色条全部由 SVG 连体框绘制 */
.screen-layout.has-open .screen-card.active {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  width: calc(100% + 16px);
  margin-right: -16px;
  z-index: 2;
}
/* 附件面板：同样去掉自身边框/背景，由 SVG 连体框统一描绘 */
.screen-layout.has-open .screen-extra-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.screen-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.screen-subject {
  font-size: 16px; font-weight: 700;
  color: var(--primary);
}
.screen-due-inline {
  font-size: 14px; font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.screen-title {
  font-size: 24px; font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}
.screen-detail {
  font-size: 15px; color: var(--text-dim);
  line-height: 1.6;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.screen-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.screen-left { font-size: 16px; font-weight: 700; color: #15803d; }
.state-urgent .screen-left { color: #b45309; }
.state-overdue .screen-left { color: #b91c1c; }

.screen-extra-btn {
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #c7caf0;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}
.screen-extra-btn:hover {
  background: #e0e2fa;
  transform: scale(1.05);
}
.screen-extra-btn:active { transform: scale(.96); }

/* 右栏：附件展示面板（白底浅边框） */
.screen-extra-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 28px 34px;
  overflow: auto;
  min-width: 0;
  position: relative;
}

.extra-panel-item {
  display: none;
}
.extra-panel-item.show {
  display: block;
  animation: extraPanelIn var(--dur-slow) var(--ease-out);
}
@keyframes extraPanelIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 附件正文：标题加粗顶格，正文首行缩进 */
.extra-panel-body {
  color: var(--text);
  word-break: break-word;
}
.extra-panel-body p {
  font-size: 18px;
  line-height: 1.8;
  text-indent: 2em;
  margin: 0 0 .55em;
}
.extra-panel-body p:first-child {
  text-indent: 0;
  font-weight: 700;
  font-size: 23px;
  margin-bottom: .9em;
}

.extra-panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  font-size: 16px;
  color: var(--text-soft);
}
/* 有附件展开时隐藏空提示 */
.screen-extra-panel:has(.extra-panel-item.show) .extra-panel-empty {
  display: none;
}

body.screen-mode .site-url { font-size: 24px; }

/* 大屏模式下字号更大、更醒目 */
body.screen-mode .clock {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 680px) {
  body.screen-mode { overflow: auto; }
  body.screen-mode .screen-view { height: auto; overflow: visible; }
  .screen-layout { grid-template-columns: 1fr; height: auto; }
  .screen-card { padding: 16px 18px; }
  .screen-title { font-size: 22px; }
  .screen-card.active .screen-title { font-size: 24px; }
  .extra-panel-body { font-size: 16px; }
}

/* ---------- 实时时钟 ---------- */
.clock {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 680px) {
  .clock { display: none; }
}

/* ===========================================
   动画优化：统一动效 + 补充关键动画
   =========================================== */

/* 视图切换（正常 <-> 大屏）：内容淡入 */
body.screen-mode .normal-view,
.screen-view {
  animation: viewFade var(--dur-slow) var(--ease-out);
}
@keyframes viewFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 大屏默认网格：卡片依次渐入（stagger） */
.screen-layout:not(.has-open) .screen-card {
  animation: cardIn var(--dur-slow) var(--ease-out) both;
}
.screen-layout:not(.has-open) .screen-card:nth-child(1) { animation-delay: 0s; }
.screen-layout:not(.has-open) .screen-card:nth-child(2) { animation-delay: .05s; }
.screen-layout:not(.has-open) .screen-card:nth-child(3) { animation-delay: .1s; }
.screen-layout:not(.has-open) .screen-card:nth-child(4) { animation-delay: .15s; }
.screen-layout:not(.has-open) .screen-card:nth-child(5) { animation-delay: .2s; }
.screen-layout:not(.has-open) .screen-card:nth-child(6) { animation-delay: .25s; }
.screen-layout:not(.has-open) .screen-card:nth-child(n+7) { animation-delay: .3s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 正常模式时间轴卡片：轻微渐入 */
.normal-view .hw-card {
  animation: cardIn var(--dur-slow) var(--ease-out) both;
}

/* 弹窗/提示条（flash-ok / form-alert）滑入 */
.flash-ok, .form-alert {
  animation: alertIn var(--dur-base) var(--ease-out);
}
@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================================
   可访问性：尊重「减少动态效果」系统设置
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    scroll-behavior: auto !important;
  }
}
