/* ==========================================================================
   耒欧 LEIOU · 后台视觉层 admin.css
   说明：登录页 + 管理面板（侧边栏 / 顶栏 / 数据表 / 表单 / 后台弹窗）
   配色：蓝白渐变（深蓝渐变侧边栏 + 白色内容区 + 清透蓝交互色）
   ========================================================================== */

/* ==========================================================================
   A. 登录页
   ========================================================================== */
.login-page { min-height: 100vh; display: grid; background: linear-gradient(180deg, #FFFFFF 0%, #F1F7FE 100%); }
@media (min-width: 1024px) { .login-page { grid-template-columns: 1.05fr .95fr; } }

/* 左侧品牌区：深蓝渐变 */
.login-brand {
  position: relative; overflow: hidden; display: none; padding: 56px 64px;
  background: var(--grad-panel); color: #fff;
  flex-direction: column; justify-content: space-between;
}
@media (min-width: 1024px) { .login-brand { display: flex; } }
.login-brand__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 60% at 88% 8%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(60% 50% at 4% 96%, rgba(107, 163, 236, .3) 0%, rgba(255, 255, 255, 0) 64%);
}
.login-brand__mark {
  position: absolute; right: -6%; bottom: -12%; font-family: var(--font-serif);
  font-size: 26rem; line-height: 1; color: rgba(255, 255, 255, .07); user-select: none; pointer-events: none;
}
.login-brand__top, .login-brand__main, .login-brand__foot { position: relative; z-index: 2; }
.login-brand .brand { color: #fff; }
.login-brand .brand__en { color: var(--accent-200); }
.login-brand .eyebrow { color: var(--accent-200); }
.login-brand__main h2 {
  margin: 22px 0 0; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.8rem, 2.6vw, 2.5rem); line-height: 1.45; letter-spacing: .06em; color: #fff;
}
.login-brand__main p { margin: 20px 0 0; max-width: 380px; font-size: 13.5px; line-height: 2.1; color: rgba(255, 255, 255, .74); }
.login-brand .divider-line { background: rgba(255, 255, 255, .45); }
.login-brand__foot { font-size: 12px; letter-spacing: .12em; color: rgba(255, 255, 255, .5); }

/* 右侧表单区 */
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 22px; }
.login-form { width: 100%; max-width: 380px; }
.login-form__head h1 { margin: 14px 0 0; font-family: var(--font-serif); font-weight: 500; font-size: 1.7rem; letter-spacing: .08em; color: var(--navy-900); }
.login-form__head p { margin: 12px 0 0; font-size: 13px; color: var(--text-500); }
.login-form__body { margin-top: 34px; }
.login-form__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 26px; font-size: 12.5px; color: var(--text-500); }
.login-form__row a { color: var(--accent-600); }
.login-form__row a:hover { color: var(--accent-700); }
.login-form__alert {
  display: none; align-items: center; gap: 9px; margin-bottom: 18px; padding: 11px 14px;
  font-size: 12.5px; color: var(--danger); background: rgba(192, 80, 63, .07);
  border-left: 2px solid var(--danger); border-radius: 2px;
}
.login-form__alert.is-show { display: flex; }
.login-form__tip { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.9; color: var(--text-400); }
.login-form__tip b { color: var(--text-700); font-weight: 500; }
.login-form__tip .link-underline { color: var(--accent-600) !important; }
.login-mobile-brand { display: flex; align-items: baseline; gap: 9px; margin-bottom: 30px; }
.login-mobile-brand .brand__cn { color: var(--navy-900); font-size: 20px; font-family: var(--font-serif); letter-spacing: .18em; }
.login-mobile-brand .brand__en { color: var(--accent-600); font-size: 9.5px; letter-spacing: .32em; text-transform: uppercase; }
@media (min-width: 1024px) { .login-mobile-brand { display: none; } }

/* ==========================================================================
   B. 管理面板外壳
   ========================================================================== */
.admin-body { background: #F4F8FE; }
.admin-shell { display: flex; min-height: 100vh; }

/* 侧边栏：深蓝渐变 */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 90; width: 244px;
  display: flex; flex-direction: column; background: var(--grad-navy); color: #fff;
  transition: transform .45s var(--ease);
}
.sidebar__brand { padding: 26px 24px 22px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sidebar__brand .brand__cn { font-size: 20px; color: #fff; }
.sidebar__brand .brand__en { color: var(--accent-300); }
.sidebar__sub { margin-top: 8px; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: rgba(168, 201, 244, .8); }
.sidebar__menu { flex: 1; overflow-y: auto; padding: 18px 14px; }
.sidebar__label { padding: 12px 10px 10px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .34); }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 0; background: none; color: rgba(255, 255, 255, .76); font-size: 13.5px;
  letter-spacing: .05em; text-align: left; border-radius: 4px; position: relative;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.menu-item i { width: 16px; font-size: 13px; color: var(--accent-300); text-align: center; }
.menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu-item.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.menu-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: #fff; border-radius: 2px;
}
.menu-item.is-active i { color: #fff; }
.sidebar__foot { padding: 16px 14px 22px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar__foot .menu-item { color: rgba(255, 255, 255, .6); font-size: 12.5px; }

/* 二级菜单（账款 → 公共收支 → 公共支出 / 公共收入） */
.menu-item--parent { justify-content: flex-start; }
.menu-item__caret {
  margin-left: auto; width: 12px !important; font-size: 9px !important;
  color: rgba(255, 255, 255, .55) !important;
  transition: transform .3s var(--ease);
}
.menu-item--parent.is-open .menu-item__caret { transform: rotate(180deg); }
.menu-item--parent.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.submenu {
  overflow: hidden; max-height: 0;
  transition: max-height .38s var(--ease), opacity .3s var(--ease);
  opacity: .01;
}
.submenu.is-open { max-height: 160px; opacity: 1; }
.menu-item--sub { padding-left: 40px; font-size: 13px; }
.menu-item--sub i { width: 14px; font-size: 11px; }
.menu-item--sub.is-active::before { top: 8px; bottom: 8px; }

/* 主区域 */
.admin-main { flex: 1; min-width: 0; margin-left: 244px; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 70; height: 66px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 0 26px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__title { font-family: var(--font-serif); font-size: 16.5px; letter-spacing: .1em; color: var(--navy-900); white-space: nowrap; }
.topbar__crumb { font-size: 11.5px; letter-spacing: .1em; color: var(--text-400); }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.topbar__user { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-700); }
.topbar__avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--grad-blue); color: #fff; font-size: 12px;
  font-family: var(--font-serif); letter-spacing: .02em;
}
.admin-content { padding: 26px; flex: 1; }
@media (max-width: 1023px) { .admin-content { padding: 18px; } }
/* 移动端展开侧边栏按钮：大屏隐藏（选择器加权，确保覆盖 .abtn 的 display） */
@media (min-width: 1024px) { .topbar .topbar__toggle { display: none; } }
@media (max-width: 1023px) { .topbar .topbar__toggle { display: inline-flex; } }

/* 移动端：抽屉 + 遮罩 */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 85; background: rgba(11, 35, 64, .45);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.sidebar-backdrop.is-open { opacity: 1; visibility: visible; }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: none; }
  .admin-main { margin-left: 0; }
}

/* ==========================================================================
   C. 面板 / 卡片 / 表格
   ========================================================================== */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.panel + .panel { margin-top: 20px; }
.panel__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.panel__head h2 { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 1.02rem; letter-spacing: .08em; color: var(--navy-900); }
.panel__head p { margin: 6px 0 0; font-size: 12px; color: var(--text-400); }
.panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel__filter { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-500); }
.panel__filter .field__select { width: auto; padding: 7px 12px; font-size: 12.5px; }
.panel__body { padding: 22px; }
.panel__body--flush { padding: 0; }

/* 概览统计卡 */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
/* 账款页：三列统计 */
@media (min-width: 900px) { .stat-grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* 账款凭证 */
.field__hint { margin-left: 8px; font-size: 11.5px; color: var(--text-400); letter-spacing: 0; }
.voucher-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.voucher-preview .upload-preview { max-width: 260px; max-height: 140px; }
.voucher-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-1);
  font-size: 12.5px; color: var(--text-700); transition: all .3s var(--ease);
}
.voucher-chip i { color: #C0503F; font-size: 14px; }
.voucher-chip:hover { border-color: var(--accent-400); color: var(--accent-600); background: #fff; }

/* 支出类别占比环形图 */
.donut-wrap { display: flex; flex-wrap: wrap; gap: 34px; align-items: center; justify-content: center; }
.donut { position: relative; width: 220px; height: 220px; flex: none; }
.donut__svg { width: 100%; height: 100%; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut__center b { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.2; color: var(--navy-900); }
.donut__center span { margin-top: 2px; font-size: 11px; color: var(--text-400); letter-spacing: .12em; }
.donut-legend { display: flex; flex-direction: column; gap: 11px; min-width: 260px; }
.donut-legend__row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.donut-legend__row i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.donut-legend__name { flex: 1; color: var(--text-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend__amt { font-weight: 500; color: var(--navy-900); white-space: nowrap; }
.donut-legend__pct { color: var(--text-400); width: 42px; text-align: right; white-space: nowrap; }

/* 成本类型分段选择 */
.seg { display: flex; gap: 10px; }
.seg__opt {
  flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer;
  background: #fff; transition: all .3s var(--ease);
}
.seg__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg__opt span { font-size: 13.5px; color: var(--text-700); font-weight: 500; }
.seg__opt small { font-size: 11px; color: var(--text-400); }
.seg__opt:hover { border-color: var(--accent-400); }
.seg__opt:has(input:checked) {
  border-color: var(--accent-500); background: var(--accent-100);
  box-shadow: 0 0 0 3px rgba(60, 125, 224, .12);
}
.seg__opt:has(input:checked) span { color: var(--accent-700); }

/* 员工权限 */
.perm-row { padding: 18px 20px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.perm-row + .perm-row { margin-top: 12px; }
.perm-row__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.perm-row__user { font-family: var(--font-serif); font-size: 1.02rem; color: var(--navy-900); letter-spacing: .04em; }
.perm-row__pages { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.perm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-700); cursor: pointer; }
.perm-check input { accent-color: var(--accent-500); width: 15px; height: 15px; cursor: pointer; }
.perm-check span { line-height: 1; }
.perm-row__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
}

/* 成本柱状图 */
.cost-chart__legend { display: flex; gap: 22px; margin-bottom: 16px; font-size: 12px; color: var(--text-500); }
.cost-chart__legend span { display: inline-flex; align-items: center; gap: 7px; }
.cost-chart__legend .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot--month { background: var(--grad-blue); }
.dot--year { background: var(--navy-700); }
.dot--once { background: var(--accent-200); }

.cost-chart__cols {
  display: flex; align-items: flex-end; gap: 10px;
  height: 220px; padding-top: 8px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%);
}
.cost-col {
  flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center;
  min-width: 0;
}
.cost-col__bars {
  flex: 1; width: 100%; max-width: 46px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
}
.cost-bar { width: 100%; border-radius: 2px 2px 0 0; transition: opacity .2s var(--ease); }
.cost-bar--month { background: var(--grad-blue); }
.cost-bar--year { background: var(--navy-700); }
.cost-bar--once { background: var(--accent-200); }
.cost-bar + .cost-bar { margin-top: 2px; }
.cost-bar:hover { opacity: .82; }
.cost-col__total {
  margin-top: 8px; font-size: 10px; color: var(--text-500); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cost-col__label { margin-top: 2px; font-size: 10.5px; color: var(--text-400); white-space: nowrap; }
@media (max-width: 720px) {
  .cost-chart__cols { gap: 4px; }
  .cost-col__total { display: none; }
}
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.stat-card:hover { border-color: var(--accent-200); box-shadow: var(--shadow-sm); }
.stat-card__label { font-size: 11.5px; letter-spacing: .14em; color: var(--text-400); }
.stat-card__value { margin-top: 12px; font-family: var(--font-serif); font-size: 1.9rem; line-height: 1; color: var(--navy-900); }
.stat-card__foot { margin-top: 12px; font-size: 11.5px; color: var(--accent-600); letter-spacing: .06em; }

/* 数据表 */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
table.table th {
  padding: 12px 16px; text-align: left; white-space: nowrap; font-weight: 500;
  font-size: 11.5px; letter-spacing: .12em; color: var(--text-500);
  background: var(--surface-1); border-bottom: 1px solid var(--line);
}
table.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text-700); vertical-align: middle; }
table.table tbody tr { transition: background-color .25s var(--ease); }
table.table tbody tr:hover { background: var(--surface-1); }
table.table tbody tr:last-child td { border-bottom: 0; }
.td-name { color: var(--navy-900); font-weight: 500; }
.td-thumb { width: 56px; height: 42px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-1); }
.td-num { color: var(--text-400); font-size: 12px; letter-spacing: .06em; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 11px;
  letter-spacing: .1em; border-radius: 3px; border: 1px solid transparent; white-space: nowrap;
}
.badge--on { color: var(--ok); background: rgba(46, 125, 100, .09); border-color: rgba(46, 125, 100, .22); }
.badge--off { color: var(--text-400); background: rgba(147, 165, 186, .1); border-color: var(--line-strong); }
.badge--accent, .badge--wait { color: var(--accent-700); background: var(--accent-100); border-color: var(--accent-200); }
.badge--doing { color: #1E5AA8; background: rgba(60, 125, 224, .12); border-color: rgba(60, 125, 224, .28); }
.badge--done { color: var(--ok); background: rgba(46, 125, 100, .09); border-color: rgba(46, 125, 100, .22); }

/* 表格内小按钮 */
.abtn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  font-size: 12px; letter-spacing: .03em; background: #fff; color: var(--text-700);
  border: 1px solid var(--line-strong); border-radius: 4px;
  transition: all .3s var(--ease); white-space: nowrap;
}
.abtn:hover { border-color: var(--accent-400); color: var(--accent-600); background: var(--surface-1); }
.abtn--danger { color: var(--danger); border-color: rgba(192, 80, 63, .4); }
.abtn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.abtn--solid { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.abtn--solid:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.abtn--primary {
  background-image: var(--grad-blue); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -12px rgba(37, 99, 196, .9);
}
.abtn--primary:hover {
  background-image: linear-gradient(135deg, #2F6FD2 0%, #1F5FC0 100%);
  border-color: transparent; color: #fff;
}

/* 空态 / 加载态 */
.table-empty { padding: 56px 20px; text-align: center; color: var(--text-400); font-size: 13px; letter-spacing: .08em; }
.table-empty i { display: block; font-size: 22px; margin-bottom: 14px; color: var(--accent-300); }

/* 表单栅格（后台弹窗内） */
.form-grid { display: grid; gap: 0 18px; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-grid--full { grid-column: 1 / -1; }

/* 图片上传占位 */
.upload-box {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  padding: 22px; border: 1px dashed var(--line-strong); border-radius: 4px;
  background: var(--surface-1); color: var(--text-400); font-size: 12px; text-align: center; cursor: pointer;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.upload-box:hover { border-color: var(--accent-400); background: var(--accent-100); }
.upload-box i { font-size: 18px; color: var(--accent-500); }
.upload-preview { width: 100%; max-height: 160px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }

/* ==========================================================================
   D. 后台弹窗
   ========================================================================== */
.admin-modal { max-width: 720px; }
.admin-modal--sm { max-width: 520px; }
.admin-modal__head { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.admin-modal__head h3 { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 1.06rem; letter-spacing: .08em; color: var(--navy-900); }
.admin-modal__head p { margin: 7px 0 0; font-size: 12px; color: var(--text-400); }
.admin-modal__body { padding: 22px 26px; max-height: calc(100vh - 260px); overflow-y: auto; }
.admin-modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--surface-1); }

/* 详情列表（线索详情用） */
.detail-list { margin: 0; }
.detail-list div { display: flex; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-list dt { width: 84px; flex: none; color: var(--text-400); letter-spacing: .08em; }
.detail-list dd { margin: 0; color: var(--text-900); line-height: 1.8; word-break: break-word; }

/* 轮播图设置项 */
.slide-row { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-1); }
.slide-row + .slide-row { margin-top: 12px; }
@media (min-width: 768px) { .slide-row { grid-template-columns: 120px 1fr auto; align-items: start; } }
.slide-row__thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; }

/* 首次进入的骨架提示 */
.skeleton { height: 14px; border-radius: 2px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-1) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite linear; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
