/* 白杨礼赞 · AI 课堂工具（希沃一体机大屏触控）
   配色取自廖老师课件：高原暖黄天空、落日橙、深色剪影；一读赭黄、二读墨绿。 */
:root {
  --paper: #fbf4e2;
  --paper-2: #f6e9c8;
  --card: #fffdf7;
  --ink: #2b2118;
  --ink-2: #5b4a3a;
  --ink-3: #8c7a66;
  --line: #e6d5b0;
  --sun: #f2a33a;
  --sun-deep: #e07a2e;
  --sky: #fde36a;
  --ochre: #c8892b; /* 一读 */
  --pine: #2f5d50; /* 二读 */
  --pine-soft: #e3eee9;
  --red: #b3392b;
  --red-soft: #f8e1dc;
  --shadow: 0 0.3rem 1.2rem rgba(120, 80, 20, 0.12);
  --radius: 1.1rem;
  --kai: 'KaiTi', 'STKaiti', '楷体', 'Kaiti SC', serif;
  --song: 'STZhongsong', 'Songti SC', 'SimSun', serif;
  --sans: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  font-size: clamp(13px, 1.04vw, 24px);
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  user-select: none;
}

/* —— 顶栏：高原天空渐变 + 落日 */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  height: 4.6rem;
  padding: 0 1.6rem;
  background: linear-gradient(180deg, #fde779 0%, #f9cd68 100%);
  border-bottom: 0.18rem solid var(--ink);
  overflow: hidden;
}
.topbar::after {
  content: '';
  position: absolute;
  right: 9rem;
  bottom: -2.4rem;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: radial-gradient(circle, #f9a24d 0%, #f0743b 70%);
  opacity: 0.55;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--song);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  z-index: 1;
}
.brand svg {
  width: 2.2rem;
  height: 2.6rem;
}
.brand small {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  padding: 0.15rem 0.6rem;
  border: 1px solid rgba(43, 33, 24, 0.35);
  border-radius: 999px;
}
.topbar .spacer {
  flex: 1;
}
.icon-btn {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.8rem;
  padding: 0 1rem;
  border: 0.12rem solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.75);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.icon-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}
.icon-btn:active {
  transform: scale(0.96);
}

/* —— 通用按钮：大、圆、好点 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 4rem;
  padding: 0 1.8rem;
  border: 0.14rem solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 0.25rem 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, background 0.2s;
  white-space: nowrap;
}
.btn svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}
.btn:active:not(:disabled) {
  transform: translateY(0.2rem);
  box-shadow: 0 0.05rem 0 var(--ink);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn.primary {
  background: var(--sun);
}
.btn.pine {
  background: var(--pine);
  color: #fff;
}
.btn.rec {
  background: var(--red);
  color: #fff;
}
.btn.ghost {
  box-shadow: none;
  border-color: var(--line);
  background: transparent;
  font-weight: 400;
  min-height: 3.2rem;
  font-size: 1.1rem;
}
.btn.small {
  min-height: 3rem;
  font-size: 1.05rem;
  padding: 0 1.2rem;
}

.card {
  background: var(--card);
  border: 0.12rem solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--paper-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag.ai {
  background: #efe6ff;
  color: #5a3d9a;
}
.tag.offline {
  background: var(--red-soft);
  color: var(--red);
}

/* —— 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 1rem);
  max-width: 80vw;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 1.15rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* —— 加载中 */
.busy {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(251, 244, 226, 0.88);
  border-radius: inherit;
  z-index: 5;
  font-size: 1.3rem;
  color: var(--ink-2);
}
.busy.show {
  display: flex;
}
.spinner {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: 0.35rem solid var(--paper-2);
  border-top-color: var(--sun-deep);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 话筒音量条 */
.level {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.2rem;
  height: 2rem;
}
.level i {
  width: 0.35rem;
  height: 20%;
  border-radius: 0.2rem;
  background: currentColor;
  transition: height 0.08s;
}

@media (max-width: 900px) {
  html {
    font-size: 13px;
  }
  body {
    overflow: auto;
  }
}
