/* =====================================================================
   泽莱农事图谱 官方网站 —— 内容管理后台样式
   视觉与官网首页统一：深森林绿 / 柠檬绿点缀 / 米纸背景 / 微软雅黑
   设计令牌与 官网 styles.css 的 :root 保持一致。
   ===================================================================== */
:root {
  --forest: #0b2119;           /* 首页主色：深森林绿 */
  --forest-2: #12382a;
  --moss: #2f5f43;
  --lime: #b8e85d;             /* 首页强调色：柠檬绿 */
  --lime-soft: #e4f3a6;
  --sun: #f4bd4d;
  --paper: #f1f0e7;            /* 首页纸色背景 */
  --ink: #12261d;
  --muted: #66736b;
  --line: rgba(11, 33, 25, .15);
  --white-line: rgba(255, 255, 255, .18);
  --danger: #d0473b;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --font: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

.btn { border: none; border-radius: 100px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-family: inherit; font-weight: 600; transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--forest); color: var(--lime); }
.btn-primary:hover { background: var(--forest-2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--moss); }
.btn-ghost:hover { border-color: var(--moss); color: var(--forest); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: 5px 12px; font-size: 13px; font-weight: 500; }

/* ----------------- 登录（首页 hero 风格） ----------------- */
.login-mask { position: fixed; inset: 0; background: linear-gradient(150deg, #071911, var(--forest) 45%, #12382a 100%); overflow: hidden; display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-grid { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 95px, rgba(184,232,93,.05) 96px), repeating-linear-gradient(0deg, transparent 0 95px, rgba(184,232,93,.05) 96px); }
.login-glow { position: absolute; width: 520px; height: 520px; left: calc(50% - 260px); top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(184,232,93,.16), transparent 62%); }
.login-box { position: relative; z-index: 1; background: #fff; border-radius: 20px; padding: 38px 36px 26px; width: 360px; box-shadow: 0 26px 70px rgba(0,0,0,.38); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 21px; letter-spacing: -.04em; color: var(--ink); }
.login-brand .brand-mark { color: var(--moss); width: 34px; height: 34px; display: inline-flex; }
.login-brand .brand-mark svg { width: 100%; height: 100%; }
.login-brand .brand-type strong { font-weight: 700; }
.login-brand .brand-type > span { color: var(--moss); }
.login-box h2 { text-align: center; color: var(--forest); margin: 5px 0 24px; font-size: 16px; font-weight: 600; letter-spacing: .06em; }
.login-box label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.login-box input { width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; transition: border-color .2s; }
.login-box input:focus { outline: none; border-color: var(--moss); }
.login-box .btn { width: 100%; margin-top: 8px; padding: 12px; }
.login-err { color: var(--danger); font-size: 13px; text-align: center; min-height: 18px; margin-top: 9px; }
.login-back { display: block; text-align: center; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-back:hover { color: var(--moss); }

/* ----------------- 主框架 ----------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 220px; background: var(--forest); color: #cfe9da; flex-shrink: 0; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 19px 18px; border-bottom: 1px solid var(--white-line); color: #fff; }
.side-brand .brand-mark { color: var(--lime); width: 30px; height: 30px; display: inline-flex; }
.side-brand .brand-mark svg { width: 100%; height: 100%; }
.side-brand-type { display: flex; flex-direction: column; font-size: 15px; letter-spacing: -.04em; line-height: 1.3; }
.side-brand-type strong { font-weight: 700; }
.side-brand-type small { font-size: 9px; color: rgba(184,232,93,.75); letter-spacing: .12em; font-weight: 400; }
.side-nav { padding: 12px 10px; flex: 1; overflow: auto; }
.side-nav a { display: block; padding: 11px 14px; border-radius: 10px; color: rgba(207,233,218,.78); font-size: 14px; cursor: pointer; margin-bottom: 4px; transition: background .2s, color .2s; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: var(--lime); color: var(--forest); font-weight: 700; }
.side-back { display: block; padding: 14px 18px; border-top: 1px solid var(--white-line); color: rgba(255,255,255,.5); font-size: 12px; }
.side-back:hover { color: var(--lime); }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-top { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.crumb { font-weight: 700; color: var(--forest); letter-spacing: -.01em; }
.top-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.top-link { color: var(--moss); font-size: 12px; }
.top-link:hover { color: var(--forest); }
.admin-content { padding: 24px; flex: 1; overflow: auto; }

/* ----------------- 内容区 ----------------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { font-size: 18px; color: var(--forest); letter-spacing: -.02em; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto; box-shadow: 0 8px 22px rgba(11,33,25,.05); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: rgba(184,232,93,.16); color: var(--forest); font-weight: 700; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafdf4; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.tag-on { background: rgba(184,232,93,.4); color: var(--forest); }
.tag-off { background: #fbe7e4; color: var(--danger); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.loading { text-align: center; color: var(--muted); padding: 60px; }

/* ----------------- 表单 ----------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 880px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; width: 100%;
  transition: border-color .2s; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--moss); }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

/* ----------------- 弹窗 ----------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(7,25,17,.55); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 720px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 26px 70px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--forest); }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--forest); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ----------------- Toast ----------------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 12px 24px; border-radius: 100px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }

@media (max-width: 760px) {
  .admin-side { width: 64px; }
  .side-brand { justify-content: center; padding: 16px 0; }
  .side-brand-type { display: none; }
  .side-nav a { text-align: center; font-size: 12px; padding: 10px 4px; }
  .side-back { text-align: center; font-size: 0; padding: 14px 0; }
  .side-back:before { content: "官网"; font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .login-box { width: min(360px, calc(100% - 40px)); }
}