/* 子汐课程表 · 网页版样式（配色对齐 Android App） */
:root {
  --bg: #EEEDF3;
  --card: #E7E6EE;
  --primary: #4A5B8C;
  --on-primary: #FFFFFF;
  --text: #1C1B1F;
  --text-2: #6E6D78;
  --divider: #D9D8E0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
}
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.auth-view {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 26px;
  box-shadow: 0 8px 30px rgba(28, 27, 31, .08);
}
.auth-logo { font-size: 26px; font-weight: 700; text-align: center; }
.auth-sub { color: var(--text-2); font-size: 13px; text-align: center; margin: 8px 0 24px; }
.input {
  width: 100%;
  border: 1px solid var(--divider);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}
.input:focus { border-color: var(--primary); }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; margin-bottom: 12px; }
.btn {
  border: none; border-radius: 14px;
  padding: 12px 16px; font-size: 15px; cursor: pointer;
}
.btn.primary { width: 100%; background: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); white-space: nowrap; }
.btn.ghost.full { width: 100%; margin-bottom: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; }
.auth-links a { color: var(--primary); font-size: 13px; text-decoration: none; }
.auth-links a:active { opacity: .6; }
.reset-q { background: #fff; border: 1px solid var(--divider); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.auth-local { text-align: center; margin-top: 14px; }
.auth-local a { color: var(--text-2); font-size: 13px; text-decoration: none; border-bottom: 1px dashed var(--divider); padding-bottom: 2px; }
.auth-local a:active { opacity: .6; }
.msg { color: var(--text-2); font-size: 13px; min-height: 18px; margin: 10px 2px 0; }
.msg.err { color: #C0392B; }
.msg.center { text-align: center; }

/* ---------- 主页 ---------- */
.main-view { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center;
  padding: 14px 12px 6px 20px;
}
.title-wrap { flex: 1; }
.week-title { font-size: 24px; font-weight: 700; }
.week-date { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.top-actions { display: flex; gap: 4px; align-items: center; }
.user-chip {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--text-2); padding: 0 6px;
}
.icon-btn {
  width: 40px; height: 40px; border: none; border-radius: 20px;
  background: transparent; color: var(--text); font-size: 18px; cursor: pointer;
}
.icon-btn:hover { background: var(--card); }
.mini-btn {
  border: 1px solid var(--primary); background: transparent; color: var(--primary);
  border-radius: 16px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.mini-btn:hover { background: var(--card); }

.weekbar { display: flex; align-items: center; padding: 10px 4px 6px 0; }
.weekbar .month {
  width: 44px; text-align: center; flex: none;
}
.weekbar .month .m { font-size: 14px; font-weight: 600; }
.weekbar .month .mu { font-size: 12px; color: var(--text-2); }
.weekbar .day { flex: 1; text-align: center; }
.weekbar .day .dn { font-size: 13px; color: var(--text-2); }
.weekbar .day .dn.today { color: var(--text); font-weight: 600; }
.weekbar .day .dd {
  display: inline-block; margin-top: 4px; padding: 2px 8px;
  border-radius: 8px; font-size: 14px; color: var(--text-2);
}
.weekbar .day .dd.today { background: #2B2B2E; color: #fff; }

.nav-row { display: flex; align-items: center; gap: 8px; padding: 2px 16px 8px; }
.nav-btn {
  width: 34px; height: 34px; border: none; border-radius: 17px;
  background: var(--card); color: var(--text); font-size: 18px; cursor: pointer;
}
.nav-week { font-size: 14px; color: var(--text-2); min-width: 56px; text-align: center; }
.back-today {
  margin-left: auto;
  border: none; border-radius: 16px;
  background: var(--primary); color: var(--on-primary);
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}

.grid-scroll { flex: 1; overflow: auto; padding: 0 4px 16px; }
.grid { display: flex; }
.grid .timecol { width: 44px; flex: none; }
.grid .slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.grid .slot .si { font-size: 15px; font-weight: 600; }
.grid .slot .st { font-size: 9px; color: var(--text-2); }
.grid .daycol { flex: 1; padding: 0 1.5px; }
.course {
  border-radius: 6px; color: #fff; padding: 5px; margin: 1.5px 0;
  overflow: hidden; font-size: 12px; line-height: 16px;
}
.course .cn { font-weight: 600; }
.course .cr { font-size: 11px; opacity: .92; line-height: 15px; }
.course.dim { opacity: .45; }
.spacer { /* 空节次占位 */ }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(28, 27, 31, .38);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%; max-width: 420px; max-height: 90vh;
  background: var(--card); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
.modal-card.wide { max-width: 620px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; font-size: 17px; font-weight: 700;
  border-bottom: 1px solid var(--divider);
}
.modal-x {
  border: none; background: transparent; font-size: 24px; line-height: 1;
  color: var(--text-2); cursor: pointer; padding: 0 4px;
}
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--divider);
}
.modal-foot .btn { flex: none; }
.modal-foot .btn.auto { margin-left: auto; }
.modal-tip { color: var(--text-2); font-size: 12.5px; line-height: 1.6; margin: 0 0 10px; }
.input.area { min-height: 96px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.divider-or {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 12px; margin: 14px 0;
}
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--divider); }
.file-pick { display: block; cursor: pointer; }

/* ---------- 编辑器 ---------- */
.ed-sec { margin-bottom: 20px; }
.ed-sec > h4 {
  font-size: 14px; font-weight: 700; margin: 0 0 10px;
  color: var(--primary);
}
.ed-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ed-field { flex: 1; min-width: 140px; margin-bottom: 10px; }
.ed-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.ed-field .input { margin-bottom: 0; }
.ed-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-right: 16px; }
.ed-list-item {
  background: #fff; border: 1px solid var(--divider); border-radius: 14px;
  padding: 12px; margin-bottom: 10px;
}
.ed-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ed-item-head .swatch { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.ed-item-head .ttl { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-times { border-top: 1px dashed var(--divider); margin-top: 8px; padding-top: 8px; }
.ed-time-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ed-time-row select, .ed-time-row input { border: 1px solid var(--divider); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: #fff; }
.ed-time-row input.wk { flex: 1; min-width: 90px; }
.ed-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-act {
  border: 1px solid var(--divider); background: #fff; color: var(--primary);
  border-radius: 10px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
}
.mini-act.danger { color: #C0392B; border-color: #E6C3BD; }
.mini-act:active { opacity: .6; }
