/* ==========================================================================
   app-theme.css — 全站统一视觉层（前台 index/ 与后台 admin/ 共用）
   风格：现代渐变 + 玻璃拟态 + 大圆角 + 柔和扩散阴影
   设计令牌统一在 :root 定义，改色只需要改这一处。
   作用域：挂在 <body class="app-theme"> 上，避免污染第三方组件默认样式。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌 Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* 品牌渐变主色：靛蓝 → 紫 */
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* 辅助色 */
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --fuchsia-500: #a855f7;
  --cyan-500: #06b6d4;
  --sky-500: #0ea5e9;

  /* 功能色 */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --info-500: #3b82f6;

  /* 中性色 */
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;

  /* 主渐变 */
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --grad-brand-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(99, 102, 241, .12) 0%, rgba(168, 85, 247, .12) 100%);
  --grad-accent: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  --grad-sidebar: linear-gradient(175deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 26px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-md: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --sh-lg: 0 12px 28px -8px rgba(79, 70, 229, .18), 0 4px 10px -4px rgba(15, 23, 42, .06);
  --sh-xl: 0 24px 48px -12px rgba(79, 70, 229, .24), 0 8px 16px -8px rgba(15, 23, 42, .08);
  --sh-glow: 0 8px 24px -6px rgba(99, 102, 241, .45);

  /* 间距节奏 */
  --gap: 24px;

  /* 布局尺寸 */
  --sidebar-w: 264px;
  --topbar-h: 68px;

  /* 动效曲线 */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* 玻璃卡片基础 */
  --glass-bg: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .7);
}

/* --------------------------------------------------------------------------
   2. 基础基底
   -------------------------------------------------------------------------- */
body.app-theme {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-700);
  background-color: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 背景装饰光斑 — 定位到 fixed 层，避免撑开滚动高度 */
  background-image:
    radial-gradient(900px 520px at 8% -8%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(760px 460px at 96% 4%, rgba(168, 85, 247, .14), transparent 60%),
    radial-gradient(680px 420px at 50% 108%, rgba(34, 211, 238, .10), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.app-theme ::selection {
  background: rgba(99, 102, 241, .22);
  color: var(--brand-900);
}

body.app-theme a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color .2s var(--ease);
}

body.app-theme a:hover,
body.app-theme a:focus {
  color: var(--violet-600);
  text-decoration: none;
}

body.app-theme h1,
body.app-theme h2,
body.app-theme h3,
body.app-theme h4,
body.app-theme h5 {
  color: var(--ink-900);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
}

/* 细滚动条 */
body.app-theme ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.app-theme ::-webkit-scrollbar-track {
  background: transparent;
}

body.app-theme ::-webkit-scrollbar-thumb {
  background: var(--ink-300);
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-clip: content-box;
}

body.app-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--brand-300);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. 应用外壳布局 App Shell
   -------------------------------------------------------------------------- */
.app-shell {
  display: block;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, .82);
  background: var(--grad-sidebar);
  box-shadow: 4px 0 24px -8px rgba(49, 46, 129, .35);
  transition: transform .32s var(--ease-out);
}

/* 侧栏顶部光晕 */
.app-sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 280px;
  background: radial-gradient(600px 260px at 20% 0%, rgba(255, 255, 255, .22), transparent 70%);
  pointer-events: none;
}

.app-sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 22px;
  flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-sidebar-brand img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-sidebar-brand .app-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-scroll {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px 24px;
}

.app-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .24);
  background-clip: content-box;
}

.app-nav-label {
  margin: 18px 12px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}

.app-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-nav li {
  margin: 0;
}

.app-nav>li>a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 4px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .78);
  cursor: pointer;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}

.app-nav>li>a>i {
  width: 20px;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  opacity: .85;
}

.app-nav>li>a:hover,
.app-nav>li>a:focus {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: translateX(2px);
}

/* 当前页高亮：左侧发光条 + 玻璃块 */
.app-nav>li>a.active {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.app-nav>li>a.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: #fff;
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, .6);
}

.app-nav>li>a.active>i {
  opacity: 1;
}

/* 二级菜单 */
.app-nav .app-submenu {
  list-style: none;
  margin: 0 0 6px;
  padding: 2px 0 2px 34px;
}

.app-nav .app-submenu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: rgba(255, 255, 255, .62);
  transition: all .2s var(--ease);
}

.app-nav .app-submenu a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.app-nav .app-submenu a.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, .1);
}

.app-sidebar-footer {
  flex: none;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
}

.app-sidebar-footer a {
  color: rgba(255, 255, 255, .7);
}

/* 主区域 */
.app-body {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left .32s var(--ease-out);
}

/* 顶栏 */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
}

.app-topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0;
  white-space: nowrap;
}

.app-topbar-subtitle {
  font-size: 12.5px;
  color: var(--ink-400);
  margin: 0;
}

.app-topbar-spacer {
  flex: 1 1 auto;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 汉堡按钮 */
.app-toggler {
  display: none;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink-600);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all .2s var(--ease);
}

.app-toggler:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  box-shadow: var(--sh-sm);
}

.app-toggler .bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  margin: 2px 0;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}

/* 顶部头像 */
.app-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--brand-200);
  background: var(--brand-50);
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-600);
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--ink-200);
  transition: all .22s var(--ease);
}

a.app-chip:hover {
  color: var(--brand-700);
  border-color: var(--brand-300);
  background: var(--brand-50);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.app-chip.is-gradient {
  color: #fff;
  border-color: transparent;
  background: var(--grad-brand);
  box-shadow: var(--sh-glow);
}

a.app-chip.is-gradient:hover {
  color: #fff;
  background: var(--grad-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(99, 102, 241, .55);
}

/* 主内容容器 */
.app-content {
  flex: 1 1 auto;
  padding: 28px 24px 40px;
}

/* 兼容历史页面里的 .main-content 包裹层 */
.app-content .main-content,
.app-content .main-content-inner {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100%;
}

.app-content .container {
  padding-left: 0;
  padding-right: 0;
  max-width: 1240px;
}

/* 页面头部 Hero */
.app-page-head {
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
  padding: 26px 30px;
  border-radius: var(--r-2xl);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--sh-lg);
}

.app-page-head::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 68%);
}

.app-page-head::after {
  content: "";
  position: absolute;
  bottom: -70px;
  left: 22%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 66%);
}

.app-page-head>* {
  position: relative;
  z-index: 1;
}

.app-page-head h1,
.app-page-head h2,
.app-page-head .app-page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.015em;
}

.app-page-head p {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .82);
}

.app-page-head .app-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .7);
}

.app-page-head .app-crumb a {
  color: rgba(255, 255, 255, .85);
}

.app-page-head .app-crumb a:hover {
  color: #fff;
  text-decoration: underline;
}

/* 移动端遮罩 */
.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .28s var(--ease);
}

.app-shell.nav-open .app-sidebar-backdrop {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. 卡片 / 玻璃面板
   -------------------------------------------------------------------------- */
.app-theme .card {
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--r-xl);
  background: var(--glass-bg);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--sh-lg);
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out);
  overflow: hidden;
}

.app-theme .card:hover {
  box-shadow: var(--sh-xl);
}

.app-theme .card>.card-body {
  padding: 26px;
  border-radius: inherit;
}

.app-theme .card>.card-header {
  padding: 18px 26px;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: linear-gradient(180deg, rgba(248, 250, 252, .9), rgba(255, 255, 255, .4));
  font-weight: 700;
  color: var(--ink-800);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.app-theme .card>.card-footer {
  padding: 16px 26px;
  border-top: 1px solid rgba(226, 232, 240, .9);
  background: rgba(248, 250, 252, .6);
}

/* 卡片标题（兼容各页面已有的 .card_title） */
.app-theme .card_title,
.app-theme .app-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -.01em;
}

.app-theme .card_title::after,
.app-theme .app-card-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 44px;
  margin-top: 8px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
}

.app-theme .card_title>i,
.app-theme .app-card-title>i {
  color: var(--brand-500);
}

/* --------------------------------------------------------------------------
   5. 按钮
   -------------------------------------------------------------------------- */
.app-theme .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .22s var(--ease);
  white-space: nowrap;
}

.app-theme .btn:active {
  transform: translateY(1px);
}

.app-theme .btn-primary {
  color: #fff;
  border: none;
  background: var(--grad-brand);
  background-size: 150% 150%;
  box-shadow: var(--sh-glow);
}

.app-theme .btn-primary:hover,
.app-theme .btn-primary:focus {
  color: #fff;
  background: var(--grad-brand-hover);
  box-shadow: 0 12px 28px -6px rgba(99, 102, 241, .55);
  transform: translateY(-2px);
}

.app-theme .btn-primary:not(:disabled):not(.disabled):active {
  color: #fff;
  background: var(--grad-brand-hover);
  box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .45);
}

.app-theme .btn-secondary,
.app-theme .btn-default,
.app-theme .btn-outline-secondary {
  color: var(--ink-600);
  background: #fff;
  border-color: var(--ink-200);
}

.app-theme .btn-secondary:hover,
.app-theme .btn-default:hover,
.app-theme .btn-outline-secondary:hover {
  color: var(--brand-700);
  border-color: var(--brand-300);
  background: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.app-theme .btn-info {
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .45);
}

.app-theme .btn-success {
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 20px -6px rgba(5, 150, 105, .45);
}

.app-theme .btn-warning {
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 8px 20px -6px rgba(217, 119, 6, .45);
}

.app-theme .btn-danger {
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #fb7185, #dc2626);
  box-shadow: 0 8px 20px -6px rgba(220, 38, 38, .45);
}

.app-theme .btn-info:hover,
.app-theme .btn-success:hover,
.app-theme .btn-warning:hover,
.app-theme .btn-danger:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.app-theme .btn-block {
  width: 100%;
  padding-top: 13px;
  padding-bottom: 13px;
  font-size: 15.5px;
}

.app-theme .btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--r-sm);
}

.app-theme .btn-lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: var(--r-lg);
}

/* --------------------------------------------------------------------------
   6. 表单控件
   -------------------------------------------------------------------------- */
.app-theme .form-group {
  margin-bottom: 20px;
}

.app-theme label,
.app-theme .col-form-label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
}

.app-theme .form-control,
.app-theme input[type="text"].form-control,
.app-theme input[type="email"].form-control,
.app-theme select.form-control,
.app-theme textarea.form-control {
  width: 100%;
  height: auto;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ink-800);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--sh-xs);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.app-theme .form-control::placeholder {
  color: var(--ink-400);
}

.app-theme .form-control:hover {
  border-color: var(--ink-300);
}

.app-theme .form-control:focus {
  border-color: var(--brand-400);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .16);
  outline: none;
}

.app-theme select.form-control {
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.app-theme .form-text,
.app-theme small.form-text,
.app-theme .text-muted {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-400) !important;
}

.app-theme .input-group>.form-control {
  border-radius: var(--r-md) 0 0 var(--r-md);
}

.app-theme .input-group-append>.btn,
.app-theme .input-group-prepend>.btn {
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* 支付/套餐选择：可访问的 radio 卡片 */
.app-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.app-choice input[type="radio"],
.app-choice input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-choice-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .85);
  box-shadow: var(--sh-xs);
  transition: all .24s var(--ease);
}

.app-choice-body img {
  max-height: 30px;
  border-radius: var(--r-xs);
  filter: grayscale(35%);
  opacity: .72;
  transition: all .24s var(--ease);
}

.app-choice:hover .app-choice-body {
  border-color: var(--brand-300);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.app-choice input:checked+.app-choice-body {
  border-color: var(--brand-500);
  background: linear-gradient(135deg, rgba(99, 102, 241, .1), rgba(168, 85, 247, .1));
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .13), var(--sh-md);
}

.app-choice input:checked+.app-choice-body img {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.04);
}

.app-choice input:focus-visible+.app-choice-body {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
}

.app-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* 焦点可见性统一 */
.app-theme a:focus-visible,
.app-theme button:focus-visible,
.app-theme input:focus-visible,
.app-theme select:focus-visible,
.app-theme .btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   7. 表格
   -------------------------------------------------------------------------- */
.app-theme .table {
  width: 100%;
  margin-bottom: 0;
  color: var(--ink-700);
  border-collapse: separate;
  border-spacing: 0;
}

.app-theme .table>thead>tr>th {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--brand-800);
  white-space: nowrap;
  text-transform: none;
  background: linear-gradient(180deg, #eef2ff, #f5f3ff);
  border: none;
  border-bottom: 1px solid var(--ink-200);
}

.app-theme .table>tbody>tr>td {
  padding: 14px 18px;
  font-size: 14px;
  vertical-align: middle;
  border-top: 1px solid var(--ink-100);
  transition: background .18s var(--ease);
}

.app-theme .table>tbody>tr:hover>td {
  background: linear-gradient(90deg, rgba(99, 102, 241, .05), rgba(168, 85, 247, .04));
}

.app-theme .table>tbody>tr:last-child>td:first-child {
  border-bottom-left-radius: var(--r-lg);
}

.app-theme .table>tbody>tr:last-child>td:last-child {
  border-bottom-right-radius: var(--r-lg);
}

.app-theme .table-striped>tbody>tr:nth-of-type(odd)>td {
  background: rgba(248, 250, 252, .55);
}

.app-theme .table-responsive {
  border-radius: var(--r-lg);
}

/* DataTables 边角适配 */
.app-theme .dataTables_wrapper .dataTables_filter input,
.app-theme .dataTables_wrapper .dataTables_length select {
  display: inline-block;
  width: auto;
  margin-left: 8px;
  padding: 7px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 14px;
}

.app-theme .dataTables_wrapper .dataTables_info,
.app-theme .dataTables_wrapper .dataTables_length,
.app-theme .dataTables_wrapper .dataTables_filter {
  color: var(--ink-500);
  font-size: 13.5px;
  padding: 12px 4px;
}

.app-theme .dataTables_wrapper .pagination .page-item .page-link {
  border: none;
  margin: 0 3px;
  border-radius: var(--r-sm);
  color: var(--ink-600);
  font-size: 14px;
  transition: all .2s var(--ease);
}

.app-theme .dataTables_wrapper .pagination .page-item .page-link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.app-theme .dataTables_wrapper .pagination .page-item.active .page-link {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--sh-glow);
}

/* --------------------------------------------------------------------------
   8. 徽章 / 提示条
   -------------------------------------------------------------------------- */
.app-theme .badge {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

/* 柔和状态徽章（前台/后台状态列统一用） */
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.app-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.app-badge-success {
  color: var(--success-600);
  background: var(--success-50);
}

.app-badge-warning {
  color: var(--warning-600);
  background: var(--warning-50);
}

.app-badge-danger {
  color: var(--danger-600);
  background: var(--danger-50);
}

.app-badge-info {
  color: #1d4ed8;
  background: #eff6ff;
}

.app-badge-neutral {
  color: var(--ink-500);
  background: var(--ink-100);
}

.app-theme .alert {
  padding: 15px 20px;
  border: none;
  border-radius: var(--r-lg);
  border-left: 4px solid;
  font-size: 14.5px;
  box-shadow: var(--sh-sm);
}

.app-theme .alert-success {
  color: #065f46;
  background: var(--success-50);
  border-left-color: var(--success-500);
}

.app-theme .alert-danger {
  color: #991b1b;
  background: var(--danger-50);
  border-left-color: var(--danger-500);
}

.app-theme .alert-warning {
  color: #92400e;
  background: var(--warning-50);
  border-left-color: var(--warning-500);
}

.app-theme .alert-info {
  color: #1e40af;
  background: #eff6ff;
  border-left-color: var(--info-500);
}

/* --------------------------------------------------------------------------
   9. 统计卡片 / 空状态
   -------------------------------------------------------------------------- */
.app-stat {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, .8);
  background: var(--glass-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: var(--sh-lg);
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out);
}

.app-stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-xl);
}

.app-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-500);
}

.app-stat-value {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink-900);
}

.app-stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: var(--r-lg);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--sh-glow);
}

.app-stat.tone-cyan .app-stat-icon {
  background: var(--grad-accent);
  box-shadow: 0 8px 22px -6px rgba(6, 182, 212, .5);
}

.app-stat.tone-warn .app-stat-icon {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 8px 22px -6px rgba(249, 115, 22, .5);
}

.app-stat.tone-good .app-stat-icon {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 22px -6px rgba(5, 150, 105, .5);
}

.app-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-400);
}

.app-empty i {
  font-size: 46px;
  line-height: 1;
  color: var(--brand-300);
  opacity: .65;
}

.app-empty p {
  margin: 14px 0 0;
  font-size: 14.5px;
}

/* --------------------------------------------------------------------------
   10. 页脚
   -------------------------------------------------------------------------- */
.app-footer {
  flex: none;
  padding: 18px 24px;
  border-top: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-400);
}

.app-footer-inner a {
  color: var(--ink-500);
}

.app-footer-inner a:hover {
  color: var(--brand-600);
}

/* --------------------------------------------------------------------------
   11. 动效 keyframes
   -------------------------------------------------------------------------- */
@keyframes appFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes appFloatSlow {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.app-animate-in {
  animation: appFadeUp .5s var(--ease-out) both;
}

.app-animate-in:nth-child(2) {
  animation-delay: .06s;
}

.app-animate-in:nth-child(3) {
  animation-delay: .12s;
}

.app-animate-in:nth-child(4) {
  animation-delay: .18s;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------------------
   13. 行内代码 / 工具栏 / 登录页
   -------------------------------------------------------------------------- */
.app-theme code {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--violet-600);
    background: var(--brand-50);
}

.app-theme pre {
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--ink-900);
    color: #e2e8f0;
    overflow-x: auto;
}

/* 卡片工具栏：标题在左、操作在右 */
.app-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.app-toolbar .card_title {
    margin-bottom: 0;
}

.app-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 表格里的操作按钮组 */
.app-row-actions {
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}

/* 登录页 */
.app-auth {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
}

.app-auth::before {
    content: "";
    position: absolute;
    top: -140px;
    left: -120px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 68%);
}

.app-auth::after {
    content: "";
    position: absolute;
    bottom: -180px;
    right: -140px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, .28), transparent 66%);
}

.app-auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 38px 34px 30px;
    border-radius: var(--r-2xl);
    background: rgba(255, 255, 255, .93);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45);
    animation: appFadeUp .55s var(--ease-out) both;
}

.app-auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.app-auth-brand img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.app-auth-brand h1 {
    margin: 14px 0 4px;
    font-size: 21px;
    font-weight: 700;
    color: var(--ink-900);
}

.app-auth-brand p {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink-400);
}

.app-auth-back {
    display: block;
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-500);
}

.app-auth-back:hover {
    color: var(--brand-600);
}

@media (max-width: 575.98px) {
    .app-auth-card {
        padding: 30px 22px 24px;
    }
}

/* --------------------------------------------------------------------------
   12. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .app-content {
    padding: 24px 20px 34px;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .app-shell.nav-open .app-sidebar {
    transform: none;
    box-shadow: 0 0 40px rgba(15, 23, 42, .35);
  }

  .app-shell.nav-open .app-sidebar-backdrop {
    display: block;
  }

  .app-body {
    margin-left: 0;
  }

  .app-toggler {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .app-topbar {
    padding: 0 16px;
  }

  .app-theme .card>.card-body {
    padding: 20px;
  }

  .app-content {
    padding: 20px 16px 30px;
  }

  .app-page-head {
    padding: 22px;
    border-radius: var(--r-xl);
  }

  .app-page-head h1,
  .app-page-head .app-page-title {
    font-size: 20px;
  }
}

@media (max-width: 575.98px) {
  .app-topbar-title {
    font-size: 15px;
  }

  .app-stat-value {
    font-size: 26px;
  }

  .app-choice-grid {
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  }

  .app-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
