/* 百优统一视觉：与体育管理系统 style.css / portal.css 的品牌变量对应。 */
:root {
  --primary: #003090;
  --primary-2: #1A40A0;
  --primary-3: #4070C8;
  --primary-dark: #002080;
  --primary-soft: #EFF4FC;
  --primary-soft-2: #EFF4FC;
  --accent: #F06000;
  --success: #059669;
  --success-soft: #ECFDF5;
  --warning: #E05500;
  --warning-soft: #FFF5F0;
  --danger: #E11D48;
  --danger-soft: #FFF1F2;
  --info: #0891B2;
  --info-soft: #ECFEFF;
  --sidebar-bg: #003090;
  --sidebar-w: 200px;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-2: #4B5563;
  --text-3: #6B7280;
  --border: #E5E7EB;
  --border-soft: #F3F4F6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  /* 保留旧组件使用的变量名称，统一其视觉。 */
  --grad-primary: linear-gradient(#003090, #003090);
  --grad-success: linear-gradient(#059669, #059669);
  --grad-warning: linear-gradient(#F06000, #F06000);
  --grad-danger: linear-gradient(#E11D48, #E11D48);
  --grad-info: linear-gradient(#0891B2, #0891B2);
}

body { color: #374151; }
.login-page { overflow-y: auto; padding: 32px 16px; min-height: 100dvh; }
.login-bg { position: fixed; background: linear-gradient(135deg, #002080 0%, #003090 50%, #1A40A0 100%); }
.login-bg::before { background: radial-gradient(circle at 20% 80%, rgba(240,96,0,.15), transparent 45%), radial-gradient(circle at 80% 20%, rgba(255,255,255,.1), transparent 45%); }
.login-bg::after { display: none; }
.login-card { width: 400px; max-width: 100%; flex-shrink: 0; background: #fff; border-radius: 14px; padding: 40px 32px 32px; box-shadow: 0 25px 60px rgba(0,0,0,.25); backdrop-filter: none; }
.login-logo-img { max-height: 64px; max-width: 210px; }
.login-title { width: fit-content; max-width: 100%; margin: 18px auto 0; padding: 6px 16px; border-radius: 20px; background: rgba(0,48,144,.1); color: var(--primary); font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.login-sub { font-size: 12px; letter-spacing: 1px; margin: 8px 0 24px; }
.login-form .form-control { padding: 11px 14px; border: 1px solid #D1D5DB; border-radius: 6px; background: #F9FAFB; font-size: 14px; }
.login-form .form-group label { font-size: 12px; font-weight: 600; }
.login-form .form-control:focus, .form-control:focus, .search-box input:focus { border-color: #1A40A0; box-shadow: 0 0 0 3px #EFF4FC; background: #fff; }
.login-form .btn-block { padding: 12px; font-size: 14px; letter-spacing: 1px; }
.login-footer { position: relative; bottom: auto; margin-top: 22px; text-align: center; flex-shrink: 0; color: rgba(255,255,255,.75); }

.sidebar { width: var(--sidebar-w); height: 100dvh; min-height: 0; color: rgba(255,255,255,.85); box-shadow: none; }
.logo { min-height: 80px; padding: 18px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-logo-img { width: 168px; max-width: 100%; height: auto; max-height: 56px; padding: 0; background: transparent; border-radius: 0; box-shadow: none; }
.nav { padding: 14px 8px; gap: 2px; }
.nav-group-label { display: none; }
.nav-item { padding: 10px 14px; font-size: 14px; border-radius: 6px; color: rgba(255,255,255,.85); }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: rgba(240,96,0,.12); color: #fff; font-weight: 600; }
.nav-item.active::before { left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav-icon { width: 18px; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { padding: 8px 4px; gap: 8px; border-radius: 6px; background: transparent; }
.user-avatar { width: 32px; height: 32px; font-size: 13px; background: rgba(255,255,255,.16); }
.user-info strong { color: #fff; font-size: 12px; }
.user-info span { color: rgba(255,255,255,.65); }
.logout-btn { border-radius: 6px; color: rgba(255,255,255,.85); }
.main { margin-left: var(--sidebar-w); min-width: 0; }
.header { height: 64px; padding: 0 24px; background: #fff; backdrop-filter: none; border-bottom: 1px solid var(--border); }
.header-left { min-width: 0; }
.header h1 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.header h1::after { display: none; }
.date-text { font-size: 12px; letter-spacing: 0; }
.menu-toggle { border-radius: 6px; color: var(--primary); }
.content { padding: 20px 24px; min-width: 0; }

.stats-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card, .dash-card, .table-card, .toolbar, .mk-stat { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card { padding: 18px 20px; gap: 12px; }
.stat-card::after { display: none; }
.stat-card:hover { transform: none; box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; }
.stat-label { font-size: 13px; color: #6B7280; margin-bottom: 5px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -.5px; }
.stat-value.gradient-text { background: none; -webkit-text-fill-color: currentColor; }
.stat-card:has(.stat-icon.green) .stat-value { color: var(--success); }
.stat-card:has(.stat-icon.amber) .stat-value { color: var(--accent); }
.stat-card:has(.stat-icon.red) .stat-value { color: var(--danger); }
.stat-sub { margin-top: 6px; font-size: 12px; }
.dash-card h3 { font-size: 15px; font-weight: 700; }
.bar { background: var(--primary); border-radius: 6px 6px 0 0; box-shadow: none; }
.pie-wrap { display: grid; grid-template-columns: minmax(110px, .9fr) minmax(150px, 1.1fr); align-items: center; gap: 16px; min-height: 176px; }
.pie-chart { width: 100%; max-width: 152px; height: auto; aspect-ratio: 1; justify-self: center; }
.pie-chart svg { display: block; overflow: visible; }
.pie-center { pointer-events: none; gap: 3px; }
.pie-center strong { font-size: 30px; line-height: 1.1; font-weight: 650; letter-spacing: -1px; color: #253B59; font-variant-numeric: tabular-nums; }
.pie-center span { font-size: 10px; color: #8492A6; letter-spacing: .3px; }
#memberLegend { gap: 0; min-width: 0; }
#memberLegend .legend-item { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto 40px; gap: 7px; padding: 11px 0; border-bottom: 1px solid #F0F3F7; align-items: center; }
#memberLegend .legend-item:last-child { border-bottom: none; }
#memberLegend .legend-dot { width: 7px; height: 7px; border-radius: 50%; }
#memberLegend .legend-name { font-size: 12px; color: #596B82; }
#memberLegend .legend-val { color: #253B59; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#memberLegend .legend-val small { font-size: 10px; color: #8492A6; margin-left: 3px; font-weight: 400; }
.legend-percent { font-size: 11px; color: #8492A6; text-align: right; font-variant-numeric: tabular-nums; }
.distribution-empty { color: #8492A6; font-size: 12px; text-align: center; }
/* 经营看板数据入口 */
.stat-card-link { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; padding-bottom: 34px; appearance: none; }
.stat-card-link:hover { border-color: #7298C4; background: #FCFDFF; transform: translateY(-2px); }
.stat-card-link:active { transform: translateY(0); }
.stat-card-hint { position: absolute; right: 16px; bottom: 10px; font-size: 11px; font-weight: 500; color: #7290B2; }
.stat-card-link:hover .stat-card-hint { color: var(--primary); }
.dashboard-section-link { margin-left: auto; padding: 4px 0 4px 8px; border: 0; background: transparent; color: #647D9E; font-family: inherit; font-size: 11px; white-space: nowrap; cursor: pointer; }
.dashboard-section-link:hover { color: var(--primary); }
.dashboard-chart-link { cursor: pointer; border-radius: 50%; }
.dashboard-chart-link:hover { background: #F8FAFD; }
.dashboard-bar-link { border: 0; background: transparent; padding: 0 4px; font-family: inherit; cursor: pointer; border-radius: 6px; }
.dashboard-bar-link:hover { background: #EFF4FC; }
.dashboard-bar-link:hover .bar { background: #315B99; }
.dashboard-legend-link, .dashboard-status-link { width: 100%; font-family: inherit; color: inherit; text-align: left; border: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.dashboard-legend-link:hover, .dashboard-status-link:hover { background: #EFF4FC; }
.dashboard-status-link { padding: 8px 6px; margin-bottom: 2px; }
.dashboard-status-link .lb-track, .dashboard-status-link .lb-fill { display: block; }
.dashboard-back { margin-bottom: 14px; }
.dashboard-month-filter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.dashboard-month-filter input { width: 155px; }
.quick-action { background: #fff; border-color: var(--border); border-radius: 10px; }
.quick-action:hover { background: var(--primary-soft); box-shadow: var(--shadow-sm); }
.quick-action .qa-icon { background: var(--primary-soft); border: none; color: var(--primary); }
.expiry-banner { background: var(--warning-soft); border-color: #FFE0D0; border-left: 4px solid var(--accent); box-shadow: none; }
.expiry-banner .eb-icon { background: var(--accent); box-shadow: none; }
.expiry-chip { border-color: #FFE0D0; }

.page-header h2 { font-size: 17px; font-weight: 700; }
.search-box input, .form-control { border-width: 1px; border-radius: 6px; background: #fff; }
.search-box input::placeholder, .form-control::placeholder { color: #9CA3AF; }
thead th { background: #F9FAFB; color: #6B7280; border-bottom-color: var(--border); font-size: 12px; letter-spacing: 0; }
tbody td { padding: 12px 14px; color: #374151; }
tbody tr:hover { background: #F9FAFB; }
.btn, .btn-sm, .btn-icon, .mk-tab { border-radius: 6px; font-weight: 500; }
.btn-primary, .btn-danger, .btn-success { box-shadow: none; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: none; transform: none; }
.btn-danger:hover { background: #F43F5E; box-shadow: none; transform: none; }
.btn-success:hover { background: #10B981; box-shadow: none; transform: none; }
.btn-soft:hover { background: #D0E0F0; }
.btn-sm { padding: 5px 10px; }
.modal { border-radius: 10px; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-header h3::before { background: var(--accent); width: 3px; border-radius: 2px; }
.detail-item, .file-list { background: #F9FAFB; border-radius: 6px; }
.file-item:hover { box-shadow: var(--shadow-sm); }
.mk-stat-icon.indigo { color: var(--primary); background: var(--primary-soft); }
.mk-stat-icon.amber { color: var(--warning); background: var(--warning-soft); }
.toast { border-radius: 10px; }
a:focus-visible, button:focus-visible { outline: 2px solid #4070C8; outline-offset: 3px; }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline-color: #fff; }

@media (max-width: 960px) {
  .main { margin-left: 0; }
  .sidebar { width: 200px; }
  .header { padding: 0 16px; }
  .content { padding: 16px; }
  .menu-toggle { min-height: 36px; min-width: 36px; }
}
@media (max-width: 600px) {
  .login-card { padding: 30px 24px 24px; }
  .login-form .form-control, .form-control, .search-box input { font-size: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 13px 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .stat-card-link { padding-bottom: 34px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-info { width: 100%; }
  .stat-value { font-size: 21px; overflow-wrap: anywhere; }
  .stat-label, .stat-sub { font-size: 12px; }
  .header-right { display: none; }
  .header h1 { font-size: 16px; }
  .dash-card { padding: 14px; min-width: 0; }
  .pie-wrap { grid-template-columns: minmax(110px, .9fr) minmax(150px, 1.1fr); gap: 12px; }
  .legend { min-width: 120px; }
  .bar-chart { gap: 6px; }
  .modal-overlay { padding: 12px; }
  .modal { max-height: 90dvh; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .btn { min-height: 36px; }
  .btn-icon { width: 34px; height: 34px; }
  .toast { max-width: calc(100vw - 36px); }
}
@media (max-height: 620px) {
  .login-page { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
