/* 幻想说英语 · 固定课位监控（服务器版）样式
   配色跟着公众号走：深墨蓝 + 品牌粉，状态色沿用网页端的红/灰/黄。 */

:root {
  --ink: #1d2330;
  --ink-2: #2a3242;
  --pink: #e8618c;
  --pink-d: #d0416f;
  --pink-l: #fdeef3;
  --bg: #f5f2f4;
  --card: #ffffff;
  --line: #ebe4e8;
  --text: #2c3140;
  --muted: #8c8f9b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 35, 48, .05), 0 8px 24px -12px rgba(29, 35, 48, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pink-d); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f3eef1; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.footnote {
  max-width: 1080px;
  margin: 8px auto 26px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.7;
}
.footnote code { font-size: 11.5px; }

/* ------------------------------------------------------------------ 登录/首次 */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 480px at 50% -10%, #fbe3ea 0%, transparent 60%),
    linear-gradient(180deg, #f7f3f5 0%, #f2eef1 100%);
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 30px 22px;
  text-align: center;
}

.gate-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--pink) 0%, #f090ac 100%);
  color: #fff;
  font-size: 25px;
  line-height: 54px;
  box-shadow: 0 6px 16px -6px rgba(216, 65, 111, .55);
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: .3px;
  color: var(--ink);
}

.gate-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.gate-foot {
  margin: 20px 0 0;
  color: #b3b5be;
  font-size: 11.5px;
}

.gate-card label {
  display: block;
  text-align: left;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #6b6f7c;
}

.gate-card label .hint {
  margin-left: 6px;
  color: #b9bbc3;
  font-size: 11.5px;
}

.gate-card input[type="password"] {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fbfafb;
  transition: border-color .15s, box-shadow .15s;
}

.gate-card input[type="password"]:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-l);
  background: #fff;
}

/* ------------------------------------------------------------------ 顶栏 */

.topbar {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #eef0f5;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}

.topbar-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap;
}

.brand .star { color: var(--pink); margin-right: 3px; }

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #aeb4c2;
  flex: 1;
  min-width: 0;
}

.topbar-meta #top-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions { display: flex; gap: 8px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #6b7280;
}
.dot-green { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.dot-red { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
.dot-gray { background: #6b7280; }

/* 顶栏里的「定时任务停了」小胶囊 */
.warn-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #7a2e12;
  background: #ffe1cd;
  border: 1px solid #ffbe95;
  white-space: nowrap;
}
.warn-pill:hover { background: #ffd2b4; }
.warn-pill[hidden] { display: none; }

/* 等宽（健康检查地址用） */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* 健康检查清单 */
.checklist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13.5px;
}
.checklist li { padding: 3px 0 3px 2px; border-bottom: 1px dashed #e6e9f0; }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck-ok { color: #1f7a4d; }
.checklist .ck-bad { color: #c0392b; font-weight: 600; }
.checklist .ck-warn { color: #a15c00; }


/* ------------------------------------------------------------------ 标签页 */

.tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  background: var(--ink-2);
  overflow-x: auto;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #99a0b0;
  padding: 11px 16px 12px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.tab:hover { color: #dfe3ec; }
.tab.active { color: #fff; border-bottom-color: var(--pink); }

/* ------------------------------------------------------------------ 布局 */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.pane { display: none; }
.pane.active { display: block; animation: fade .18s ease-out; }

@keyframes fade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.card-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 120px;
}

.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ 表单 */

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}

.field.grow { flex: 1 1 220px; }

.field > span {
  font-size: 12px;
  color: var(--muted);
  padding-left: 1px;
}

input[type="text"], input[type="password"], input:not([type]), select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fbfafb;
  transition: border-color .15s, box-shadow .15s, background .15s;
  width: 100%;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--pink);
  background: #fff;
  box-shadow: 0 0 0 3px var(--pink-l);
}

select { cursor: pointer; }

/* ------------------------------------------------------------------ 按钮 */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: #414653;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover { background: #faf7f9; border-color: #dfd3d9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-d) 100%);
  border-color: var(--pink-d);
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(216, 65, 111, .7);
}
.btn-primary:hover { background: linear-gradient(180deg, #ec6f97 0%, #c93b68 100%); }

.btn-ghost {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .16);
  color: #e8ebf2;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }

.btn-danger-ghost { color: #c0392b; border-color: #f0d6d2; background: #fff; }
.btn-danger-ghost:hover { background: #fdf3f1; border-color: #e8c2bb; }

/* ------------------------------------------------------------------ 表格 */

.table-wrap { overflow-x: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 10px;
  border-bottom: 1px solid #f4eff2;
  vertical-align: middle;
}

.tbl tbody tr:hover { background: #fcfafb; }
.tbl tbody tr:last-child td { border-bottom: 0; }

.tbl .empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
}

.tbl .t-time { font-variant-numeric: tabular-nums; font-weight: 500; }

.row-del {
  border: 0;
  background: transparent;
  color: #c8ccd4;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.row-del:hover { color: #c0392b; background: #fdf3f1; }

/* ------------------------------------------------------------------ 状态胶囊 */

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
  border: 1px solid transparent;
}

.st-free { background: #ffe6df; color: #bf3b17; border-color: #ffd3c7; }
.st-taken { background: #eceef1; color: #6b7280; border-color: #e1e4e8; }
.st-mine { background: #fff5cc; color: #9a6a05; border-color: #f6e6a5; }
.st-absent { background: #eef1ff; color: #4b53b8; border-color: #e0e4fb; }
.st-unknown { background: #f4f4f6; color: #9aa0ab; border-color: #eaeaee; }

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.legend-tip { color: var(--muted); margin-left: 4px; }

/* ------------------------------------------------------------------ 课表网格 */

.tt-wrap { margin-top: 6px; }

.tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tt-head #tt-title { font-size: 13.5px; color: var(--ink); }
.tt-head #tt-meta { margin-left: 8px; font-size: 12.5px; }

.tt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.tt-day {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px 10px;
  background: #fdfcfc;
}

.tt-day h3 {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 600;
  color: #6b6f7c;
  letter-spacing: .5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tt-day h3 .cnt {
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
}

.slot {
  width: 100%;
  margin-bottom: 5px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .06s, box-shadow .15s;
  font-family: inherit;
}

.slot:last-child { margin-bottom: 0; }
.slot:hover { transform: translateY(-1px); box-shadow: 0 3px 8px -4px rgba(0, 0, 0, .25); }
.slot:active { transform: none; }

.slot.free { background: #ffe6df; border-color: #ffcdbf; color: #bf3b17; }
.slot.taken { background: #edeff2; border-color: #e2e5e9; color: #7c828d; }
.slot.mine { background: #fff5cc; border-color: #f4e39a; color: #94650a; }
.slot.absent { background: #f7f7f9; border-color: #ececf0; color: #a3a8b2; }

.slot .tag { font-size: 10.5px; opacity: .75; margin-left: 3px; }

.slot.picked {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
  font-weight: 600;
}

.slot.in-list {
  opacity: .45;
  cursor: default;
}

.slot.in-list::after { content: " ✓已在监控"; font-size: 10.5px; }

.placeholder {
  text-align: center;
  color: #9a9ea9;
  padding: 26px 10px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: #fcfbfb;
}
.placeholder p { margin: 5px 0; }

/* ------------------------------------------------------------------ 账号 */

.acct-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.subtabs {
  display: inline-flex;
  gap: 3px;
  background: #f4eff2;
  padding: 3px;
  border-radius: 10px;
  margin: 14px 0 12px;
}

.subtab {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #6b6f7c;
  cursor: pointer;
  font-family: inherit;
}

.subtab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.subpane { display: none; }
.subpane.active { display: block; }

/* ------------------------------------------------------------------ 日志 */

.logbox {
  margin: 0;
  padding: 14px 16px;
  background: #1c2130;
  color: #cfd6e4;
  border-radius: 11px;
  font: 12.5px/1.75 ui-monospace, SFMono-Regular, Consolas, "Cascadia Mono", Menlo, monospace;
  max-height: 62vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------------------ 提示 */

.msg {
  min-height: 18px;
  font-size: 12.5px;
  margin-top: 6px;
}
.msg.ok { color: #1f8a58; }
.msg.err { color: #c0392b; }
.msg.info { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: rgba(29, 35, 48, .95);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 88vw;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  z-index: 90;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(160, 38, 28, .96); }

/* ------------------------------------------------------------------ 窄屏 */

@media (max-width: 720px) {
  .topbar-in { padding: 10px 14px; gap: 8px; }
  .brand { font-size: 14px; }
  .topbar-meta { order: 3; flex-basis: 100%; }
  .wrap { padding: 14px 12px 48px; }
  .card { padding: 14px 14px 16px; }
  .tt-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
  .tbl th:nth-child(5), .tbl td:nth-child(5) { display: none; }
}
