/* === 全局 === */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F5F6FA; color: #1F2329;
}
button { font-family: inherit; cursor: pointer; outline: none; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }
a { color: #4F7CFF; text-decoration: none; }
.hidden { display: none !important; }

/* === Header === */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: #4F7CFF; color: #fff;
  box-shadow: 0 2px 6px rgba(79, 124, 255, 0.2);
}
.app-header .title { font-size: 18px; font-weight: bold; }
.role-area { display: flex; align-items: center; gap: 8px; }
.role-badge {
  font-size: 12px; padding: 3px 9px; border-radius: 12px;
  background: rgba(255,255,255,0.2);
}
.role-badge.counselor { background: #FFD666; color: #874D00; }
.role-switch {
  font-size: 12px; color: #fff;
  padding: 3px 9px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  border: 0.5px solid rgba(255,255,255,0.4);
}

/* === 通用 === */
main { padding: 0 0 20px; }
/* 桌面端：内容收窄居中，顶栏通栏但内容与中间区域对齐 */
@media (min-width: 768px) {
  main { max-width: 640px; margin: 0 auto; padding: 0 16px 20px; box-sizing: border-box; }
  .app-header { padding-left: calc((100% - 640px) / 2 + 16px); padding-right: calc((100% - 640px) / 2 + 16px); }
  .section-card, .sign-card { margin-left: 0; margin-right: 0; }
  .counselor-bar { margin-left: 0; margin-right: 0; }
}
.section-card {
  background: #fff; margin: 12px 12px 0; border-radius: 8px; padding: 14px;
}
.section-title { font-size: 15px; font-weight: bold; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.empty {
  text-align: center; color: #bbb; padding: 60px 0; font-size: 14px;
}
.empty-icon { font-size: 40px; display: block; margin-bottom: 8px; opacity: 0.4; }

/* 学生首页：按钮与提示整体居中于可视区 */
.student-home {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 0 12px;
}
.student-home .apply-entry { width: 100%; max-width: 480px; margin: 0; }
.student-home .empty { padding: 28px 0 0; }

.btn-primary {
  background: #4F7CFF; color: #fff; padding: 12px 0; border-radius: 24px;
  font-size: 16px; font-weight: bold; width: 100%; display: block; text-align: center;
}
.apply-entry { margin: 12px 12px 0; width: calc(100% - 24px); box-sizing: border-box; }
.btn-ghost {
  background: #fff; color: #4F7CFF; padding: 12px 0; border-radius: 24px;
  font-size: 16px; width: 100%; display: block; text-align: center;
  border: 1px solid #4F7CFF;
}
.btn-danger {
  background: #fff; color: #F56C6C; padding: 12px 0; border-radius: 24px;
  font-size: 16px; width: 100%; display: block; text-align: center;
  border: 1px solid #F56C6C;
}
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

/* === 状态标签 === */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 3px; font-weight: 500;
}
.tag-pending { background: #FFF3E0; color: #E6A23C; }
.tag-approved { background: #E8F5E9; color: #4CAF50; }
.tag-rejected { background: #FFEBEE; color: #F56C6C; }

/* === Toast === */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78); color: #fff; padding: 10px 16px;
  border-radius: 6px; font-size: 14px; z-index: 1000;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

/* === 模态框 === */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 0 30px;
}
.modal-box {
  background: #fff; border-radius: 10px; padding: 20px 16px 16px; width: 100%;
  max-width: 340px;
}
.modal-title { font-size: 16px; font-weight: bold; margin-bottom: 12px; }
.modal-body { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions > * { flex: 1; }

/* === 列表页 === */
.filter-bar {
  display: flex; gap: 8px; padding: 10px 12px;
  background: #fff; margin: 12px 12px 0; border-radius: 8px;
  overflow-x: auto;
}
.filter-chip {
  font-size: 13px; padding: 5px 12px; border-radius: 12px;
  background: #F0F2F5; color: #666; white-space: nowrap;
}
.filter-chip.active { background: #4F7CFF; color: #fff; }

.stat-bar {
  display: flex; justify-content: space-around; padding: 12px 0;
  background: #fff; margin: 0 12px; border-radius: 8px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 20px; font-weight: bold; color: #4F7CFF; }
.stat-label { font-size: 12px; color: #999; margin-top: 2px; }

.leave-list { margin: 0 12px; }
.leave-item {
  background: #fff; border-radius: 8px; padding: 14px; margin-top: 10px;
  cursor: pointer; transition: transform 0.1s;
}
.leave-item:active { transform: scale(0.98); }
.leave-item .row1 { display: flex; justify-content: space-between; align-items: center; }
.leave-item .name { font-size: 16px; font-weight: bold; }
.leave-item .meta { font-size: 12px; color: #999; margin-top: 4px; }
.leave-item .reason {
  font-size: 14px; color: #666; margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leave-item .footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 0.5px solid #F0F0F0;
  font-size: 12px; color: #999;
}

.fab {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #4F7CFF; color: #fff; border-radius: 24px;
  padding: 12px 40px; font-size: 16px; font-weight: bold;
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.4);
  z-index: 50;
}

/* === 表单 === */
.form-row {
  display: flex; align-items: center; padding: 10px 0;
  border-bottom: 0.5px solid #F0F0F0;
}
.form-row.column { flex-direction: column; align-items: stretch; }
.form-row .label { width: 80px; font-size: 14px; color: #666; flex-shrink: 0; }
.form-row .input { flex: 1; font-size: 14px; border: none; padding: 6px 0; background: transparent; }
.form-row.column .label { width: auto; margin-bottom: 6px; }
.form-row .picker { flex: 1; font-size: 14px; color: #333; padding: 6px 0; }
.form-row .picker::after {
  content: '›'; color: #C0C4CC; margin-left: 4px; font-size: 16px;
}
.textarea {
  width: 100%; min-height: 80px; font-size: 14px;
  padding: 10px; background: #F8F9FB; border-radius: 6px;
  border: none; resize: vertical; box-sizing: border-box;
}

.sign-card { background: #fff; margin: 12px; border-radius: 8px; padding: 14px; }
.sign-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sign-title { font-size: 15px; font-weight: bold; }
.sign-hint { font-size: 12px; color: #999; }
/* 签名预览区：点击后打开全屏签名板 */
.sign-preview {
  border: 1px dashed #C0C4CC; border-radius: 6px;
  min-height: 150px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; background: #FBFBFD;
  padding: 12px; box-sizing: border-box; text-align: center;
}
.sign-placeholder {}
.sign-ink { font-size: 42px; line-height: 1; margin-bottom: 10px; }
.sign-tap { color: #4F7CFF; font-size: 15px; font-weight: bold; }
.sign-sub { color: #999; font-size: 12px; margin-top: 4px; }
.sign-thumb { max-width: 60%; max-height: 130px; background: #fff; border-radius: 4px; }
.sign-resign-row { display: flex; gap: 16px; font-size: 12px; margin-top: 10px; color: #999; }
.sign-resign-row .del { color: #F56C6C; }
/* === 全屏签名板 === */
.fullsign {
  position: fixed; inset: 0; z-index: 200;
  background: #F2F3F7;
  display: flex; flex-direction: column;
}
.fullsign-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px; background: #fff; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.fullsign-title { font-size: 16px; font-weight: bold; }
.fullsign-btn { font-size: 15px; color: #666; background: none; border: none; padding: 8px 12px; }
.fullsign-btn.danger { color: #F56C6C; }
.fullsign-body {
  flex: 1; margin: 16px; min-height: 0; position: relative;
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}
#fsCanvas {
  display: block; width: 100%; height: 100%;
  touch-action: none;
}
.fullsign-tip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #C0C4CC; font-size: 16px; pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.7); padding: 6px 12px; border-radius: 20px;
}
.fullsign-foot {
  padding: 12px 16px; flex-shrink: 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.sign-wrap {
  position: relative; border: 1px dashed #C0C4CC; border-radius: 6px;
  background: #fff; overflow: hidden;
}
.sign-canvas { display: block; width: 100%; height: 140px; touch-action: none; }
.sign-tip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #C0C4CC; font-size: 14px; pointer-events: none;
}

.submit-area { padding: 20px 24px 0; }

/* === 详情 === */
.status-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; background: #fff; margin: 12px; border-radius: 8px;
}
.status-head .status-text { font-size: 18px; font-weight: bold; }
.status-head .submit-time { font-size: 12px; color: #999; margin-top: 4px; }

.info-row { display: flex; padding: 8px 0; border-bottom: 0.5px solid #F0F0F0; }
.info-row:last-child { border-bottom: none; }
.info-row .k { width: 80px; color: #999; font-size: 13px; flex-shrink: 0; }
.info-row .v { flex: 1; font-size: 14px; color: #333; word-break: break-all; }

.sign-img {
  width: 100%; max-height: 180px; background: #F8F9FB; border-radius: 6px;
  object-fit: contain;
}
.no-sign { color: #C0C4CC; font-size: 13px; }

.opinion-area { background: #fff; margin: 12px; border-radius: 8px; padding: 14px; }
.opinion-label { font-size: 14px; color: #666; margin-bottom: 6px; display: block; }

.opinion-result {
  background: #F8F9FB; padding: 10px; border-radius: 6px;
  font-size: 14px; color: #333; line-height: 1.6;
}

/* === 配置横幅 === */
.config-banner {
  background: #FFF7E6; color: #874D00; font-size: 12px;
  padding: 8px 12px; text-align: center; line-height: 1.5;
}
.config-banner a { color: #874D00; text-decoration: underline; font-weight: bold; }

/* === 辅导员管理 === */
.counselor-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 12px 10px; padding: 8px 12px;
  background: #F0F5FF; border-radius: 8px;
  font-size: 13px; color: #33518F;
}
.manage-link {
  border: none; background: transparent; color: #4F7CFF;
  font-size: 13px; padding: 4px 6px;
}
.cs-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 0.5px solid #F0F0F0;
}
.cs-row:last-child { border-bottom: none; }
.cs-row .cs-name, .cs-row .cs-info { flex: 1; min-width: 0; }
.cs-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; flex-shrink: 0; }
.cs-actions button { white-space: nowrap; }
/* === 台账列表改版（2026-09-07）：字段筛选/排序/序号/时长/行内操作 === */
.field-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 12px 10px;
}
/* === 关键词搜索 === */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 12px 10px;
  background: #fff; border-radius: 8px; padding: 8px 12px;
}
.search-input {
  flex: 1; min-width: 0; width: auto; height: auto;
  padding: 6px 2px; font-size: 14px;
  border: none; background: transparent; color: #333;
}
.search-input:focus { outline: none; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  flex-shrink: 0; font-size: 12px; color: #8A94A6;
  background: #F0F2F5; border-radius: 12px; padding: 4px 10px;
}
.search-hint {
  margin: 0 12px 8px; font-size: 12px; color: #4F7CFF;
}
/* 列表区局部重绘时禁用浏览器滚动锚定，避免输入搜索词时页面自己滚动 */
#listBody { overflow-anchor: none; }
.ff-item { display: flex; align-items: center; gap: 5px; }
.ff-label { font-size: 12px; color: #8A94A6; flex-shrink: 0; }
.ff-select {
  width: auto; min-width: 90px; height: auto;
  padding: 5px 8px; font-size: 13px; background: #fff;
  border: 1px solid #E2E6EE; border-radius: 8px; color: #333;
}
.leave-item .row1-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.leave-item .name { display: flex; align-items: baseline; gap: 6px; }
.seq-no {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; color: #98A2B3; font-weight: normal; letter-spacing: 0.5px;
}
.tag-type { background: #EEF4FF; color: #3B6EF5; }
.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.days-badge {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 10px; background: #FFF3E0; color: #E6A23C; font-weight: 600;
}
.item-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ECEFF5;
}
.item-actions .btn-mini { padding: 6px 16px; border-radius: 8px; }
.act-ok { background: #16A34A !important; border-color: #16A34A !important; color: #fff !important; }
.act-no { background: #F59E0B !important; border-color: #F59E0B !important; color: #fff !important; }
.act-del { background: #fff !important; border-color: #F3C1C3 !important; color: #E5484D !important; }
/* 仅看某位同学的提示条 */
.person-only-banner {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 12px 2px; padding: 9px 12px;
  background: #EEF4FF; color: #3B6EF5; border-radius: 8px; font-size: 13px;
}
.po-clear { color: #3B6EF5; cursor: pointer; font-weight: 600; flex-shrink: 0; margin-left: 10px; }
/* 申请人请假统计面板 */
.person-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer;
}
.person-title { font-size: 15px; font-weight: 600; color: #333; }
.person-toggle { font-size: 12px; color: #8A94A6; }
.person-list { max-height: 300px; overflow-y: auto; border-top: 0.5px solid #F0F0F0; }
.person-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: pointer;
}
.person-row:hover { background: #F6F8FC; }
.person-row + .person-row { border-top: 0.5px solid #F6F7F9; }
.person-name { font-size: 14px; font-weight: 600; color: #333; }
.person-metrics { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.person-hint { padding: 8px 14px; font-size: 12px; color: #98A2B3; border-top: 0.5px solid #F0F0F0; }
/* 每人月度分布小标签（按月 9月×2 · 8月×1） */
.m-dist { background: #F2F4F7; color: #475467; }
.pm-label { font-size: 11px; color: #98A2B3; }
/* 管理行紧凑小按钮（修改/删除同行） */
.btn-mini {
  display: inline-block; width: auto;
  padding: 6px 14px; font-size: 13px; line-height: 1.4;
  border-radius: 17px; border: 1px solid #4F7CFF;
  background: #fff; color: #4F7CFF; text-align: center;
}
.cs-name { font-size: 15px; font-weight: bold; color: #333; }
.cs-pin { font-size: 12px; color: #999; margin-top: 3px; letter-spacing: 2px; }
.cs-del {
  border: none; background: #FEE; color: #F56C6C;
  font-size: 13px; padding: 6px 14px; border-radius: 6px;
}
.cs-del.disabled { background: #F5F5F5; color: #C0C4CC; }
/* 管理页添加行：带边框的输入框 + 紧凑按钮 */
.opt-add-row { display: flex; gap: 10px; margin-top: 12px; }
.opt-add-row .input {
  flex: 1; border: 1px solid #E5E6EB; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; background: #FAFBFC; width: auto;
}
.opt-add-row .input:focus { outline: none; border-color: #4F6EF2; background: #fff; }

/* === 辅导员登录页 === */
.login-hero { text-align: center; padding: 48px 0 28px; }
.login-title { font-size: 20px; font-weight: bold; color: #333; margin-top: 10px; }
.login-sub { font-size: 13px; color: #999; margin-top: 6px; }

/* === 批量终审栏（两级审批）=== */
.batch-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 12px 10px; padding: 10px 12px;
  background: #F0F5FF; border-radius: 8px; font-size: 13px;
}
.batch-label { display: inline-flex; align-items: center; gap: 5px; color: #33518F; cursor: pointer; }
.batch-count { color: #33518F; font-weight: 600; }
.batch-check {
  width: 16px; height: 16px; accent-color: #4F7CFF; cursor: pointer; flex-shrink: 0; margin: 0;
}
.leave-item .name .batch-check { align-self: center; }

