/* ============================================================
   keira · 大二上期末冲刺站
   明亮像素风：天蓝 / 奶油纸 / 向日葵黄 / 草绿 + 深棕描边
   ============================================================ */

@font-face {
  font-family: 'FusionPixel';
  src: url('../fonts/fusion-pixel-12px-sc.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 墨色 */
  --ink: #2E2A22;
  --ink-2: #6C6152;
  --ink-3: #A2967F;

  /* 纸 */
  --paper: #FFF8E8;
  --paper-2: #FFF0CB;
  --paper-3: #F8E7BE;

  /* 天 */
  --sky: #8FDCF6;
  --sky-2: #C8EEFB;
  --sky-3: #E9F8FE;

  /* 向日葵 */
  --sun: #FFCC33;
  --sun-2: #F2A93B;
  --sun-3: #FFF0B6;

  /* 草 */
  --green: #5DBE8C;
  --green-2: #2E8B62;

  /* 强调（只给逾期 / 考试） */
  --red: #E0523C;
  --blue: #4E8FD6;

  --bd: 3px solid var(--ink);
  --bd-2: 2px solid var(--ink);
  --sh: 6px 6px 0 var(--ink);
  --sh-s: 4px 4px 0 var(--ink);
  --sh-xs: 3px 3px 0 var(--ink);

  --r: 0; /* 永不圆角 */
  --dock-h: 68px;
  --maxw: 1000px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'FusionPixel', 'Microsoft YaHei', 'PingFang SC', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  background: #C8EEFB;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: geometricPrecision;
  image-rendering: pixelated;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

button { cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ============================================================
   背景：天光渐变 + 纸纹 + 云 / 太阳
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg,
      #7FD3F2 0%,
      #A9E4FA 26%,
      #D3F0FC 48%,
      #FBF0D2 68%,
      #F7EBC9 100%);
}

/* 纸纹：4px 抖动网点 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(rgba(46, 42, 34, .09) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 4px 4px, 4px 4px;
  background-position: 0 0, 2px 2px;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.scene__sun {
  position: absolute;
  top: 22px;
  right: 20px;
  width: 88px;
  height: 88px;
}
/* 内容区两侧留白不足时收起大太阳，避免被视口或卡片切一半 */
@media (max-width: 1239px) {
  .scene__sun { display: none; }
}
.scene__cloud { position: absolute; }
.scene__cloud--a { top: 96px; left: 4%; width: 108px; opacity: .95; }
.scene__cloud--b { top: 200px; right: 22%; width: 74px; opacity: .7; }
.scene__cloud--c { top: 38px; left: 34%; width: 58px; opacity: .5; }

/* ============================================================
   骨架
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 22px calc(var(--dock-h) + 46px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  padding: 0;
  font-size: 24px;
  letter-spacing: 1px;
  line-height: 1;
}
.brand__mark {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--sun);
  border: var(--bd);
  box-shadow: 3px 3px 0 var(--ink);
  position: relative;
}
.brand__mark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  background: var(--ink);
}
.brand:active .brand__mark { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.topbar__sep { width: 3px; height: 3px; background: var(--ink-3); }

/* ============================================================
   通用卡片 / 按钮 / 标签
   ============================================================ */
.card {
  background: var(--paper);
  border: var(--bd);
  box-shadow: var(--sh);
  padding: 16px 18px;
  position: relative;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.card__head h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .5px;
}
.card__head .spacer { flex: 1; }

.sec-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  background: var(--sun);
  border: var(--bd-2);
  display: grid;
  place-items: center;
}
.sec-icon svg { width: 14px; height: 14px; display: block; }
.sec-icon--green { background: var(--green); }
.sec-icon--paper { background: var(--paper-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--bd);
  background: var(--sun);
  box-shadow: var(--sh-xs);
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.6;
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.btn:hover { background: #FFD84F; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn--ghost { background: var(--paper); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: #6BCB98; }
.btn--icon { padding: 5px 8px; }

.link {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 12px;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.link:hover { color: var(--ink); border-bottom-color: var(--sun); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  padding: 1px 6px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  white-space: nowrap;
}
.tag--exam { background: var(--red); color: #fff; }
.tag--class { background: var(--blue); color: #fff; }
.tag--other { background: var(--paper-3); }
.tag--green { background: var(--green); color: #fff; }

.danger { color: var(--red); }
.warn { color: var(--sun-2); }
.ok { color: var(--green-2); }
.muted { color: var(--ink-2); }

/* 图钉 / 胶带 */
.pin {
  position: absolute;
  top: -9px;
  left: 22px;
  width: 14px;
  height: 14px;
  background: var(--sun);
  border: var(--bd-2);
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .55);
  z-index: 2;
}
.pin--green { background: var(--green); }
.pin--red { background: var(--red); }

/* ============================================================
   首页 · hero
   ============================================================ */
.view { display: none; }
.view.is-active { display: block; }

.hero { padding: 0; overflow: hidden; }

.hero__sky {
  position: relative;
  height: 54px;
  background: linear-gradient(180deg, #93DDF7 0%, #C9EFFC 100%);
  border-bottom: var(--bd);
  overflow: hidden;
}
.hero__sun {
  position: absolute;
  right: 64px;
  top: 9px;
  width: 36px;
  height: 36px;
}
.hero__cloud { position: absolute; }
.hero__cloud--a { left: 30px; top: 14px; width: 46px; opacity: .95; }
.hero__cloud--b { left: 46%; top: 6px; width: 32px; opacity: .8; }
.hero__cloud--c { right: 96px; top: 30px; width: 26px; opacity: .7; }

.hero__body { padding: 18px 20px 16px; }

.hero__top {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border: 2px solid var(--ink);
}

.hero__title {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 1px;
}
.hero__sub {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* 倒计时牌 */
.count {
  flex: 0 0 auto;
  min-width: 196px;
  background: var(--sun);
  border: var(--bd);
  box-shadow: var(--sh-xs);
  padding: 7px 12px 8px;
  text-align: center;
}
.count__label {
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.count__label::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--red);
  border: 1px solid var(--ink);
}
.count__name {
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
  margin: 0 auto;
}
.count__place {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(46, 42, 34, .72);
  margin-top: 2px;
  padding-top: 3px;
  border-top: 2px dashed rgba(46, 42, 34, .28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count__num {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 1px 0 0;
}
.count__num small { font-size: 12px; letter-spacing: 0; margin-left: 2px; }
.count__date { font-size: 12px; color: rgba(46, 42, 34, .72); line-height: 1.4; }

/* 目标条 */
.goals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 3px dashed rgba(46, 42, 34, .22);
}
.goal {
  background: #fff;
  border: var(--bd-2);
  padding: 6px 8px 7px;
  min-width: 0;
}
.goal__top {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.goal__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: var(--sun-3);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.goal__icon svg { width: 10px; height: 10px; display: block; }
.goal__label {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goal__value {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal__bar {
  height: 5px;
  margin-top: 5px;
  background: var(--paper-3);
  border: 1px solid rgba(46, 42, 34, .55);
  position: relative;
  overflow: hidden;
}
.goal__bar > i {
  display: block;
  height: 100%;
  background: var(--green);
}
.goal__note {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal--done .goal__bar > i { background: var(--green); }

/* keira 主动气泡 */
.bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  background: #fff;
  border: var(--bd-2);
  box-shadow: var(--sh-xs);
  padding: 10px 30px 10px 10px;
  position: relative;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.bubble:hover { box-shadow: 5px 5px 0 var(--ink); }
.bubble__avatar { width: 34px; height: 42px; flex: 0 0 auto; display: block; }
.bubble__text { font-size: 12px; line-height: 1.75; }
.bubble__text b { color: var(--red); }
.bubble__text .who { color: var(--ink-2); }
.bubble__close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  color: var(--ink-3);
  padding: 0;
  display: grid;
  place-items: center;
}
.bubble__close svg { width: 10px; height: 10px; display: block; }
.bubble__close:hover { color: var(--red); }
.bubble[hidden] { display: none; }

/* ============================================================
   首页 · 两个列表
   ============================================================ */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

.rows { margin-top: 2px; }
.row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 2px dashed rgba(46, 42, 34, .18);
  min-width: 0;
}
.row:first-child { border-top: 0; padding-top: 2px; }
.row__tag {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  background: var(--paper-3);
}
.row__tag--exam { background: var(--red); color: #fff; }
.row__tag--class { background: var(--blue); color: #fff; }
.row__tag--other { background: var(--sun-3); }
.row__tag--late { background: var(--red); color: #fff; }
.row__main { flex: 1; min-width: 0; }
.row__title {
  font-size: 12px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__sub {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__right {
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  padding-left: 4px;
}

/* ============================================================
   首页 · 绩点摘要
   ============================================================ */
.gpa-strip {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.gpa-strip__item { min-width: 84px; }
.gpa-strip__label { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.gpa-strip__num { font-size: 36px; line-height: 1.1; }
.gpa-strip__num small { font-size: 12px; }
.gpa-strip__sep { width: 3px; height: 38px; background: rgba(46, 42, 34, .2); }
.gpa-strip__bar { flex: 1; min-width: 180px; }
.gpa-strip__note { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.gpa-strip__note b { color: var(--red); }

.bar {
  height: 14px;
  background: #fff;
  border: var(--bd-2);
  position: relative;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--green);
  border-right: 2px solid var(--ink);
}
.bar__target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 4px;
  background: var(--red);
  border-left: 1px solid rgba(255, 255, 255, .55);
}

/* ============================================================
   页头
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 1px;
}
.page-head__sub { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.page-head__right { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   DDL
   ============================================================ */
.addbar {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.addbar__input {
  flex: 1;
  min-width: 0;
  border: var(--bd);
  background: #fff;
  padding: 6px 10px;
  box-shadow: var(--sh-xs);
}
.addbar__input::placeholder { color: var(--ink-3); }
.addbar__time {
  border: var(--bd);
  background: var(--paper-2);
  padding: 6px 8px;
  box-shadow: var(--sh-xs);
  width: 148px;
  flex: 0 0 auto;
}
.addbar__hint {
  width: 100%;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: -4px;
}

.ddl-group { margin-bottom: 18px; }
.ddl-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ddl-group__head h2 { font-size: 24px; font-weight: 400; line-height: 1.2; }
.count-pill {
  font-size: 12px;
  line-height: 1;
  background: var(--sun);
  border: 2px solid var(--ink);
  padding: 3px 5px 4px;
  min-width: 22px;
  text-align: center;
  display: inline-block;
}
.ddl-group__rule { flex: 1; height: 3px; background: rgba(46, 42, 34, .14); }

.thing {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: var(--bd);
  box-shadow: var(--sh-xs);
  padding: 9px 12px;
  margin-bottom: 9px;
  min-width: 0;
}
.thing--overdue {
  border-left: 8px solid var(--red);
  background: #FFF4EE;
}
.thing--checked { background: #F1FBF5; border-left: 8px solid var(--green); }
.thing--checked .thing__title { color: var(--ink-2); }

.check {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: var(--bd);
  background: #fff;
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .55);
  position: relative;
  display: grid;
  place-items: center;
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.check:hover { background: var(--sun-3); }
.check:active { transform: translate(2px, 2px); box-shadow: 0 0 0; }
.check svg { width: 16px; height: 16px; display: none; }
.check.is-checked { background: var(--green); }
.check.is-checked svg { display: block; }

.thing__main { flex: 1; min-width: 0; }
.thing__title {
  font-size: 12px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thing__due { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.thing__right { font-size: 12px; white-space: nowrap; flex: 0 0 auto; }

/* 已完成：底部一小块，默认折叠 */
.done {
  margin-top: 24px;
  border-top: 3px dashed rgba(46, 42, 34, .2);
  padding-top: 10px;
}
.done__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: var(--bd-2);
  background: var(--paper-2);
  padding: 6px 10px;
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .5);
  font-size: 12px;
  text-align: left;
}
.done__toggle .spacer { flex: 1; }
.done__arrow {
  width: 8px;
  height: 8px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
  transition: transform .12s steps(2);
  margin-right: 2px;
}
.done[open] .done__arrow { transform: rotate(-135deg); }
.done__list { padding: 6px 2px 0; }
.done__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 2px dashed rgba(46, 42, 34, .14);
  font-size: 12px;
  color: var(--ink-2);
  min-width: 0;
}
.done__row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.done__row .time { flex: 0 0 auto; color: var(--ink-3); }
.done__note { font-size: 12px; color: var(--ink-3); padding: 6px 2px 0; }

.empty {
  border: 3px dashed rgba(46, 42, 34, .28);
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .45);
}

/* ============================================================
   日程
   ============================================================ */
.day { margin-bottom: 16px; }
.day__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.day__date {
  font-size: 12px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  padding: 1px 8px;
  white-space: nowrap;
}
.day__rule { flex: 1; height: 3px; background: rgba(46, 42, 34, .14); }
.day__left { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.event {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--paper);
  border: var(--bd);
  box-shadow: var(--sh-xs);
  padding: 10px 12px;
  margin-bottom: 9px;
  min-width: 0;
  position: relative;
}
.event--exam { border-left: 8px solid var(--red); }
.event--class { border-left: 8px solid var(--blue); }
.event--other { border-left: 8px solid var(--sun-2); }
.event--past { opacity: .62; box-shadow: none; }

.event__time {
  flex: 0 0 auto;
  width: 62px;
  border-right: 2px dashed rgba(46, 42, 34, .22);
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.event__start { font-size: 12px; line-height: 1.5; }
.event__end { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.event__body { flex: 1; min-width: 0; }
.event__top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.event__title {
  font-size: 12px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event__meta {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event__cd {
  flex: 0 0 auto;
  align-self: center;
  font-size: 12px;
  white-space: nowrap;
  text-align: right;
}

/* ============================================================
   GPA
   ============================================================ */
.gpa-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.gpa-hero__item { min-width: 96px; }
.gpa-hero__label { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.gpa-hero__num { font-size: 48px; line-height: 1.05; letter-spacing: -1px; }
.gpa-hero__num small { font-size: 12px; letter-spacing: 0; }
.gpa-hero__mid { flex: 1; min-width: 200px; }
.gpa-hero__note { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
.gpa-hero__note b { color: var(--green-2); }

.subjects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.subject {
  background: var(--paper);
  border: var(--bd);
  box-shadow: var(--sh-s);
  padding: 12px 14px;
  min-width: 0;
}
.subject--done { background: #F6FCF8; }
.subject__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}
.subject__name {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject__credit {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  flex: 0 0 auto;
}
.subject__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  flex-wrap: wrap;
}
.subject__meta .dot { width: 3px; height: 3px; background: var(--ink-3); }

.comps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.comp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid rgba(46, 42, 34, .8);
  background: #fff;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.7;
}
.comp i { font-style: normal; color: var(--ink-2); }
.comp b { font-weight: 400; }
.comp--empty { background: var(--paper-3); border-style: dashed; }
.comp--empty b { color: var(--ink-2); }

.subject__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px dashed rgba(46, 42, 34, .18);
  flex-wrap: wrap;
}
.subject__need { font-size: 12px; }
.subject__need b { font-size: 24px; line-height: 1; color: var(--red); margin: 0 2px; }
.subject__need--ok b { color: var(--green-2); }
.subject__prog {
  flex: 1;
  min-width: 80px;
  max-width: 140px;
  height: 8px;
  background: var(--paper-3);
  border: 2px solid rgba(46, 42, 34, .55);
  overflow: hidden;
}
.subject__prog > i { display: block; height: 100%; background: var(--green); }
.subject__prog > u { display: block; height: 100%; background: var(--green); }

.gpa-foot {
  margin-top: 22px;
  background: var(--paper-2);
  border: var(--bd);
  box-shadow: var(--sh-s);
  padding: 12px 14px;
}
.gpa-foot__title { font-size: 12px; color: var(--ink-2); }
.gpa-foot__main { font-size: 12px; margin-top: 2px; }
.gpa-foot__main b { font-size: 24px; color: var(--red); margin: 0 2px; }

.scale {
  margin-top: 14px;
  border-top: 3px dashed rgba(46, 42, 34, .2);
  padding-top: 10px;
}
.scale__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid rgba(46, 42, 34, .7);
  background: #fff;
  padding: 4px 9px 5px;
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .35);
}
.scale__toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  margin-top: -4px;
}
.scale__toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
  margin-top: 3px;
}
.scale__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}
.scale__cell {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  background: #fff;
  border: 2px solid rgba(46, 42, 34, .7);
  padding: 0 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.scale__cell b { color: var(--ink); font-weight: 400; }
.scale[hidden] { display: none; }

/* ============================================================
   页脚草地
   ============================================================ */
.footer {
  margin-top: 26px;
  position: relative;
}
.footer__grass { display: block; width: 100%; height: 26px; }
.footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
  padding: 6px 2px 0;
  flex-wrap: wrap;
}

/* ============================================================
   底部 dock
   ============================================================ */
.dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 460px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border: var(--bd);
  box-shadow: var(--sh);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.dock__btn {
  border: 0;
  border-right: 2px dashed rgba(46, 42, 34, .2);
  background: transparent;
  padding: 7px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
  position: relative;
}
.dock__btn:last-child { border-right: 0; }
.dock__btn svg { width: 18px; height: 18px; display: block; }
.dock__btn:hover { background: var(--paper-2); }
.dock__btn.is-active { background: var(--sun); color: var(--ink); }
.dock__btn.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ink);
}
.dock__btn.is-active svg { transform: translateY(-1px); }

/* ============================================================
   keira 浮动小人
   ============================================================ */
.mascot {
  position: fixed;
  right: max(14px, calc((100vw - var(--maxw)) / 2 - 82px));
  bottom: calc(var(--dock-h) + 26px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mascot__btn {
  border: 0;
  background: none;
  padding: 0;
  display: block;
  filter: drop-shadow(3px 4px 0 rgba(46, 42, 34, .28));
}
.mascot__svg {
  display: block;
  width: 48px;
  height: 96px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
  animation: bob 3.2s steps(2, end) infinite;
}
.mascot__switch {
  display: flex;
  gap: 3px;
  background: var(--paper);
  border: var(--bd-2);
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .55);
  padding: 4px;
}
.mascot__opt {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  opacity: .42;
  transition: opacity .12s steps(2), transform .12s steps(2);
}
.mascot__opt svg {
  display: block;
  width: 16px;
  height: 32px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}
.mascot__opt:hover { opacity: .8; }
.mascot__opt.is-active {
  opacity: 1;
  background: var(--sun-3);
  outline: 2px solid var(--sun-2);
  transform: translateY(-2px);
}
.mascot__hint {
  font-size: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .55);
  padding: 0 6px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .12s steps(2), transform .12s steps(2);
  pointer-events: none;
  white-space: nowrap;
}
.mascot:hover .mascot__hint { opacity: 1; transform: translateY(0); }

.eye { animation: blink 5.6s steps(1, end) infinite; }.eye-closed { display: none; }
.blink .eye { display: none; }
.blink .eye-closed { display: block; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes blink {
  0%, 92%, 100% { opacity: 1; }
  94%, 97% { opacity: 0; }
}

/* ============================================================
   聊天气泡
   ============================================================ */
.chat {
  position: fixed;
  right: max(14px, calc((100vw - var(--maxw)) / 2 - 82px));
  bottom: calc(var(--dock-h) + 34px);
  width: 384px;
  max-width: calc(100vw - 28px);
  z-index: 60;
  background: var(--paper);
  border: var(--bd);
  box-shadow: 8px 8px 0 rgba(46, 42, 34, .9);
  display: flex;
  flex-direction: column;
  max-height: min(560px, calc(100vh - 160px));
  animation: pop .1s steps(2, end);
}
.chat[hidden] { display: none; }
@keyframes pop {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border-bottom: var(--bd);
  background: var(--paper-2);
  flex: 0 0 auto;
}
.chat__avatar { width: 20px; height: 40px; display: block; flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer; image-rendering: pixelated; }
.chat__avatar svg { width: 20px; height: 40px; display: block; image-rendering: pixelated; }
.chat__avatar:hover { filter: brightness(1.08); }
.chat__avatar,
.mascot__svg { shape-rendering: crispEdges; }
.chat__who { flex: 1; min-width: 0; line-height: 1.4; }
.chat__who b { font-size: 12px; font-weight: 400; display: block; }
.chat__who span { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.chat__who span::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--green);
  border: 1px solid var(--ink);
}
.chat__close {
  border: var(--bd-2);
  background: #fff;
  width: 22px;
  height: 22px;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .5);
}
.chat__close svg { width: 10px; height: 10px; display: block; }
.chat__close:active { transform: translate(2px, 2px); box-shadow: none; }

.chat__body {
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1 1 auto;
  min-height: 120px;
  background:
    linear-gradient(rgba(46, 42, 34, .035) 1px, transparent 1px) 0 0 / 100% 6px;
}
.msg {
  max-width: 84%;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.75;
  border: var(--bd-2);
  box-shadow: 2px 2px 0 rgba(46, 42, 34, .45);
  position: relative;
}
.msg--keira { background: #fff; align-self: flex-start; }
.msg--me { background: var(--sun-3); align-self: flex-end; box-shadow: 2px 2px 0 rgba(46, 42, 34, .55); }
.msg__typing { color: var(--ink-3); }

.chat__quick {
  display: flex;
  gap: 5px;
  padding: 0 10px 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.chat__chip {
  border: 2px solid rgba(46, 42, 34, .75);
  background: #fff;
  padding: 1px 7px;
  font-size: 12px;
  color: var(--ink-2);
}
.chat__chip:hover { background: var(--sun-3); color: var(--ink); }

.chat__form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: var(--bd);
  background: var(--paper-2);
  flex: 0 0 auto;
}
.chat__input {
  flex: 1;
  min-width: 0;
  border: var(--bd-2);
  background: #fff;
  padding: 5px 8px;
}
.chat__input::placeholder { color: var(--ink-3); }
.chat__send {
  border: var(--bd-2);
  background: var(--green);
  color: #fff;
  padding: 5px 10px;
  box-shadow: 2px 2px 0 var(--ink);
  flex: 0 0 auto;
}
.chat__send:active { transform: translate(2px, 2px); box-shadow: none; }

/* ============================================================
   响应式
   ============================================================ */
/* 窗口不够宽时收起浮动小人，避免压住内容（聊天仍可从左上角 / 气泡进入） */
@media (max-width: 1199px) {
  .mascot { display: none; }
}

@media (max-width: 980px) {
  .cols { grid-template-columns: 1fr; gap: 18px; }
  .subjects { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --dock-h: 62px; }

  .app { padding: 12px 12px calc(var(--dock-h) + 40px); }

  .scene__cloud--a { width: 62px; top: 84px; left: auto; right: -12px; }
  .scene__cloud--b { display: none; }
  .scene__cloud--c { display: none; }

  .brand { font-size: 24px; gap: 7px; }
  .brand__mark { width: 16px; height: 16px; }
  .brand__mark::after { left: 3px; top: 3px; width: 6px; height: 6px; }
  .topbar { padding-bottom: 12px; }

  .hero__sky { height: 44px; }
  .hero__sun { width: 30px; height: 30px; right: 16px; top: 6px; }
  .hero__cloud--a { width: 38px; left: 16px; top: 11px; }
  .hero__cloud--b { width: 24px; left: auto; right: 78px; top: 6px; }
  .hero__cloud--c { display: none; }

  .hero__body { padding: 14px 12px 12px; }
  .hero__title { font-size: 24px; letter-spacing: 0; }

  /* 手机端：问候语独占一行，倒计时牌通栏铺开，避免标题被挤成两行 */
  .hero__top { flex-direction: column; align-items: stretch; gap: 12px; }
  .goal:last-child { grid-column: 1 / -1; }
  .scale__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .count { width: 100%; min-width: 0; padding: 8px 10px 9px; }
  .count__num { font-size: 36px; }
  .count__name { max-width: none; }
  .count__date { font-size: 12px; }

  .goals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .goal:nth-child(5) { grid-column: span 2; }
  .goal { padding: 5px 7px 6px; }

  .bubble { padding: 8px 26px 8px 8px; margin-top: 12px; }
  .bubble__avatar { width: 28px; height: 35px; }

  .card { padding: 12px 12px; box-shadow: 5px 5px 0 var(--ink); }
  .card__head h2 { font-size: 24px; }
  .cols { margin-top: 18px; }
  .gpa-strip { margin-top: 18px; gap: 10px; }
  .gpa-strip__num { font-size: 36px; }
  .gpa-strip__sep { height: 30px; }
  .gpa-strip__bar { min-width: 100%; order: 3; }
  .gpa-strip__note { order: 4; width: 100%; }

  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 24px; }
  .page-head__right { width: 100%; }

  .addbar__input { flex: 1 1 100%; }
  .addbar__time { width: auto; flex: 1 1 auto; min-width: 0; }
  .addbar .btn { width: auto; flex: 0 0 auto; justify-content: center; }
  .addbar { gap: 6px; }

  .ddl-group__head h2 { font-size: 24px; }
  .thing { padding: 8px 10px; }
  .thing__right { font-size: 12px; }

  .event { gap: 9px; padding: 8px 10px; }
  .event__time { width: 54px; }
  .event__cd { white-space: nowrap; }

  .gpa-hero { gap: 10px; }
  .gpa-hero__num { font-size: 36px; }
  .gpa-hero__mid { min-width: 100%; order: 3; }
  .gpa-hero__sep { display: none; }

  .subject { padding: 10px 12px; }
  .subject__name { font-size: 24px; }
  .subject__need b { font-size: 24px; }

  .mascot { display: none; }

  .chat {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    bottom: calc(var(--dock-h) + 18px);
    max-height: calc(100vh - 170px);
    box-shadow: 5px 5px 0 rgba(46, 42, 34, .9);
  }

  .footer__meta { font-size: 12px; }
}

@media (max-width: 380px) {
  .hero__title { font-size: 24px; }
  .count__num { font-size: 24px; }
  .dock__btn { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot__svg, .eye { animation: none !important; }
  .chat { animation: none !important; }
}

/* 打印 / 截图时隐藏交互层 */
@media print {
  .dock, .mascot, .chat { display: none !important; }
}
