* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #2BB6D6;
  --brand-dark: #1A9BB8;
  --accent: #FFC72C;
  --bg: #F4F3EE;
  --card: #FFFFFF;
  --text: #1A1B1C;
  --muted: #6B7280;
  --border: #E4E3DD;
  --green: #2EA86B;
  --red: #E5544B;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
/* 登录页 */
.login-wrap { max-width: 380px; margin: 8vh auto; padding: 0 20px; }
.login-card { background: var(--card); border-radius: 16px; padding: 32px 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo h1 { font-size: 22px; color: var(--brand-dark); }
.login-logo p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 14px; }
.field label { display:block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
/* 日期/月份输入框：整个区域点击都弹日历 */
input[type="date"], input[type="month"] {
  position: relative;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.btn { display: inline-block; padding: 10px 18px; border: none; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: var(--red); }
.btn-ok { background: var(--green); }
.hint { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
/* 主框架 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #fff; border-right: 1px solid var(--border); padding: 20px 0; flex-shrink: 0; }
.sidebar .brand { padding: 0 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar .brand b { color: var(--brand-dark); font-size: 15px; }
.sidebar .brand small { display:block; color: var(--muted); font-size: 11px; }
.nav-item { display: block; width: 100%; text-align: left; padding: 11px 20px; background: none; border: none; font-size: 14px; color: var(--text); cursor: pointer; border-left: 3px solid transparent; }
.nav-item:hover { background: #F7F6F2; }
.nav-item.active { background: rgba(43,182,214,0.08); border-left-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.main { flex: 1; padding: 24px; max-width: 100%; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.topbar h2 { font-size: 18px; }
.userbox { font-size: 13px; color: var(--muted); }
.userbox b { color: var(--text); }
/* 卡片 */
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--border); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
/* 日历 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head button { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0; }
.cal-cell { min-height: 72px; background: #FAFAF7; border-radius: 8px; padding: 6px; font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.cal-cell:hover { border-color: var(--brand); }
.cal-cell.other { opacity: 0.35; }
.cal-cell.has-event { background: rgba(255,199,44,0.18); }
.cal-cell .ev { font-size: 10.5px; color: var(--brand-dark); margin-top: 3px; line-height: 1.3; }
.cal-cell .fest { font-size: 10px; color: #9A7B00; background: #FFF4CE; border-radius: 4px; padding: 0 4px; margin-top: 2px; display: inline-block; }
.cal-cell { position: relative; }
.cal-tip { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 50; width: 200px; text-align: center;
  margin-top: 8px; }
.cal-cell:hover .cal-tip { display: block; }
.cal-cell.col-first .cal-tip { left: 0; transform: none; }
.cal-cell.col-last .cal-tip { left: auto; right: 0; transform: none; }
/* 人员 */
.person-card { text-align: center; padding: 18px 12px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg,#E4E3DD,#D4D3CE); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; }
.person-card h4 { font-size: 15px; }
.person-card .pos { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 9px; background: rgba(43,182,214,0.15); color: var(--brand-dark); margin: 2px; }
.points-num { font-size: 22px; font-weight: 600; color: var(--brand-dark); margin-top: 6px; }
.points-num.minus { color: var(--red); }
/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
th[style*="right"], td[style*="right"] { text-align: right; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 9px; font-size: 11px; }
.pill.up { background: rgba(46,168,107,0.15); color: var(--green); }
.pill.down { background: rgba(229,84,75,0.15); color: var(--red); }
.pill.pending { background: #FFF4CE; color: #9A7B00; }
.pill.approved { background: rgba(46,168,107,0.15); color: var(--green); }
.pill.rejected { background: rgba(229,84,75,0.15); color: var(--red); }
/* 素材 */
.mat-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.mat-thumb { width: 90px; height: 90px; border-radius: 8px; background: #EEE; object-fit: cover; flex-shrink: 0; }
.mat-video { display:flex; align-items:center; justify-content:center; width:90px; height:90px; background:#222; color:#fff; border-radius:8px; flex-shrink:0; font-size:24px; }
/* 制度 */
.rules-layout { display: flex; gap: 14px; }
.rules-side { width: 200px; flex-shrink: 0; }
.rules-side button { display:block; width:100%; text-align:left; padding:9px 12px; background:none; border:none; border-radius:8px; cursor:pointer; font-size:13px; margin-bottom:2px; }
.rules-side button.active { background: rgba(43,182,214,0.1); color: var(--brand-dark); font-weight:600; }
.rules-main { flex:1; }
.rule-doc { padding: 14px 0; border-bottom: 1px solid var(--border); }
.rule-doc h4 { font-size: 14px; margin-bottom: 6px; }
.rule-doc pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: #333; line-height: 1.8; }
/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; max-width: 480px; width: 100%; max-height: 85vh; overflow: auto; }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.hidden { display: none !important; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #1A1B1C; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 999; }
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 8px; }
  .sidebar .brand { display: none; }
  .nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .nav-item.active { border-bottom-color: var(--brand); }
  .main { padding: 14px; }
  .rules-layout { flex-direction: column; }
  .rules-side { width: 100%; display: flex; overflow-x: auto; }
}
