* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F9F5EC;
  color: #3D2B1F;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 8px 32px rgba(61, 43, 31, 0.1);
  text-align: center;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
}

.login-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E5DCC8;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
}

.login-box input:focus { border-color: #8B5E3C; }

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: #C0392B;
  min-height: 18px;
}

/* ---------- 布局：侧边栏 + 内容区 ---------- */
.main-view {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-title {
  padding: 22px 20px 18px;
  font-size: 17px;
  font-weight: 700;
  color: #3D2B1F;
  border-bottom: 1px solid #F4EBD0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  border: none;
  background: none;
  text-align: left;
  padding: 11px 16px;
  font-size: 14px;
  color: #777;
  cursor: pointer;
  border-radius: 8px;
}

.nav-item:hover { background: #F9F5EC; color: #3D2B1F; }

.nav-item.active {
  background: #F4EBD0;
  color: #8B5E3C;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #F4EBD0;
}

.content {
  flex: 1;
  min-width: 0;
}

/* ---------- 顶栏（内容区标题） ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
}

.topbar-title { font-size: 20px; font-weight: 700; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.api-hint { font-size: 13px; color: #999; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #3D2B1F;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ---------- 面板 ---------- */
.panel { padding: 24px 32px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 { font-size: 17px; }

.table {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border-collapse: collapse;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #F4EBD0;
}

.table th { background: #F9F5EC; font-weight: 600; color: #8B5E3C; }
.table tr:last-child td { border-bottom: none; }

/* ---------- 编辑器 ---------- */
.editor {
  margin-top: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.editor h3 { font-size: 15px; margin-bottom: 16px; }

/* 古文库：编辑态隐藏列表视图，编辑器独占面板 */
#guwenPanel.editing #guwenListView { display: none; }
#guwenPanel.editing .editor { margin-top: 0; }

/* 古文编辑器：大编辑框，便于编辑与审查 */
#guwenEditor textarea {
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
}
#guwenEditor .full textarea { min-height: 180px; }

/* 长难句编辑器：大编辑框，便于编辑与审查 */
#nanjuEditor textarea {
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
}
#nanjuEditor .full textarea { min-height: 140px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #777;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid input, .form-grid textarea, .form-grid select {
  padding: 10px 12px;
  border: 1px solid #E5DCC8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-grid input:focus, .form-grid textarea:focus { border-color: #8B5E3C; }

/* 课程详情：插入图片工具条 */
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

/* ---------- wangEditor 富文本（推荐阅读正文） ---------- */
.wang-label {
  font-size: 13px;
  color: #777;
  margin: 6px 0;
}

.wang-toolbar {
  border: 1px solid #E5DCC8;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  position: relative;
  z-index: 20;
}

.wang-editor-box {
  border: 1px solid #E5DCC8;
  border-radius: 0 0 8px 8px;
  height: 420px;
  background: #fff;
  overflow-y: auto;
  margin-bottom: 16px;
}

.ep-src-input { width: 260px; }
.ep-title-input { width: 180px; }
.ep-duration-input { width: 70px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid #E5DCC8;
  background: #fff;
  color: #3D2B1F;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover { background: #F9F5EC; }

.btn.primary {
  background: #8B5E3C;
  border-color: #8B5E3C;
  color: #fff;
}

.btn.primary:hover { background: #7A5133; }

.btn.danger { color: #C0392B; border-color: #F0D5D2; }
.btn.danger:hover { background: #FDF3F2; }

.btn.ghost { background: none; border-color: transparent; color: #999; }
.btn.ghost:hover { color: #3D2B1F; }

.btn.block { width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

.status-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 6px;
  background: #F4EBD0;
  color: #8B5E3C;
}

.status-tag.done { background: #E5F0E8; color: #4A7C59; }



/* 每日一句 */
.cover-thumb {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.no-cover { font-size: 12px; color: #bbb; }

.cover-preview {
  width: 240px;
  height: 135px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #E5DCC8;
}

/* 封面点击上传 */
.cover-upload {
  margin-bottom: 16px;
}

.cover-upload-label {
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}

.cover-upload-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cover-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.text-orig { max-width: 220px; font-weight: 600; }
.text-trans { max-width: 220px; color: #777; }

/* 用户与订阅 */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F4EBD0;
  color: #8B5E3C;
  font-size: 14px;
}

.user-openid {
  font-size: 12px;
  color: #999;
}

.order-no {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

/* 兑换码 */
.redeem-code {
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #8B5E3C;
  background: #F9F5EC;
  padding: 2px 8px;
  border-radius: 6px;
}

/* 钱包 */
.wallet-balance {
  font-family: Georgia, serif;
  font-weight: 600;
  color: #A0522D;
}

.amount-in { color: #4A7C59; font-weight: 600; }

.amount-out { color: #C0392B; font-weight: 600; }

/* 语法问答 */
.qa-answer-cell {
  max-width: 320px;
  color: #777;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 回答管理 */
.qa-answer-item {
  border: 1px solid #F4EBD0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
  background: #FDFAF3;
}

.qa-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qa-answer-content {
  margin-top: 10px;
  font-size: 14px;
  color: #3D2B1F;
  line-height: 1.7;
  word-break: break-all;
}

.qa-replies {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 3px solid #E5DCC8;
}

.qa-reply-item {
  padding: 8px 0;
}

.qa-reply-item + .qa-reply-item {
  border-top: 1px dashed #F4EBD0;
}

.qa-reply-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- 订阅标签删除按钮 ---------- */
.sub-remove {
  display: inline-block;
  margin-left: 6px;
  padding: 0 4px;
  font-size: 12px;
  color: #C0392B;
  cursor: pointer;
  line-height: 1;
}

.sub-remove:hover {
  color: #922B21;
  font-weight: 700;
}

/* ---------- 文采训练：免费开关 ---------- */
.wc-free-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #6E5A36;
  cursor: pointer;
}

.wc-free-row input {
  width: 18px;
  height: 18px;
  accent-color: #8B5E3C;
  cursor: pointer;
}

/* ---------- 文采训练：条目卡片（每字段独占一行） ---------- */
.wc-item-card {
  background: #fff;
  border: 1px solid #E5DCC8;
  border-radius: 10px;
  padding: 12px 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(61, 43, 31, 0.04);
}

.wc-item-card:hover {
  border-color: #D9C9A3;
}

.wc-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #E5DCC8;
}

.wc-item-no {
  font-size: 14px;
  font-weight: 700;
  color: #8B5E3C;
  letter-spacing: 1px;
}

.wc-item-ops {
  display: flex;
  gap: 6px;
}

.wc-field {
  margin-bottom: 12px;
}

.wc-field:last-child {
  margin-bottom: 0;
}

.wc-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #9A8C6F;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.wc-field input,
.wc-field textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #E5DCC8;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  font-family: inherit;
  color: #3D2B1F;
  background: #FDFAF3;
  resize: vertical;
  outline: none;
}

.wc-field input:focus,
.wc-field textarea:focus {
  border-color: #8B5E3C;
  background: #fff;
}

.wc-empty-tip {
  text-align: center;
  font-size: 13px;
  color: #B5A98D;
  padding: 18px 0;
}

/* ---------- 鏁欐潗鍒哥紪杈戝櫒 ---------- */
.coupon-goods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.coupon-goods-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #E5DCC8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.coupon-goods-check input[type="checkbox"] {
  accent-color: #B03A2E;
}

.coupon-goods-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
