/* 潮汕日历宝 · 管理后台样式（左侧导航 + 右侧内容，移动端降级） */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff7ed;
  color: #1f2937;
  min-height: 100vh;
}

.hidden { display: none !important; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn-primary { background: #dc2626; color: #fff; }
.btn-danger { background: #f59e0b; color: #fff; }
.btn-ghost { background: #fff; color: #6b7280; border: 1px solid #d1d5db; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 12px; }

/* ---------- 登录页（保持不变） ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.login-logo {
  font-size: 26px;
  font-weight: 700;
  color: #dc2626;
  text-align: center;
}
.login-sub {
  font-size: 14px;
  color: #9ca3af;
  text-align: center;
  margin: 6px 0 28px;
}
.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.login-input:focus { border-color: #dc2626; }
.login-error {
  margin-top: 14px;
  text-align: center;
  color: #dc2626;
  font-size: 13px;
}

/* ---------- 控制台：整体布局 ---------- */
.console-wrap { min-height: 100vh; }
.console-layout {
  display: flex;
  min-height: 100vh;
}

/* 左侧侧边栏 */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #1f2937;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-text { line-height: 1.3; }
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-btn.active { background: #dc2626; color: #fff; font-weight: 600; }
.nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-logout {
  width: 100%;
  background: transparent;
  color: #e5e7eb;
  border-color: rgba(255,255,255,.25);
}
.sidebar-logout:hover { background: rgba(255,255,255,.06); }

/* 右侧内容区 */
.console-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #f3e8e0;
}
.page-title {
  font-size: 16px;
  font-weight: 700;
  color: #dc2626;
}
.page-content { padding: 20px; flex: 1; }
.tab-panel { padding: 0; }

.panel-hint {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.config-meta {
  margin-left: auto;
  font-size: 13px;
  color: #6b7280;
}

/* 开关分组 */
.switch-groups { display: flex; flex-direction: column; gap: 16px; }
.group {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.group-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid #f5f5f4;
  cursor: pointer;
}
.switch-row:last-child { border-bottom: none; }
.switch-row--static { opacity: .6; cursor: default; }
.switch-row input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #dc2626;
  flex-shrink: 0;
}
.switch-label { font-size: 15px; }
.switch-key {
  font-size: 12px;
  color: #9ca3af;
  background: #f5f5f4;
  padding: 2px 8px;
  border-radius: 10px;
}
.switch-note {
  font-size: 12px;
  color: #9ca3af;
  margin-left: auto;
}
.linkage-hint {
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 12px;
}

/* 保存条（sticky 吸底，限定在右侧内容区） */
.savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 16px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid #f3e8e0;
}
.savebar .btn { flex: 1; padding: 13px 0; font-size: 15px; }

/* ---------- 公告管理 ---------- */
.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.ann-card-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ann-type-badge {
  font-size: 12px;
  background: #f5f5f4;
  padding: 3px 8px;
  border-radius: 10px;
}
.ann-card-title { font-size: 15px; font-weight: 600; }
.ann-version { font-size: 12px; color: #9ca3af; }
.ann-status { font-size: 12px; font-weight: 600; margin-left: auto; }
.ann-status.on { color: #16a34a; }
.ann-status.off { color: #9ca3af; }
.ann-card-row2 {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
}
.ann-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
}

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f3e8e0;
  font-size: 16px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #f3e8e0;
}
.modal-footer .btn { flex: 1; padding: 11px 0; }

.form-row { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}
.input, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.input:focus, .textarea:focus { border-color: #dc2626; }
.input-sm { width: 46%; }
.textarea { resize: vertical; }
.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio, .checkbox { font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.time-range { display: flex; align-items: center; gap: 8px; }
.time-sep { color: #9ca3af; }
.form-tip {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: rgba(17,24,39,.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 200;
  max-width: 80vw;
  text-align: center;
}

/* ---------- 窄屏降级：侧边栏收窄为图标栏 ---------- */
@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar-brand { justify-content: center; padding: 16px 8px; }
  .brand-text { display: none; }
  .nav-btn { justify-content: center; padding: 12px 0; }
  .nav-label { display: none; }
  .sidebar-foot { display: none; } /* 窄屏靠页头「退出」 */
  .page-head { padding: 10px 14px; }
  .page-content { padding: 14px; }
  .switch-key { display: none; }
  .switch-note { display: none; }
}
