/* 界面精修（10-29，参照开源检查表 elayadesign/redesign-skill）：配色不变，只补手感和细节。
   放在 teacher-ui.css / student-ui.css 之后加载，老师端、学生端、错题本共用。 */
:root { --ease: cubic-bezier(.22, 1, .36, 1); }

/* 过渡：0.2 秒柔和缓动，不用匀速；按下时下沉 1px（用 translate 属性，不覆盖元素原有的 transform） */
.ghost, .primary, .stop-button, .tone, .attach-label, .home-link, .lesson-item, .side-tool, .classroom-entry, .home-thread-row,
.t-links a, .t-user button, .th-tabs button, .th-box li a, .login-roles button, .tv-image, .tv-file, .chip, .ad-lessons li a {
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease), translate .1s var(--ease);
}
:is(button, .ghost, .primary, .home-link, .side-tool, .attach-label, .classroom-entry, .tv-file):not(:disabled):active { translate: 0 1px; }
button:disabled, .primary:disabled, .ghost:disabled { cursor: default; }

/* 键盘焦点：金色描边，在白底和深蓝底上都看得清；鼠标点击不出现 */
:is(a, button, summary, [tabindex], label.tv-image, label.tv-file):focus-visible { outline: 2px solid #c99a3e; outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(23, 50, 94, .25); outline-offset: 0; }
.t-links a:focus-visible { outline-offset: -4px; }

/* 阴影统一带一点深蓝、光从上方来 */
.teacher-head, .wr-section, .wr-tile, .teacher-item, .teacher-empty, .tv-job, .th-tool, .th-box, .th-stat { box-shadow: 0 1px 2px rgba(23, 50, 94, .05); }
.th-stat, .th-box { transition: box-shadow .3s var(--ease), border-color .3s var(--ease); }
.th-box:hover { box-shadow: 0 4px 12px rgba(23, 50, 94, .07); }

/* 数字等宽对齐 */
.th-stat strong, .th-count, .wr-tile strong, .wr-bar-track, .wr-chips b, .tv-pill, .th-box li small, .num, td, .wr-asks i { font-variant-numeric: tabular-nums; }

/* 标题不让最后一行只剩一个字 */
h1, h2, h3, .home-empty h3, .login-box h1 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* 加载占位：和内容形状一样的浅色块，轻轻呼吸，不用转圈 */
.ui-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui-skel, .th-skel { position: relative; overflow: hidden; border-radius: 8px; background: #ece7dc; animation: ui-breathe 1.6s var(--ease) infinite alternate; }
.ui-skel-page { display: grid; gap: 16px; }
.ui-skel-title { width: 240px; max-width: 60%; height: 32px; }
.ui-skel-card { height: 160px; background: #f0ece3; }
.ui-skel-card.short { height: 96px; }
.th-box li.th-skel { height: 16px; margin: 12px 0; border: 0; border-radius: 4px; }
.th-box li.th-skel:nth-child(2) { width: 82%; }
.th-box li.th-skel:nth-child(3) { width: 64%; }
@keyframes ui-breathe { from { opacity: 1; } to { opacity: .45; } }

/* 空状态：居中、正文颜色，有下一步就给一个按钮 */
.teacher-empty, .th-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--ink-soft); }
.teacher-empty { padding: 48px 16px; font-size: 16px; }
.teacher-empty::before, .th-empty::before { content: ""; width: 40px; height: 40px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none'%3E%3Crect x='7' y='5' width='26' height='30' rx='4' stroke='%2317325e' stroke-width='2'/%3E%3Cpath d='M13 14h14M13 20h14M13 26h8' stroke='%23c99a3e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); opacity: .9; }
.th-empty { padding: 24px 0 16px; }
.th-empty::before { width: 32px; height: 32px; }
.th-empty .ghost { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; font-size: 14px; text-decoration: none; }
.tv-list + .wr-muted, .wr-section > p.wr-muted:only-of-type { color: var(--ink-soft); }

/* 状态胶囊、转圈统一成深蓝 */
.tv-spin { border-color: #c7d0de; border-top-color: #17325e; }
.tv-pill.running { background: #edf0f5; color: #17325e; }

/* 正文行长不超过约 40 个汉字，读起来不累 */
.wr-note, .wr-insight p, .jy-lecture p, .teacher-item p, .login-hint { max-width: 42em; }

/* 手机地址栏：整屏高度扣掉地址栏 */
@supports (height: 100dvh) {
  html #app .login-page { min-height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-skel, .th-skel { animation: none; }
  * { transition-duration: .01ms !important; }
}
