/* 学生端（移动优先） */
/* 提示条抬到输入框上方，避免遮住正在编辑的文字 */
.stu-body .toast-wrap { bottom: calc(112px + env(safe-area-inset-bottom)); }

.stu-body {
  background: var(--light-bg);
  color: var(--light-text);
  height: 100dvh;
  overflow: hidden;
}

/* ============ 身份卡 ============ */
.gate {
  position: fixed;
  inset: 0;
  background: var(--light-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px 12vh;
  z-index: 40;
}
.gate.hide { display: none; }
.gate .g-brand {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
.gate h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.gate .g-sub {
  margin: 0 0 32px;
  font-size: 14px;
  color: var(--light-dim);
  line-height: 1.6;
}
.gate .g-label {
  font-size: 12.5px;
  color: var(--light-dim);
  margin-bottom: 8px;
}
.gate input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-size: 17px;
  color: var(--light-text);
  background: #F7F8FA;
  border: 1px solid var(--light-line);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.gate input:focus { border-color: var(--accent); background: #fff; }
.gate input::placeholder { color: #A8B0BA; }
.gate .g-err {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12.5px;
  color: #DC2626;
}
.gate .g-btn {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
}
.gate .g-btn:disabled { opacity: .4; }
.gate .g-btn:active { background: var(--accent-press); }
.gate .g-foot {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-size: 11.5px;
  color: #B3BAC3;
}

/* ============ 主界面 ============ */
.stu-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.stu-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--light-line);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
}
.stu-top .t-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stu-top .t-name span { color: var(--light-dim); font-weight: 400; font-size: 12px; margin-left: 6px; }
.who-chip {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 55%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--light-line);
  border-radius: 999px;
  background: #F7F8FA;
  font-size: 12.5px;
  color: #3D4650;
  cursor: pointer;
}
.who-chip:active { background: #EFF1F4; }
.who-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-chip svg { width: 12px; height: 12px; color: #9AA3AE; flex: none; }

/* 已发言预览 */
.feed {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #B3BAC3;
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
  padding: 0 32px;
}
.feed-empty svg { width: 34px; height: 34px; color: #D3D8DE; }
.mine {
  align-self: flex-end;
  max-width: 86%;
  background: #F3F6FC;
  border: 1px solid #E4EBF7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #25303B;
  white-space: pre-wrap;
  word-break: break-word;
  animation: mine-in .2s ease-out;
}
.mine img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.mine .m-meta {
  margin-top: 6px;
  font-size: 10.5px;
  color: #97A1AC;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@keyframes mine-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 输入区 */
.composer {
  flex: none;
  border-top: 1px solid var(--light-line);
  background: #fff;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.cmp-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.img-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--light-line);
  background: #F7F8FA;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #6B7280;
}
.img-btn:active { background: #EFF1F4; }
.img-btn svg { width: 19px; height: 19px; }

.stu-input {
  flex: 1;
  min-height: 40px;
  max-height: 132px;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--light-text);
  background: #F7F8FA;
  border: 1px solid var(--light-line);
  border-radius: 6px;
  outline: none;
  resize: none;
  overflow-y: auto;
  transition: border-color .15s ease, background .15s ease;
}
.stu-input:focus { border-color: var(--accent); background: #fff; }
.stu-input::placeholder { color: #A8B0BA; }

.send-btn {
  flex: none;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
  font-variant-numeric: tabular-nums;
}
.send-btn[disabled] { opacity: .35; }
.send-btn:active:not([disabled]) { background: var(--accent-press); }

.cmp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 0;
  height: 18px;
}
.count { font-size: 11px; color: #B3BAC3; font-variant-numeric: tabular-nums; }
.count.warn { color: #DC2626; }
.tip-line { font-size: 11px; color: #B3BAC3; }

/* 图片预览条 */
.preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--light-line);
  border-radius: 8px;
  background: #FAFBFC;
}
.preview.show { display: flex; }
.preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; }
.preview .p-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--light-dim); }
.preview .p-meta b { display: block; font-size: 13px; color: var(--light-text); font-weight: 500; margin-bottom: 2px; }
.preview .p-del {
  flex: none;
  width: 28px; height: 28px;
  border: 0; border-radius: 4px;
  background: transparent;
  color: #9AA3AE;
  font-size: 16px;
  cursor: pointer;
}
.preview .p-del:hover { color: #DC2626; }

/* 编辑身份弹层 */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, .4);
  z-index: 50;
  display: none;
  align-items: flex-end;
}
.sheet.open { display: flex; }
.sheet-inner {
  width: 100%;
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up .22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-inner h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.sheet-inner p { margin: 0 0 16px; font-size: 12.5px; color: var(--light-dim); }
.sheet-inner input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 16px;
  background: #F7F8FA;
  border: 1px solid var(--light-line);
  border-radius: 6px;
  outline: none;
  color: var(--light-text);
}
.sheet-inner input:focus { border-color: var(--accent); background: #fff; }
.sheet-act { display: flex; gap: 8px; margin-top: 16px; }
.sheet-act button {
  flex: 1;
  height: 46px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--light-line);
  background: #fff;
  color: #3D4650;
}
.sheet-act button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
