/* ==========================================================
   待办清单的样式表
   CSS 的写法固定是：选择器 { 属性: 值; }
   选择器就是"我要打扮谁"，比如 .app 表示 class="app" 的元素
   ========================================================== */

/* ---------- 1. 全局重置 ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 48px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #f6f7fb;
  background-image:
    radial-gradient(circle at 12% 8%, #dbeafe 0, transparent 42%),
    radial-gradient(circle at 88% 4%, #ede9fe 0, transparent 40%);
  color: #1f2430;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 2. 白色卡片主容器 ---------- */
.app {
  width: 100%;
  max-width: 540px;
  padding: 32px 32px 20px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow:
    0 24px 48px -24px rgba(23, 37, 84, 0.25),
    0 2px 6px rgba(23, 37, 84, 0.05);
}

/* ---------- 3. 标题区 ---------- */
h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #4f46e5, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: #8b93a7;
}

/* ---------- 4. 输入框 + 添加按钮 ---------- */
.add-form {
  display: flex;
  gap: 10px;
  margin: 22px 0 18px;
}

.add-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: inherit;
  background: #f8fafc;
  border: 1.5px solid #e5e8f0;
  border-radius: 12px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.add-input::placeholder {
  color: #a2a9bd;
}

.add-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.add-button {
  padding: 0 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(120deg, #4f46e5, #6366f1);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.12s;
}

.add-button:hover {
  box-shadow: 0 10px 20px -10px #6366f1;
}

.add-button:active {
  transform: translateY(1px);
}

/* ---------- 5. 三个筛选按钮 ---------- */
.filters {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f4f5fa;
  border-radius: 12px;
}

.filter {
  flex: 1;
  padding: 9px 0;
  font-family: inherit;
  font-size: 14px;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.filter:hover {
  color: #4f46e5;
}

/* is-active 是 JS 加上去的，表示"当前选中的那个" */
.filter.is-active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(23, 37, 84, 0.12);
}

/* ---------- 6. 待办列表 ---------- */
.todo-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.18s, border-color 0.18s;
}

.todo-item:hover {
  background: #f8fafc;
  border-color: #eef0f7;
}

.todo-check {
  flex: none;
  width: 19px;
  height: 19px;
  accent-color: #6366f1;
  cursor: pointer;
}

.todo-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: color 0.18s;
}

/* 完成的任务：变灰 + 划线 */
.todo-item.is-done .todo-text {
  color: #a7adbd;
  text-decoration: line-through;
  text-decoration-color: #c7ccd9;
}

.todo-delete {
  flex: none;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: #c3c8d6;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, color 0.18s, background 0.18s;
}

/* 鼠标移到这一行时，才显示删除按钮 */
.todo-item:hover .todo-delete,
.todo-delete:focus-visible {
  opacity: 1;
}

.todo-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* 手机上没有鼠标悬停，删除按钮就一直显示 */
@media (hover: none) {
  .todo-delete {
    opacity: 1;
  }
}

/* ---------- 7. 空列表提示 ---------- */
.empty {
  margin: 26px 0 18px;
  padding: 22px 12px;
  text-align: center;
  font-size: 14px;
  color: #9aa1b3;
  background: #f8fafc;
  border: 1.5px dashed #e3e7f0;
  border-radius: 12px;
}

/* ---------- 8. 底部栏 ---------- */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef0f6;
  font-size: 13px;
  color: #8b93a7;
}

.clear-button {
  padding: 7px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #6b7280;
  background: transparent;
  border: 1px solid #e5e8f0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.clear-button:hover {
  color: #ef4444;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ---------- 9. 手机上缩小一点留白 ---------- */
@media (max-width: 520px) {
  body {
    padding: 20px 12px;
  }

  .app {
    padding: 24px 20px 16px;
    border-radius: 18px;
  }

  h1 {
    font-size: 22px;
  }

  .add-button {
    padding: 0 16px;
  }
}


/* ==========================================================
   登录页 —— 3D 物理主题

   结构：
     .login-stage  整个左右分栏的大卡片
       ├─ .login-visual  左边深色区：原子 / 彩虹 / 行星 / 星尘
       └─ .login-card    右边白色区：头像 + 登录表单

   所有图形都是纯 CSS 画的，没有引入任何图片或第三方库，
   所以加载飞快，也不依赖外网。
   ========================================================== */

/* ---------- 页面容器 ---------- */

.login-body {
  align-items: stretch;
  padding: 20px;
}

.login-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 40px);
  overflow: hidden;
  background: #ffffff;
  border-radius: 30px;
  box-shadow:
    0 48px 90px -46px rgba(23, 37, 84, 0.5),
    0 2px 10px rgba(23, 37, 84, 0.06);
}

/* ==========================================================
   左：物理视觉区
   ========================================================== */

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 600px;
  padding: 44px 40px;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 14%, rgba(99, 102, 241, 0.4), transparent 55%),
    radial-gradient(circle at 88% 82%, rgba(34, 211, 238, 0.22), transparent 52%),
    linear-gradient(158deg, #131b33 0%, #1b2547 46%, #0e1630 100%);
}

/* ---------- 星尘 ---------- */

.visual-stars {
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 16%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.4px 1.4px at 27% 8%, rgba(191, 219, 254, 0.8), transparent),
    radial-gradient(1.8px 1.8px at 44% 22%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.3px 1.3px at 63% 12%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 78% 28%, rgba(165, 243, 252, 0.75), transparent),
    radial-gradient(1.4px 1.4px at 88% 14%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.2px 1.2px at 8% 46%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.6px 1.6px at 34% 40%, rgba(221, 214, 254, 0.7), transparent),
    radial-gradient(1.3px 1.3px at 55% 34%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 72% 44%, rgba(191, 219, 254, 0.6), transparent),
    radial-gradient(1.2px 1.2px at 92% 52%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.4px 1.4px at 18% 62%, rgba(255, 255, 255, 0.45), transparent);
  animation: twinkle 7s ease-in-out infinite alternate;
}

/* ---------- 彩虹光环 ---------- */

.rainbow {
  position: absolute;
  left: -200px;
  bottom: -250px;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: conic-gradient(
    from 205deg,
    #ff4d6d 0deg,
    #ffb703 55deg,
    #ffe066 105deg,
    #52d1a4 165deg,
    #4cc9f0 225deg,
    #7b6cf6 285deg,
    #ff4d6d 360deg
  );
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 60%, #000 61%);
  mask: radial-gradient(circle at 50% 50%, transparent 60%, #000 61%);
  filter: blur(7px) saturate(1.4) brightness(1.15);
  opacity: 0.62;
  animation: slowSpin 46s linear infinite;
}

/* ---------- 三维原子（三条倾斜电子轨道） ---------- */

.atom {
  position: absolute;
  top: 44%;
  right: -76px;
  width: 360px;
  height: 360px;
  transform: translateY(-50%);
  perspective: 760px;
  transform-style: preserve-3d;
}

.atom .nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #e0f2fe, #7dd3fc 40%, #0ea5e9 72%, #075985);
  box-shadow:
    0 0 26px rgba(56, 189, 248, 0.85),
    0 0 70px rgba(14, 165, 233, 0.45);
  animation: nucleusPulse 3.6s ease-in-out infinite;
}

.orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.4px solid rgba(147, 197, 253, 0.42);
  transform-style: preserve-3d;
}

.orbit .electron {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #e0f2fe;
  box-shadow:
    0 0 12px #7dd3fc,
    0 0 28px #38bdf8;
}

/* 三个不同的倾斜平面，转速各不相同，看起来像真实的电子云 */
.orbit--1 { animation: orbit1 13s linear infinite; }
.orbit--2 { animation: orbit2 18s linear infinite; }
.orbit--3 { animation: orbit3 23s linear infinite; }

/* ---------- 行星 ---------- */

.planet {
  position: absolute;
  top: 17%;
  left: 13%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe4b5, #f59e0b 44%, #b45309 76%, #7c2d12);
  box-shadow:
    inset -10px -10px 20px rgba(0, 0, 0, 0.45),
    0 0 34px rgba(245, 158, 11, 0.35);
  animation: floaty 8.5s ease-in-out infinite;
}

.planet::after {
  content: "";
  position: absolute;
  left: -24px;
  top: 50%;
  width: 110px;
  height: 24px;
  margin-top: -12px;
  border: 2px solid rgba(255, 237, 213, 0.5);
  border-radius: 50%;
  transform: rotate(-16deg);
}

/* ---------- 悬浮物理公式 ---------- */

.formulas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(191, 219, 254, 0.42);
}

.formulas span {
  position: absolute;
  animation: floaty 11s ease-in-out infinite;
}

.formulas span:nth-child(1) { top: 9%;  left: 44%; }
.formulas span:nth-child(2) { top: 30%; left: 8%;  animation-delay: -2s; }
.formulas span:nth-child(3) { top: 47%; left: 50%; animation-delay: -4s; }
.formulas span:nth-child(4) { top: 60%; left: 6%;  animation-delay: -6s; }

/* 底部压暗层：保证文案压在任何图形上都清晰 */
.login-visual::after {
  content: ";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(8, 13, 28, 0.88) 0%,
    rgba(8, 13, 28, 0.42) 34%,
    rgba(8, 13, 28, 0) 62%
  );
}

/* ---------- 左区文案 ---------- */

.visual-text {
  position: relative;
  z-index: 2;
  margin-top: auto;
}

.visual-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 3.5px;
  color: #7dd3fc;
}

.visual-title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.36;
  background: linear-gradient(120deg, #ffffff 20%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.visual-sub {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: #8fa0c4;
}

/* ==========================================================
   右：登录表单区
   ========================================================== */

.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 52px clamp(24px, 4vw, 90px) 42px;
  text-align: center;
  background: #ffffff;
}

/* ---------- 3D 头像 ---------- */

.avatar-3d {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto 24px;
  perspective: 700px;
}

/* 头像背后缓慢旋转的彩虹光环 */
.avatar-3d::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6366f1, #22d3ee, #a78bfa, #f59e0b, #6366f1);
  filter: blur(8px);
  opacity: 0.6;
  animation: slowSpin 10s linear infinite;
}

/* JS 控制这一层旋转，实现"跟着鼠标转头" */
.avatar-tilt {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* 这一层负责上下漂浮 */
.avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #eef2ff;
  box-shadow:
    0 22px 36px -18px rgba(23, 37, 84, 0.6),
    0 4px 12px rgba(23, 37, 84, 0.12);
  animation: floaty 6.5s ease-in-out infinite;
}

.avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 原图上方留白多，稍微放大并上移，让脸居中 */
  transform: scale(1.22);
  transform-origin: 50% 26%;
}

/* 一道缓慢扫过的高光，让头像有"玻璃感" */
.avatar-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 26%,
    rgba(255, 255, 255, 0) 46%
  );
  pointer-events: none;
  animation: shineSweep 6s ease-in-out infinite;
}

/* ---------- 标题 ---------- */

.login-title {
  max-width: 560px;
  font-size: 20px;
  line-height: 1.45;
}

.login-subtitle {
  margin: 8px 0 26px;
  font-size: 13px;
  color: #8b93a7;
}

.login-form {
  width: 100%;
  max-width: 460px;
  text-align: left;
}

/* ---------- 表单字段 ---------- */

.field {
  display: block;
  margin-bottom: 15px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #5b6377;
}

.field-input {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 15px;
  color: inherit;
  background: #f8fafc;
  border: 1.5px solid #e5e8f0;
  border-radius: 12px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.field-input::placeholder {
  color: #a2a9bd;
}

.field-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.13);
}

/* ---------- 密码框右侧的"显示/隐藏"按钮 ---------- */

.input-wrap {
  position: relative;
  display: block;
}

.field-input.has-toggle {
  padding-right: 64px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.toggle-password:hover {
  color: #4f46e5;
  background: #eef0f7;
}

/* ---------- 错误提示 ---------- */

.login-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}

/* ---------- 登录按钮 ---------- */

.login-button {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  background: linear-gradient(120deg, #4f46e5, #6366f1 55%, #06b6d4);
  background-size: 160% 100%;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  box-shadow: 0 14px 28px -16px rgba(79, 70, 229, 0.85);
  transition: background-position 0.4s, transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}

.login-button:hover {
  background-position: 100% 0;
  box-shadow: 0 18px 34px -16px rgba(79, 70, 229, 0.95);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- 底部说明 ---------- */

.login-hint {
  margin: 20px 0 0;
  font-size: 12px;
  color: #9aa1b3;
}

/* ==========================================================
   动画
   ========================================================== */

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.9; }
}

@keyframes nucleusPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes shineSweep {
  0%, 100% { transform: translateX(-42%) rotate(0deg); }
  50% { transform: translateX(42%) rotate(0deg); }
}

/* 三条轨道各自的旋转（倾斜角度写死在关键帧里） */
@keyframes orbit1 {
  from { transform: rotateX(70deg) rotateZ(0deg); }
  to   { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes orbit2 {
  from { transform: rotateX(70deg) rotateY(62deg) rotateZ(0deg); }
  to   { transform: rotateX(70deg) rotateY(62deg) rotateZ(360deg); }
}

@keyframes orbit3 {
  from { transform: rotateX(70deg) rotateY(-62deg) rotateZ(0deg); }
  to   { transform: rotateX(70deg) rotateY(-62deg) rotateZ(360deg); }
}

/* 输错密码时卡片抖一下 */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.login-card.is-shaking {
  animation: shake 0.4s ease-in-out;
}

/* ==========================================================
   响应式
   ========================================================== */

@media (max-width: 900px) {
  .login-stage {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .login-visual {
    min-height: 208px;
    padding: 26px 24px;
    justify-content: center;
  }

  .visual-title {
    font-size: 21px;
  }

  .visual-title br {
    display: none;
  }

  .visual-sub,
  .formulas {
    display: none;
  }

  .atom {
    top: 50%;
    right: -84px;
    width: 240px;
    height: 240px;
    opacity: 0.85;
  }

  .atom .nucleus {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
  }

  .planet {
    top: 12%;
    left: 10%;
    width: 44px;
    height: 44px;
  }

  .planet::after {
    left: -18px;
    width: 80px;
    height: 18px;
    margin-top: -9px;
  }

  .rainbow {
    left: -260px;
    bottom: -330px;
    opacity: 0.45;
  }

  .login-card {
    padding: 34px 26px 30px;
  }

  .avatar-3d {
    width: 84px;
    height: 84px;
    margin-bottom: 16px;
  }

  .login-title {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .login-body {
    padding: 16px 12px;
  }

  .login-card {
    padding: 28px 20px 24px;
  }

  .login-hint {
    margin-top: 16px;
  }
}

/* 尊重系统的"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  .visual-stars,
  .rainbow,
  .planet,
  .formulas span,
  .orbit,
  .nucleus,
  .avatar-inner,
  .avatar-shine,
  .avatar-3d::before {
    animation: none !important;
  }
}




/* ==========================================================
   主页顶部的账号栏
   ========================================================== */

.app-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f6;
  font-size: 13px;
  color: #6b7280;
}

.app-user b {
  font-weight: 600;
  color: #4f46e5;
}

.logout-button {
  flex: none;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #6b7280;
  background: transparent;
  border: 1px solid #e5e8f0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.logout-button:hover {
  color: #ef4444;
  background: #fef2f2;
  border-color: #fecaca;
}

/* 顶部栏右侧的两个按钮并排 */
.app-user-actions {
  display: flex;
  gap: 8px;
}


/* ==========================================================
   修改密码弹窗
   ========================================================== */

.modal {
  position: fixed;
  inset: 0;                     /* 上下左右都贴边，铺满全屏 */
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);   /* 半透明黑色遮罩 */
}

/* hidden 属性生效时彻底不显示 */
.modal[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 24px 20px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.4);
}

.modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: #1f2430;
}

.modal-subtitle {
  margin: 0 0 18px;
  font-size: 12px;
  color: #8b93a7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-ghost {
  flex: 1;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #d7dbe8;
}

/* 复用 .login-button 渐变外观，但改成并排布局 */
.modal-submit {
  flex: 1;
  width: auto;
}


/* ==========================================================
   主页：实验目录（两级导航）
   ========================================================== */

.catalog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 40px);
  padding: 30px 38px 40px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow:
    0 24px 48px -24px rgba(23, 37, 84, 0.25),
    0 2px 6px rgba(23, 37, 84, 0.05);
}

.catalog-header h1 {
  font-size: 28px;
}

.catalog-header .subtitle {
  margin: 8px 0 0;
}

/* ---------- 第一级：学段 ---------- */

.stage-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin: 24px 0 16px;
  background: #f4f5fa;
  border-radius: 14px;
}

.stage-tab {
  flex: 1;
  padding: 13px 0;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.stage-tab:hover {
  color: #4f46e5;
}

.stage-tab.is-active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(23, 37, 84, 0.14);
}

/* ---------- 第二级：主题 ---------- */

.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.topic-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: #5b6377;
  background: #ffffff;
  border: 1.5px solid #e5e8f0;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s,
              box-shadow 0.18s, transform 0.12s;
}

.topic-tab:hover {
  border-color: #c7d2fe;
  color: #4f46e5;
  transform: translateY(-1px);
}

.topic-tab.is-active {
  color: #ffffff;
  background: linear-gradient(120deg, #4f46e5, #6366f1);
  border-color: transparent;
  box-shadow: 0 12px 22px -14px #6366f1;
}

.topic-icon {
  font-size: 15px;
  line-height: 1;
}

.topic-count {
  padding: 1px 7px;
  font-size: 11.5px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.topic-tab.is-active .topic-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ---------- 实验卡片 ---------- */

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.experiment-grid[hidden] {
  display: none;
}

.exp-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 16px;
  color: inherit;
  text-decoration: none;
  background: #ffffff;
  border: 1.5px solid #eef0f7;
  border-radius: 16px;
  transition: transform 0.16s, border-color 0.18s, box-shadow 0.2s;
}

.exp-card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: 0 20px 34px -24px rgba(79, 70, 229, 0.65);
}

.exp-icon {
  font-size: 24px;
  line-height: 1;
}

.exp-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.exp-go {
  font-size: 12.5px;
  color: #6366f1;
}

.catalog .empty {
  margin: 8px 0 0;
}

/* 顶部栏里的链接按钮不要下划线 */
.app-user-actions a.logout-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .catalog {
    padding: 22px 18px 26px;
    border-radius: 18px;
  }

  .catalog-header h1 {
    font-size: 22px;
  }

  .stage-tab {
    padding: 11px 0;
    font-size: 14.5px;
  }

  .experiment-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   管理员页面
   ========================================================== */

.admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(120deg, #4f46e5, #06b6d4);
  border-radius: 999px;
  vertical-align: 1px;
}

/* ---------- 上传区 ---------- */

.upload-zone {
  margin: 4px 0 26px;
  padding: 26px 22px;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #dfe3ee;
  border-radius: 16px;
  transition: border-color 0.18s, background 0.18s;
}

.upload-zone.is-dragover {
  background: #eef2ff;
  border-color: #6366f1;
}

.upload-title {
  margin: 0 0 8px;
  font-size: 15px;
  color: #3d4557;
}

.upload-hint {
  margin: 0;
  font-size: 12.5px;
  color: #8b93a7;
}

.upload-hint b {
  color: #4f46e5;
}

.upload-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: #16a34a;
}

.upload-status.is-error {
  color: #dc2626;
}

.link-btn {
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  color: #4f46e5;
  background: none;
  border: 0;
  border-bottom: 1px dashed #a5b4fc;
  cursor: pointer;
}

/* ---------- 文件列表 ---------- */

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
  color: #1f2430;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid #eef0f7;
  border-radius: 13px;
  transition: border-color 0.18s, background 0.18s;
}

.file-item + .file-item {
  margin-top: 9px;
}

.file-item:hover {
  border-color: #dfe3f3;
  background: #fafbff;
}

.file-icon {
  font-size: 20px;
  line-height: 1;
}

.file-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.file-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #262c3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-size: 12px;
  color: #9aa1b3;
}

.file-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.mini-btn {
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12.5px;
  color: #5b6377;
  background: #ffffff;
  border: 1px solid #e5e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.mini-btn:hover {
  color: #4f46e5;
  border-color: #c7d2fe;
  background: #f5f7ff;
}

.mini-btn.danger:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

/* ---------- 代码编辑弹窗 ---------- */

.editor-card {
  max-width: 860px;
  width: 100%;
}

.editor-text {
  width: 100%;
  height: min(56vh, 520px);
  margin-top: 6px;
  padding: 14px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #1f2430;
  background: #f8fafc;
  border: 1.5px solid #e5e8f0;
  border-radius: 12px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}

.editor-text:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

@media (max-width: 640px) {
  .file-item {
    flex-wrap: wrap;
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }
}


/* ==========================================================
   页面级：铺满屏幕
   ========================================================== */

/* 目录页、管理员页、待办页的 body 都加了这个 class */
body.page-wide {
  padding: 20px;
  align-items: stretch;
}

/* 待办页不拉满整屏（一行的文字太长反而难读），但也不再是小卡片 */
body.page-wide .app {
  max-width: 900px;
  min-height: calc(100vh - 40px);
}

/* 宽屏下实验格子自动变多，这里限制一下最大列宽，避免卡片被拉得太扁 */
.experiment-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (min-width: 1600px) {
  .catalog {
    padding: 34px 56px 44px;
  }
}

/* 页脚：把底部空白收住，页面看起来是完整的 */
.catalog-footer {
  margin-top: auto;
  padding-top: 28px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #b8bfd0;
  text-align: center;
}

/* 卡片稍微高一点，铺满后不至于太扁 */
.exp-card {
  min-height: 118px;
  justify-content: space-between;
}


/* ==========================================================
   大屏适配 + 实验卡片缩略图
   ========================================================== */

/* ---------- 宽屏下把物理元素放大，画面才不空 ---------- */

@media (min-width: 1400px) {
  .atom {
    width: 460px;
    height: 460px;
    right: -60px;
  }

  .atom .nucleus {
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
  }

  .orbit .electron {
    width: 13px;
    height: 13px;
    margin-top: -6.5px;
  }

  .planet {
    top: 17%;
    left: 12%;
    width: 84px;
    height: 84px;
  }

  .planet::after {
    left: -30px;
    width: 144px;
    height: 30px;
    margin-top: -15px;
  }

  .rainbow {
    left: -240px;
    bottom: -320px;
    width: 760px;
    height: 760px;
  }

  .visual-title {
    max-width: 640px;
    font-size: 38px;
  }

  .visual-kicker {
    font-size: 12.5px;
    letter-spacing: 4.5px;
  }

  .formulas {
    font-size: 15px;
  }

  /* 右侧面板加一点极淡的光晕，避免大片死白 */
  .login-card {
    background: radial-gradient(circle at 50% 0%, #f7f9ff 0%, #ffffff 58%);
  }

  .login-form {
    max-width: 480px;
  }
}

/* ---------- 实验卡片缩略图 ---------- */

.exp-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  border-radius: 12px;
  font-size: 32px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.thumb-sheng {
  background: linear-gradient(135deg, #e0f2fe, #a5f3fc);
}

.thumb-guang {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.thumb-re {
  background: linear-gradient(135deg, #ffe4e6, #fecdd3);
}

.thumb-li {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.thumb-dian {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

/* 有缩略图后，卡片内边距收一点 */
.exp-card {
  padding: 12px 12px 16px;
  gap: 12px;
}


/* ==========================================================
   管理后台：标签页 + 账号管理
   ========================================================== */

.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  padding-bottom: 2px;
  border-bottom: 1px solid #eef0f6;
}

.admin-tab {
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}

.admin-tab:hover {
  color: #4f46e5;
}

.admin-tab.is-active {
  color: #4f46e5;
  border-bottom-color: #6366f1;
}

/* ---------- 账号管理 ---------- */

.user-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.user-toolbar .field-input {
  max-width: 320px;
}

.user-total {
  font-size: 13px;
  color: #8b93a7;
}

.user-tip {
  margin: 0 0 18px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #7b8194;
  background: #f8fafc;
  border-left: 3px solid #c7d2fe;
  border-radius: 0 10px 10px 0;
}

.user-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid #eef0f7;
  border-radius: 12px;
  transition: border-color 0.18s, background 0.18s;
}

.user-item + .user-item {
  margin-top: 8px;
}

.user-item:hover {
  border-color: #dfe3f3;
  background: #fafbff;
}

.user-name {
  min-width: 96px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #262c3a;
}

.user-badges {
  display: flex;
  gap: 6px;
  flex: none;
}

.status-badge {
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
}

.status-badge.ok {
  color: #15803d;
  background: #dcfce7;
}

.status-badge.off {
  color: #b91c1c;
  background: #fee2e2;
}

.status-badge.admin {
  color: #ffffff;
  background: linear-gradient(120deg, #4f46e5, #06b6d4);
}

.user-meta {
  flex: 1;
  font-size: 12.5px;
  color: #9aa1b3;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.page-info {
  font-size: 13px;
  color: #8b93a7;
}

.mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .user-item {
    flex-wrap: wrap;
  }

  .user-meta {
    width: 100%;
    flex: none;
  }

  .user-toolbar {
    flex-wrap: wrap;
  }
}
