/* 德业教育后台 · 香槟金 + 深灰 + 米白 */
:root {
  --gold: #C8A15A;
  --gold-dark: #A98643;
  --dark: #2B2B2B;
  --dark-2: #1F1F1F;
  --cream: #F7F3EC;
  --line: #E6DFD2;
  --text: #333333;
  --muted: #9A948A;
  --danger: #C0392B;
  --green: #3E8E5A;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--cream); color: var(--text); font-size: 14px; }
a { color: var(--gold-dark); }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2B2B2B 0%, #3d3831 60%, #4a4234 100%); }
.login-card { width: 380px; background: #fff; border-radius: 12px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 22px; color: var(--dark); text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); margin: 8px 0 28px; font-size: 13px; }
.login-card .brand-line { width: 48px; height: 3px; background: var(--gold); margin: 14px auto 0; border-radius: 2px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--dark); color: #cfc9bd; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; transition: transform .25s; z-index: 50; }
.sidebar .logo { padding: 22px 20px; color: #fff; font-size: 17px; font-weight: 600; border-bottom: 1px solid #3a3a3a; }
.sidebar .logo span { color: var(--gold); }
.sidebar .role-tag { display: inline-block; margin-top: 6px; font-size: 12px; background: var(--gold); color: #fff; border-radius: 4px; padding: 1px 8px; font-weight: 400; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; cursor: pointer; font-size: 14px; border-left: 3px solid transparent; }
.nav-item:hover { background: #36322b; color: #fff; }
.nav-item.active { background: #36322b; color: var(--gold); border-left-color: var(--gold); }
.nav-group { padding: 14px 20px 6px; font-size: 12px; color: #7d7769; }

.main { flex: 1; margin-left: 220px; padding: 24px 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h2 { font-size: 20px; color: var(--dark); }
.topbar .user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--dark); }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 20px; }
.card h3 { font-size: 15px; color: var(--dark); margin-bottom: 16px; padding-left: 10px; border-left: 3px solid var(--gold); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--dark); margin-top: 6px; }
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .num.gold { color: var(--gold-dark); }

table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; padding: 10px 12px; background: #faf7f0; color: #6d6656; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid #f0ebdf; vertical-align: middle; }
table.data tr:hover td { background: #fcfaf5; }
.thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; background: #eee; }
.thumb.round { width: 44px; height: 44px; border-radius: 50%; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.tag.gold { background: #f4e9d4; color: var(--gold-dark); }
.tag.gray { background: #eee; color: #777; }
.tag.green { background: #e2f1e8; color: var(--green); }
.tag.red { background: #fbe4e1; color: var(--danger); }
.phone-bad { color: var(--danger); font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 6px; padding: 8px 16px; font-size: 13px; transition: opacity .15s; }
.btn:hover { opacity: .88; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--dark); font-size: 13px; }
.form-row label .req { color: var(--danger); margin-left: 2px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row input[type=date], .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--gold); }
.form-row textarea { min-height: 100px; resize: vertical; }
.hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.switch-row { display: flex; align-items: center; gap: 10px; }

/* 图片上传控件 */
.img-picker { display: flex; align-items: flex-start; gap: 12px; }
.img-picker img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f5f1e8; }
.img-picker img.square { width: 90px; height: 90px; }
.img-picker .ops { display: flex; flex-direction: column; gap: 8px; }

/* 提升点（tags）编辑器 */
.tags-editor .tag-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tags-editor .tag-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; }

/* 开关 */
.switch { position: relative; width: 42px; height: 22px; display: inline-block; }
.switch input { display: none; }
.switch .sl { position: absolute; inset: 0; background: #d8d2c4; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch .sl:before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .sl { background: var(--gold); }
.switch input:checked + .sl:before { transform: translateX(20px); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; overflow-y: auto; padding: 40px 16px; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 100%; padding: 26px 28px; }
.modal h3 { margin-bottom: 18px; color: var(--dark); border-left: 3px solid var(--gold); padding-left: 10px; font-size: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs .tab { padding: 9px 18px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab.active { color: var(--gold-dark); border-bottom-color: var(--gold); font-weight: 600; }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 22px; border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: tslide .25s; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--danger); }
@keyframes tslide { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.msg-unread { font-weight: 600; }
.section-block { border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; background: #fffdf9; }
.section-block > h4 { font-size: 14px; margin-bottom: 14px; color: var(--gold-dark); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .menu-btn { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  table.data { display: block; overflow-x: auto; white-space: nowrap; }
}
