/* ==========================================================================
   园圃心育 · 管理后台
   视觉规范参照 ContiNew Admin（Arco Design 设计语言）
   ========================================================================== */
:root {
  --primary: #165DFF;
  --primary-hover: #4080FF;
  --primary-active: #0E42D2;
  --primary-light: #E8F3FF;
  --success: #00B42A;
  --success-light: #E8FFEA;
  --warning: #FF7D00;
  --warning-light: #FFF7E8;
  --danger: #F53F3F;
  --danger-light: #FFECE8;
  --gray-1: #F7F8FA;
  --gray-2: #F2F3F5;
  --gray-3: #E5E6EB;
  --gray-4: #C9CDD4;
  --gray-5: #86909C;
  --gray-6: #4E5969;
  --gray-7: #272E3B;
  --gray-8: #1D2129;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .08);
  --shadow-3: 0 8px 28px rgba(0, 0, 0, .14);
  --sidebar-w: 220px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-size: 14px; line-height: 1.5715;
  color: var(--gray-8);
  background: var(--gray-2);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* --------------------------------------------------------------------------
   通用控件
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 15px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--gray-2); color: var(--gray-8);
  cursor: pointer; white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease;
}
.btn:hover { background: var(--gray-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #009A29; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #CB2634; }
.btn-outline { background: #fff; border-color: var(--gray-3); color: var(--gray-8); }
.btn-outline:hover { background: var(--gray-1); border-color: var(--gray-4); }
.btn-text { background: transparent; color: var(--primary); padding: 0 8px; height: auto; }
.btn-text:hover { background: transparent; color: var(--primary-hover); }
.btn-text.muted { color: var(--gray-5); }
.btn-text.muted:hover { color: var(--gray-6); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { color: #CB2634; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 15px; }

.input, .select, .textarea {
  width: 100%; min-height: 32px; padding: 5px 12px;
  border: 1px solid var(--gray-3); border-radius: var(--radius);
  background: #fff; color: var(--gray-8); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--gray-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 93, 255, .1);
}
.textarea { padding: 8px 12px; min-height: 92px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2386909C' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--radius); font-size: 12px; line-height: 1; white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-gray { background: var(--gray-2); color: var(--gray-6); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 460px at 12% -6%, rgba(22, 93, 255, .16), transparent 62%),
    radial-gradient(760px 420px at 92% 104%, rgba(22, 93, 255, .12), transparent 60%),
    linear-gradient(160deg, #F7F9FF 0%, #EEF3FB 52%, #F5F7FA 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 10px; box-shadow: var(--shadow-3);
  padding: 40px 40px 32px;
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 12px;
  background: linear-gradient(140deg, var(--primary), #4B8BFF);
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 93, 255, .3);
}
.login-title { font-size: 21px; font-weight: 600; letter-spacing: .5px; }
.login-sub { font-size: 13px; color: var(--gray-5); margin-top: 7px; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; color: var(--gray-6); margin-bottom: 7px; }
.login-field .input { height: 38px; }
.login-submit { height: 38px; font-size: 15px; margin-top: 6px; }
.login-msg {
  display: none; margin-bottom: 16px; padding: 8px 12px; border-radius: var(--radius);
  font-size: 13px; background: var(--danger-light); color: var(--danger);
  border: 1px solid rgba(245, 63, 63, .18);
}
.login-msg.show { display: block; }
.login-tip {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--gray-2);
  font-size: 12px; color: var(--gray-5); text-align: center; line-height: 1.9;
}
.login-back { text-align: center; margin-top: 18px; font-size: 13px; }

/* --------------------------------------------------------------------------
   布局
   -------------------------------------------------------------------------- */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 30;
  background: #fff; border-right: 1px solid var(--gray-3);
  display: flex; flex-direction: column;
}
.sidebar-logo {
  height: var(--header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--gray-2); flex: 0 0 auto;
}
.sidebar-logo .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--primary), #4B8BFF);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo .name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar-logo .name small { display: block; font-size: 11px; color: var(--gray-5); font-weight: 400; }
.sidebar-menu { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px; }
.menu-group-title { font-size: 12px; color: var(--gray-4); padding: 10px 12px 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; margin-bottom: 4px;
  border-radius: var(--radius); color: var(--gray-6); cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.menu-item:hover { background: var(--gray-2); color: var(--gray-8); }
.menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.menu-item svg { flex: 0 0 auto; }
.menu-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.sidebar-foot { padding: 12px 20px; border-top: 1px solid var(--gray-2); font-size: 12px; color: var(--gray-4); }

.main { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  background: #fff; border-bottom: 1px solid var(--gray-3);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-5); }
.crumb b { color: var(--gray-8); font-weight: 500; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius);
}
.header-user:hover { background: var(--gray-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: var(--primary); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.header-user .uname { font-size: 13px; color: var(--gray-6); }
.dropdown {
  position: absolute; top: calc(var(--header-h) - 6px); right: 20px; z-index: 40;
  min-width: 160px; background: #fff; border: 1px solid var(--gray-3);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 5px;
  display: none;
}
.dropdown.open { display: block; }
.dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; background: transparent; border-radius: var(--radius);
  color: var(--gray-6); cursor: pointer;
}
.dropdown button:hover { background: var(--gray-2); color: var(--gray-8); }

.content { flex: 1 1 auto; padding: 16px 20px 34px; }
.page { display: none; }
.page.active { display: block; }

/* --------------------------------------------------------------------------
   卡片 / 统计
   -------------------------------------------------------------------------- */
.card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-2);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat .icon {
  width: 46px; height: 46px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.stat .icon.blue { background: var(--primary-light); color: var(--primary); }
.stat .icon.orange { background: var(--warning-light); color: var(--warning); }
.stat .icon.green { background: var(--success-light); color: var(--success); }
.stat .icon.red { background: var(--danger-light); color: var(--danger); }
.stat .label { font-size: 13px; color: var(--gray-5); }
.stat .value { font-size: 24px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--gray-5); margin-left: 5px; }

/* --------------------------------------------------------------------------
   筛选栏 / 表格
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--gray-2);
}
.filter-bar .keyword { width: 240px; }
.filter-bar .spacer { margin-left: auto; }
.seg { display: inline-flex; background: var(--gray-2); border-radius: var(--radius); padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--gray-6); cursor: pointer;
  height: 26px; padding: 0 14px; border-radius: 3px; transition: all .16s ease;
}
.seg button.active { background: #fff; color: var(--primary); font-weight: 500; box-shadow: var(--shadow-1); }

.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
table.tbl th, table.tbl td {
  padding: 12px 16px; text-align: left; font-size: 14px; vertical-align: middle;
  border-bottom: 1px solid var(--gray-2);
}
table.tbl th {
  background: var(--gray-1); color: var(--gray-6); font-weight: 500;
  white-space: nowrap; font-size: 13px;
}
table.tbl tbody tr:hover td { background: #FAFBFC; }
table.tbl td.strong { font-weight: 500; }
table.tbl td.nowrap { white-space: nowrap; }
.cell-sub { font-size: 12px; color: var(--gray-5); margin-top: 3px; }
td.fields-cell { min-width: 200px; max-width: 300px; line-height: 1.5; color: var(--gray-7); }
.ops { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ops .sep { width: 1px; height: 12px; background: var(--gray-3); }

.empty { padding: 62px 20px; text-align: center; color: var(--gray-5); }
.empty .icon { color: var(--gray-4); margin-bottom: 12px; }
.empty p { font-size: 14px; }
.empty .sub { font-size: 13px; color: var(--gray-4); margin-top: 6px; }

.pager {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 14px 18px; color: var(--gray-6); font-size: 13px;
}
.pager .total { margin-right: auto; color: var(--gray-5); }

.loading { padding: 54px 20px; text-align: center; color: var(--gray-5); }
.spinner {
  width: 20px; height: 20px; margin: 0 auto 12px; border-radius: 50%;
  border: 2px solid var(--gray-3); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   抽屉 / 弹窗 / 轻提示
   -------------------------------------------------------------------------- */
.mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(29, 33, 41, .45);
  display: none;
}
.mask.open { display: block; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 94vw; z-index: 110;
  background: #fff; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .26s cubic-bezier(.32, .72, .35, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  flex: 0 0 auto; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--gray-2);
  display: flex; align-items: center; gap: 12px;
}
.drawer-head h3 { font-size: 16px; font-weight: 600; }
.drawer-head .close {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: var(--radius); color: var(--gray-5); font-size: 20px; line-height: 1;
}
.drawer-head .close:hover { background: var(--gray-2); color: var(--gray-8); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; }
.drawer-foot {
  flex: 0 0 auto; padding: 14px 20px; border-top: 1px solid var(--gray-2);
  display: flex; align-items: center; gap: 10px; background: #fff;
}

.desc { display: grid; grid-template-columns: 96px 1fr; gap: 12px 16px; }
.desc dt { color: var(--gray-5); font-size: 13px; }
.desc dd { margin: 0; color: var(--gray-8); word-break: break-word; }
.section-title {
  font-size: 14px; font-weight: 600; margin: 22px 0 12px;
  padding-left: 9px; border-left: 3px solid var(--primary); line-height: 1.3;
}
.section-title:first-child { margin-top: 0; }

.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cert-item {
  border: 1px solid var(--gray-3); border-radius: var(--radius); overflow: hidden;
  background: var(--gray-1); cursor: zoom-in; position: relative;
}
.cert-item img { display: block; width: 100%; height: 116px; object-fit: cover; }
.cert-item .cap {
  padding: 5px 8px; font-size: 12px; color: var(--gray-6);
  background: #fff; border-top: 1px solid var(--gray-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cert-item.pending img { display: flex; align-items: center; justify-content: center; }

.review-box {
  margin-top: 16px; padding: 16px; border-radius: var(--radius-lg);
  background: var(--gray-1); border: 1px solid var(--gray-2);
}
.review-box h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.review-note {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.7;
}
.review-note.ok { background: var(--success-light); color: #0B7B24; border: 1px solid rgba(0, 180, 42, .2); }
.review-note.no { background: var(--danger-light); color: #A81F2A; border: 1px solid rgba(245, 63, 63, .2); }
.review-note b { display: block; margin-bottom: 4px; }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%); z-index: 130;
  width: 460px; max-width: 94vw; background: #fff; border-radius: 8px;
  box-shadow: var(--shadow-3); display: none; overflow: hidden;
}
.modal.open { display: block; animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -42%) scale(.98); } }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-2);
  display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600;
}
.modal-head .close {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  color: var(--gray-5); font-size: 20px; line-height: 1; width: 28px; height: 28px; border-radius: var(--radius);
}
.modal-head .close:hover { background: var(--gray-2); }
.modal-body { padding: 20px; max-height: 62vh; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--gray-2);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-tip { font-size: 13px; color: var(--gray-6); line-height: 1.7; margin-bottom: 12px; }
.modal-tip.warn { color: var(--warning); }
.modal-tip .req { color: var(--danger); }

.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--gray-3); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2); padding: 9px 16px; font-size: 14px;
  animation: drop .22s ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }
.toast.ok { color: #0B7B24; border-color: rgba(0, 180, 42, .3); background: var(--success-light); }
.toast.err { color: #A81F2A; border-color: rgba(245, 63, 63, .3); background: var(--danger-light); }
.toast.info { color: var(--gray-6); }

.lightbox {
  position: fixed; inset: 0; z-index: 160; background: rgba(0, 0, 0, .76);
  display: none; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88vh; background: #fff; border-radius: var(--radius-lg); }

.recent-list li {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px dashed var(--gray-2);
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list .who { font-weight: 500; }
.recent-list .meta { color: var(--gray-5); font-size: 13px; }
.recent-list .time { margin-left: auto; color: var(--gray-5); font-size: 13px; }

.msg-item { padding: 16px 18px; border-bottom: 1px solid var(--gray-2); }
.msg-item:last-child { border-bottom: 0; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-head .who { font-weight: 500; }
.msg-head .time { margin-left: auto; color: var(--gray-5); font-size: 13px; }
.msg-content {
  margin-top: 10px; padding: 12px 14px; background: var(--gray-1);
  border-radius: var(--radius); color: var(--gray-7); line-height: 1.75; white-space: pre-wrap;
}
.msg-reply {
  margin-top: 10px; padding: 12px 14px; background: var(--primary-light);
  border-radius: var(--radius); color: var(--gray-7); line-height: 1.75; white-space: pre-wrap;
}
.msg-reply b { color: var(--primary); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 220px; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .stat-grid { grid-template-columns: 1fr; }
  .header-user .uname { display: none; }
  .content { padding: 12px; }
  .desc { grid-template-columns: 78px 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
.menu-toggle { display: none; border: 0; background: transparent; cursor: pointer; color: var(--gray-6); padding: 4px; }

/* 品牌 logo */
.login-logo-img { display: block; margin: 0 auto 14px; height: 54px; width: auto; }
.sidebar-logo .mark-img { width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto; display: block; }

/* 审核详情：个人照片预览 */
.avatar-preview {
  display: inline-block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #fff; cursor: zoom-in;
}
.avatar-preview img { display: block; width: 132px; height: 132px; object-fit: cover; }
.avatar-tip { font-size: 12px; color: var(--gray-5); margin-top: 8px; }

/* 页面内提示条 */
.tip-bar {
  margin: 0 20px 14px; padding: 10px 14px; border-radius: 8px;
  background: rgba(22, 93, 255, .06); border: 1px solid rgba(22, 93, 255, .18);
  color: #1D4ED8; font-size: 12.5px; line-height: 1.7;
}
