/* 样式。颜色都集中在最上面的变量里。
   界面造型参考 OP-1 field 硬件风格，只用系统字体。 */

:root {
  --page: #d7dad9;
  --panel-a: #f2f3f0;
  --panel-b: #e5e7e4;
  --card-b: #e3e6e2;
  --panel-border: #b6bcb8;
  --panel-shadow: inset 0 1px 0 #fff, 0 3px 12px #39464012;
  --card-border: #bac3bb;
  --card-shadow: inset 0 1px #fff, 0 2px 8px #0000000d;

  --text: #303737;
  --strong: #303c32;
  --muted: #5e6c5a;
  --soft: #68716c;
  --line: #c4cbc4;

  --well: #e2e5e0;
  --well-border: #c3c9c3;
  --label: #5f6a62;
  --control: #f3f4ef;
  --control-text: #404b41;
  --control-border: #bdc5bc;
  --control-shadow: inset 0 1px 0 #fff, 0 1px 2px #4b584811;
  --hover: #e9ede5;

  --display: #272e2b;
  --display-text: #ecd8a9;
  --display-border: #171d19;

  --pressed: #c6dce5;
  --pressed-text: #183c4c;
  --pressed-border: #668da2;

  --button: #f4f5ee;
  --button-text: #35462f;
  --button-border: #bac5b5;
  --button-hover: #eaf0e2;
  --warn: #8a672b;
  --orange: #dc9860;

  --calendar: #eff1ec;
  --calendar-border: #aeb8af;
  --calendar-hover: #ced9d3;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* ---------- 基础 ---------- */

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background: var(--page);
}
button, input, a { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #608eb0; outline-offset: 3px; }

main {
  width: calc(100% - 48px);
  max-width: 1160px;
  margin: 28px auto;
  padding: 34px 34px 25px;
  background: linear-gradient(145deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--panel-shadow);
}

/* ---------- 顶部 ---------- */

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 2px 0 28px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.brand::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle, var(--soft) 1px, transparent 1.6px) 0 0 / 5px 5px;
}
h1 { font-weight: 300; font-size: 36px; letter-spacing: -.7px; line-height: 1.35; margin: 27px 0 13px; color: var(--strong); }
.badge { font-size: 12px; font-weight: 300; letter-spacing: .7px; color: var(--soft); margin-top: 3px; white-space: nowrap; }

/* ---------- 筛选区 ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 13px;
  padding: 20px 18px;
  background: var(--well);
  border: 1px solid var(--well-border);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px #53634d0c;
}
.label { display: block; margin-bottom: 9px; font-size: 11px; letter-spacing: .5px; color: var(--label); }

.filters button, .filters input {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--control-text);
  background: var(--control);
  border: 1px solid var(--control-border);
  border-radius: 5px;
  box-shadow: var(--control-shadow);
}
.filters button { cursor: pointer; }
.filters button:hover:not(:disabled) { background: var(--hover); }
.filters button:disabled { opacity: .4; cursor: default; box-shadow: none; }

.nav { display: flex; gap: 6px; }
.nav #today { border-bottom: 3px solid var(--orange); }

.search { margin-left: auto; }
.search input { width: 230px; max-width: 100%; }

/* ---------- 日期显示 + 日历 ---------- */

.calendar-wrap { position: relative; }
.filters .date-display,
.filters .date-display:hover {
  min-width: 180px; text-align: left;
  font: 16px var(--mono); letter-spacing: .3px;
  color: var(--display-text); background: var(--display); border-color: var(--display-border);
  box-shadow: inset 0 1px 3px #10191045;
}
.calendar-panel {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0;
  width: 350px; max-width: calc(100vw - 60px); padding: 18px;
  background: var(--calendar); border: 1px solid var(--calendar-border); border-radius: 9px;
  box-shadow: 0 12px 28px #0003;
}
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-head strong { font: 500 15px var(--mono); color: var(--strong); }
.filters .calendar-head button { min-width: 42px; min-height: 38px; padding: 6px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-week span { text-align: center; font-size: 11px; color: var(--label); padding: 8px 0; }
.filters .calendar-day {
  min-height: 43px; padding: 4px 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  background: transparent; border: 0; box-shadow: none; color: var(--strong);
}
.filters .calendar-day:hover, .filters .calendar-day[aria-pressed="true"] { background: var(--calendar-hover); }
.calendar-dots { display: flex; gap: 4px; min-height: 8px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 1px 1px #ffffff9c, 0 1px 2px #0004; }
.calendar-legend { display: flex; gap: 18px; margin-top: 13px; font-size: 12px; color: var(--muted); }
.calendar-legend span { display: flex; gap: 6px; align-items: center; }

/* ---------- 当天标题 ---------- */

.summary { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 29px 0 22px; }
.summary h2 { margin: 0; font-size: 21px; font-weight: 400; letter-spacing: -.3px; color: var(--strong); }
.summary span { font: 12px var(--mono); color: var(--muted); }

/* ---------- 课程卡片 ---------- */

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column;
  padding: 22px 24px;
  background: linear-gradient(145deg, var(--panel-a), var(--card-b));
  border: 1px solid var(--card-border);
  border-radius: 9px;
  box-shadow: var(--card-shadow);
}
.card h3 { margin: 0 0 4px; font-size: 23px; font-weight: 400; line-height: 1.4; color: var(--strong); }

.lesson { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.lesson:first-of-type { border-top: 1px solid var(--line); margin-top: 12px; }
.lesson-time { font: 300 24px/1.2 var(--mono); color: var(--strong); letter-spacing: -.3px; }
.lesson-what { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--strong); }
.lesson-no { font-size: 12px; color: var(--soft); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 3px; color: #8a4f1b; background: #f3dcc2; }
.lesson-who { margin-top: 3px; font-size: 12px; color: var(--soft); }

.primary {
  display: inline-flex; align-items: center; min-height: 44px; padding: 9px 15px; white-space: nowrap; flex-shrink: 0;
  font-size: 13px; text-decoration: none;
  color: var(--button-text); background: var(--button);
  border: 1px solid var(--button-border); border-radius: 5px;
  box-shadow: inset 0 1px 0 #fff6, 0 1px 2px #53634b18;
}
.primary::before { content: ""; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: #d68f55; }
.primary:hover { background: var(--button-hover); }

.card-footer { padding-top: 12px; }
.secondary { font-size: 12px; color: var(--muted); text-decoration: none; }
.secondary:hover { text-decoration: underline; text-underline-offset: 4px; }

.no-results { margin: 0; padding: 40px 0; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- 页脚 ---------- */

footer { margin: 25px 0 5px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.9; color: var(--muted); }
/* ---------- 窄屏 ---------- */

@media (max-width: 1050px) {
  main { width: calc(100% - 32px); margin: 20px 16px; padding: 28px 24px; }
  .search { flex: 1; min-width: 200px; }
  .search input { width: 100%; }
}

@media (max-width: 720px) {
  .top { display: block; }
  .badge { display: inline-block; margin-top: 4px; }
  .summary { display: block; }
  .summary span { display: block; margin-top: 8px; }
  .cards { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .card h3 { font-size: 21px; }
}

@media (max-width: 600px) {
  main { width: calc(100% - 20px); margin: 10px; padding: 23px 16px; border-radius: 9px; }
  h1 { font-size: 29px; margin: 23px 0 11px; }
  .filters { padding: 16px 12px; }
  .filters > div { width: 100%; }
  .date-display { width: 100%; }
  .nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 5px; }
  .nav button { padding: 9px 5px; font-size: 12px; }
  .search { min-width: 0; }
  .summary h2 { font-size: 19px; }
  .primary { font-size: 12px; padding: 9px 10px; }
  .primary::before { margin-right: 7px; }
  .lesson-time { font-size: 21px; }
}
