* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
  font-family: Arial, "Microsoft YaHei", "微软雅黑", sans-serif;
  background: #f4f7fb;
  color: #1f2937;
}
.sidebar { background: #111827; color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 8px; }
.sidebar h1 { font-size: 20px; line-height: 1.3; margin: 0; }
.sidebar-subtitle { margin: 0 0 18px; color: #9ca3af; font-size: 13px; }
.sidebar button, .login-button, .topbar button, .quick-user-button, .quick-user-option { border: 0; border-radius: 6px; cursor: pointer; font-size: 14px; }
.sidebar button { padding: 10px 12px; text-align: left; background: transparent; color: #cbd5e1; }
.sidebar button.active, .sidebar button:hover { background: #2563eb; color: #fff; }
.sidebar button.locked { opacity: .72; }
.main { min-width: 0; }
.topbar { min-height: 60px; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 22px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.topbar-user { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: #0f172a; }
.topbar-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; background: #64748b; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.topbar-avatar.admin { background: #2563eb; }
.topbar-avatar.sale { background: #059669; }
.topbar-avatar.audit { background: #7c3aed; }
.topbar-avatar.guest { background: #64748b; }
.topbar button { padding: 10px 12px; background: #2563eb; color: #fff; }
.content { padding: 22px; }
.login-page { min-height: calc(100vh - 104px); display: grid; place-items: center; }
.login-wrap { width: min(480px, 100%); }
.login-title { margin: 0 0 22px; text-align: center; font-size: 30px; color: #0f172a; line-height: 1.25; }
.login-card { background: #fff; border: 1px solid #dbe3ef; border-radius: 8px; padding: 24px; box-shadow: 0 18px 45px rgba(15, 23, 42, .10); }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .hint { margin: 0 0 18px; color: #64748b; font-size: 14px; }
.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row label { font-weight: 700; font-size: 14px; color: #334155; }
.form-row input { height: 40px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 11px; font-size: 14px; background: #fff; }
.quick-user { position: relative; margin-bottom: 14px; }
.quick-user-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid #cbd5e1; background: #fff; text-align: left; }
.quick-user-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quick-user-text { display: grid; gap: 2px; min-width: 0; }
.quick-user-text strong { color: #0f172a; font-size: 15px; }
.quick-user-text span { color: #64748b; font-size: 13px; }
.quick-user-caret { color: #64748b; font-size: 18px; }
.quick-user-menu { display: none; position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 14px 30px rgba(15, 23, 42, .14); padding: 6px; }
.quick-user.open .quick-user-menu { display: grid; gap: 4px; }
.quick-user-option { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px; background: transparent; text-align: left; }
.quick-user-option:hover, .quick-user-option.active { background: #eff6ff; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.avatar.admin { background: #2563eb; }
.avatar.sale { background: #059669; }
.avatar.audit { background: #7c3aed; }
.login-button { width: 100%; height: 42px; padding: 0 12px; background: #2563eb; color: #fff; font-weight: 700; }
.login-message { display: block; min-height: 20px; margin-top: 10px; color: #b45309; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card, table { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.card { padding: 14px; }
.card strong { display: block; font-size: 24px; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 14px; }
th { background: #f8fafc; }
pre { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 14px; }
.error-box { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 14px; }
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .login-page { min-height: auto; padding: 24px 0; }
  .grid { grid-template-columns: 1fr 1fr; }
}
.page-head { margin-bottom: 18px; }
.page-head h2 { margin-bottom: 6px; }
.page-head p { margin: 0; color: #64748b; }
.demo-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.demo-copy h3 { margin: 0 0 6px; }
.demo-copy p { margin: 0; color: #475569; line-height: 1.6; }
.demo-copy code, .code-note { color: #1d4ed8; font-weight: 700; }
.action-button { border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; font-weight: 700; padding: 10px 14px; white-space: nowrap; }
.secondary-action { border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; cursor: pointer; font-weight: 700; padding: 9px 12px; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.detail-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; min-width: 0; }
.detail-card h3 { margin: 0 0 10px; font-size: 16px; }
.detail-card dl { margin: 0; display: grid; gap: 8px; }
.detail-card div { display: grid; gap: 2px; }
.detail-card dt { color: #64748b; font-size: 12px; }
.detail-card dd { margin: 0; color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }
.demo-result { margin-top: 22px; }
.empty-text { color: #64748b; }
@media (max-width: 900px) {
  .demo-panel { align-items: stretch; flex-direction: column; }
  .action-button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
.with-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.count-pill { background: #e0f2fe; color: #075985; border-radius: 999px; padding: 6px 10px; font-weight: 700; white-space: nowrap; }
.orders-table td, .orders-table th { vertical-align: middle; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.status-badge.new { background: #e0f2fe; color: #075985; }
.status-badge.processing { background: #fef3c7; color: #92400e; }
.status-badge.shipped { background: #dcfce7; color: #166534; }
.status-badge.closed { background: #e0e7ff; color: #3730a3; }
.status-badge.cancelled { background: #fee2e2; color: #991b1b; }
.status-badge.unknown { background: #e5e7eb; color: #374151; }
.table-action, .link-button, .action-button { border: 0; border-radius: 6px; cursor: pointer; font-weight: 700; }
.table-action { background: #eff6ff; color: #1d4ed8; padding: 7px 10px; }
.table-action:hover { background: #dbeafe; }
.link-button { background: transparent; color: #2563eb; padding: 0; margin-bottom: 8px; }
.order-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr); gap: 14px; margin-bottom: 20px; }
.order-summary-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-editor-card p, .section-hint { color: #64748b; line-height: 1.6; margin-top: 0; }
.status-editor-card label { display: block; font-weight: 700; margin-bottom: 6px; color: #334155; }
.status-edit-row { display: flex; gap: 10px; align-items: center; }
.status-edit-row select { flex: 1; height: 40px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 10px; background: #fff; font-size: 14px; }
.form-message { display: block; min-height: 20px; margin-top: 10px; color: #b45309; font-size: 14px; line-height: 1.7; }
.success-message { color: #047857; }
.conflict-message { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; }
@media (max-width: 900px) {
  .with-actions, .status-edit-row { flex-direction: column; align-items: stretch; }
  .order-layout { grid-template-columns: 1fr; }
}
.text-input { width: 100%; height: 40px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 10px; background: #fff; font-size: 14px; margin-bottom: 10px; }
.full-width { width: 100%; }

.gauge-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.gauge-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.gauge-card h3 { margin: 4px 0 0; font-size: 16px; color: #0f172a; }
.gauge-card p { margin: 0; color: #64748b; font-size: 13px; }
.gauge-ring { --value: 0; --gauge-color: #2563eb; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gauge-color) calc(var(--value) * 1%), #e5e7eb 0); position: relative; transition: background .2s linear; }
.gauge-ring::after { content: ""; position: absolute; width: 82px; height: 82px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px #eef2f7; }
.gauge-ring span { position: relative; z-index: 1; font-size: 24px; font-weight: 800; color: #0f172a; }
.gauge-card.good .gauge-ring { --gauge-color: #16a34a; }
.gauge-card.normal .gauge-ring { --gauge-color: #2563eb; }
.gauge-card.warn .gauge-ring { --gauge-color: #f59e0b; }
.gauge-card.risk .gauge-ring { --gauge-color: #dc2626; }
.view-section { margin-top: 20px; }
.view-section h3 { margin-bottom: 6px; }
@media (max-width: 1100px) { .gauge-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); } }
@media (max-width: 640px) { .gauge-grid { grid-template-columns: 1fr; } }

.metric-grid { margin-bottom: 18px; }
.metric-card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.metric-card:hover, .gauge-card:hover, .chart-card:hover { border-color: #bfdbfe; box-shadow: 0 12px 26px rgba(37, 99, 235, .10); transform: translateY(-1px); }
.gauge-ring { transition: background .45s linear; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.chart-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; min-width: 0; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.chart-head h3 { margin: 0 0 4px; color: #0f172a; font-size: 17px; }
.chart-head p { margin: 0; color: #64748b; font-size: 13px; }
.chart-wrap { width: 100%; overflow: hidden; }
.line-chart { width: 100%; height: 230px; display: block; }
.grid-lines line { stroke: #e2e8f0; stroke-width: 1; stroke-dasharray: 4 5; }
.line-area { fill: rgba(37, 99, 235, .16); opacity: 0; animation: chartFadeIn 900ms ease forwards 280ms; }
.line-path { fill: none; stroke: #2563eb; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: drawLine 1800ms cubic-bezier(.2,.8,.2,1) forwards; }
.line-dot { fill: #fff; stroke: #2563eb; stroke-width: 4; opacity: 0; animation: chartFadeIn 700ms ease forwards 1200ms; cursor: help; }
.chart-bar.mini { fill: rgba(22, 163, 74, .28); transform-box: fill-box; transform-origin: bottom; animation: growSvgBar 1500ms cubic-bezier(.2,.8,.2,1) forwards; }
.bar-list { display: grid; gap: 12px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(112px, 1.1fr) minmax(120px, 2fr) 48px; align-items: center; gap: 10px; cursor: help; }
.bar-label { color: #0f172a; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row strong { color: #0f172a; font-size: 13px; text-align: right; }
.bar-track { height: 10px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: #2563eb; animation: growBar 1500ms cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--delay, 0ms); }
.bar-fill.good { background: #16a34a; }
.bar-fill.normal { background: #2563eb; }
.bar-fill.warn { background: #f59e0b; }
.bar-fill.risk { background: #dc2626; }
.dashboard-tooltip { position: fixed; z-index: 999; max-width: 270px; white-space: pre-line; pointer-events: none; background: #fff; color: #0f172a; border: 1px solid #dbe3ef; border-radius: 8px; box-shadow: 0 16px 38px rgba(15,23,42,.16); padding: 12px 14px; font-size: 13px; line-height: 1.55; opacity: 0; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.dashboard-tooltip.show { opacity: 1; transform: translateY(0); }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes chartFadeIn { to { opacity: 1; } }
@keyframes growBar { to { width: var(--target); } }
@keyframes growSvgBar { from { transform: scaleY(0); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr; align-items: stretch; } .bar-row strong { text-align: left; } }


.empty-state { min-height: calc(100vh - 120px); display: grid; place-items: center; align-content: center; justify-items: center; gap: 10px; color: #64748b; text-align: center; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #e5e7eb; color: #94a3b8; font-size: 56px; line-height: 1; font-weight: 300; }
.empty-state h2 { margin: 8px 0 0; color: #334155; font-size: 22px; }
.empty-state p { margin: 0; line-height: 1.8; max-width: 520px; }
.denied-state .empty-icon { background: #e5e7eb; color: #9ca3af; }

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.online-users { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #64748b; font-size: 12px; }
.online-title { font-weight: 700; color: #475569; }
.online-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dbeafe; background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 4px 8px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.14); flex: 0 0 auto; }
@media (max-width: 900px) { .online-users { width: 100%; } }

.team-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.eyebrow {
  margin: 0 0 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.team-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
}
.team-summary article {
  display: flex;
  gap: 10px;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 0;
}
.team-summary article + article {
  border-top: 1px solid #eef2f7;
}
.team-summary span {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 5px #dbeafe;
}
.team-summary p {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.65;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}
.member-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.member-card.lead {
  border-color: #93c5fd;
  box-shadow: 0 16px 36px rgba(37, 99, 235, .12);
}
.member-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.member-card:not(.lead) .member-avatar {
  background: #64748b;
}
.member-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}
.member-card h3 {
  margin: 6px 0 2px;
  color: #0f172a;
  font-size: 22px;
}
.member-card-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.member-card h4 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 16px;
}
.member-summary {
  margin: 0 0 12px;
  color: #475569;
  line-height: 1.7;
}
.member-card ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.75;
}
.member-card li + li {
  margin-top: 5px;
}
@media (max-width: 1100px) {
  .team-summary { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .team-hero {
    flex-direction: column;
  }
  .team-summary,
  .member-grid {
    grid-template-columns: 1fr;
  }
}
