/* ============================================================
   留言墙样式
   学生端：沿用原始「朋友圈」卡片风格
   教师端：深色大屏风格
   注意：为了兼容平板上较老的浏览器内核，没有使用 flex gap 属性，
        间距统一用 margin 控制。
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  font-family: "Microsoft Yahei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

body {
  background: #efefef;
  color: #222;
  padding: 12px 12px 60px;
  max-width: 720px;
  margin: 0 auto;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------------------------------------------------------- 顶部栏 */
.topbar {
  text-align: center;
  padding: 6px 0 14px;
}

.topbar h1 {
  font-size: 22px;
  font-weight: bold;
  color: #1b1b1b;
}

.identity-bar {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: #444;
}

.identity-bar .who {
  font-weight: bold;
  color: #2574ed;
}

.identity-bar .tip {
  color: #888;
}

/* ---------------------------------------------------------- 老师卡片 */
.moment-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
}

.moment-card.is-locked {
  opacity: 0.62;
}

.moment-card.is-chosen {
  box-shadow: 0 0 0 2px #2574ed;
}

.moment-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.teacher-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.teacher-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: normal;
  color: #2574ed;
  background: #eaf1fe;
  border-radius: 12px;
  padding: 3px 10px;
}

.moment-desc {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 14px;
  color: #555;
}

.moment-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
  display: block;
  background: #f0f0f0;
}

/* ---------------------------------------------------------- 卡片内留言列表 */
.comment-list {
  background: #f7f8fa;
  border-radius: 12px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.comment-list.is-empty {
  display: none;
}

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid #ececec;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item .c-name {
  color: #2574ed;
  font-weight: bold;
}

.comment-item .c-text {
  color: #333;
}

.comment-item .c-time {
  display: block;
  font-size: 12px;
  color: #a5a5a5;
  margin-top: 2px;
}

.comment-item .c-mine {
  color: #f0803c;
  font-size: 12px;
  margin-left: 6px;
}

.comment-item.is-mine {
  background: #fff7ef;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

@keyframes flashIn {
  0% {
    background: #fff2c9;
  }
  100% {
    background: transparent;
  }
}

.comment-item.is-new {
  animation: flashIn 2.2s ease-out;
}

.comment-empty {
  font-size: 14px;
  color: #b0b0b0;
  padding: 10px 0;
}

/* ---------------------------------------------------------- 输入区 */
.comment-bar {
  display: flex;
  align-items: center;
  padding-top: 8px;
}

.msgInput {
  flex: 1;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  background: #f7f7f7;
  margin-right: 10px;
  min-width: 0;
  font-family: inherit;
  color: #222;
}

.msgInput:focus {
  outline: none;
  border-color: #2574ed;
  background: #fff;
}

.msgInput:disabled {
  color: #aaa;
}

.sendBtn {
  padding: 11px 20px;
  background: #2574ed;
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 16px;
  white-space: nowrap;
}

.sendBtn:disabled {
  background: #c8d3e3;
  cursor: default;
}

.choose-row {
  display: flex;
  align-items: center;
  padding-top: 6px;
}

.chooseBtn {
  padding: 10px 18px;
  background: #fff;
  color: #2574ed;
  border: 1px solid #2574ed;
  border-radius: 22px;
  font-size: 15px;
}

.chooseBtn:disabled {
  border-color: #d5d5d5;
  color: #b5b5b5;
  cursor: default;
}

.lock-hint {
  font-size: 14px;
  color: #999;
  padding-top: 8px;
}

.my-actions {
  display: flex;
  padding-top: 8px;
}

.my-actions button {
  padding: 9px 18px;
  font-size: 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  margin-right: 10px;
}

.my-actions button.edit {
  border-color: #2574ed;
  color: #2574ed;
}

.my-actions button.danger {
  border-color: #e57373;
  color: #e57373;
}

/* ---------------------------------------------------------- 姓名弹层 */
.modal-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-mask[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.modal h2 {
  font-size: 19px;
  margin-bottom: 8px;
}

.modal p.sub {
  font-size: 14px;
  color: #888;
  margin-bottom: 18px;
  line-height: 1.6;
}

.modal input {
  width: 100%;
  padding: 13px 14px;
  font-size: 17px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
  font-family: inherit;
}

.modal input:focus {
  outline: none;
  border-color: #2574ed;
  background: #fff;
}

.modal .err {
  color: #e05252;
  font-size: 14px;
  min-height: 20px;
  margin-top: 8px;
}

.modal .btn {
  width: 100%;
  padding: 13px;
  font-size: 17px;
  border: none;
  border-radius: 24px;
  background: #2574ed;
  color: #fff;
  margin-top: 6px;
}

.modal .btn:disabled {
  background: #b9c8e0;
}

/* ---------------------------------------------------------- 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 22px;
  max-width: 86%;
  text-align: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.toast.show {
  opacity: 1;
}

.toast.error {
  background: rgba(200, 60, 60, 0.94);
}

.page-foot {
  text-align: center;
  font-size: 13px;
  color: #a0a0a0;
  padding: 10px 0 20px;
  line-height: 1.8;
}

/* ----------------------------------------------------------
   教师端在共用样式上多出来的两个小东西：
   空列表也要显示占位文字，每条留言右侧多一个删除按钮。
   卡片和留言本身的样式仍然是上面这套，两端完全一致。
   ---------------------------------------------------------- */
.comment-list.is-empty.show-empty {
  display: block;
}

.comment-item.is-managed {
  position: relative;
  padding-right: 62px;
}

.c-del {
  position: absolute;
  right: 0;
  bottom: 9px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.7;
  color: #c0504d;
  background: #fff;
  border: 1px solid #e8b4b0;
  border-radius: 12px;
  font-family: inherit;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}

.comment-item:hover .c-del {
  opacity: 1;
  background: #fdf2f1;
}

.c-del:active {
  background: #f8e2e0;
}
