/* 校享团演示 · 全局丝滑与去丑化 */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.demo-ribbon,
.demo-badge {
  display: none !important;
}

body.page-enter .content,
body.page-enter .phone-wrap,
body.page-enter .hub {
  animation: pageIn 0.45s var(--ease-out) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.stat-card, .card {
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.btn {
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { box-shadow: 0 2px 8px rgba(82, 196, 26, 0.2); }
.supplier-theme .btn-primary { box-shadow: 0 2px 8px rgba(79, 110, 247, 0.2); }

.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.table-wrap { -webkit-overflow-scrolling: touch; }
tr { transition: background 0.15s ease; }

.demo-tour-dock {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(680px, calc(100vw - 20px));
  padding: 5px 8px 5px 5px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  transition: box-shadow 0.2s var(--ease-out);
}
.demo-tour-dock.on-hub {
  background: rgba(10, 16, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}
.demo-tour-dock.on-bigscreen {
  bottom: 8px;
  background: rgba(2, 18, 8, 0.9);
  border-color: rgba(52, 211, 153, 0.25);
}

.dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.dock-toggle:hover { background: rgba(255, 255, 255, 0.14); }
.dock-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #52c41a;
  box-shadow: 0 0 6px #52c41a;
}
.demo-tour-dock.on-bigscreen .dock-dot { background: #34d399; box-shadow: 0 0 6px #34d399; }
.dock-cur { color: #94a3b8; font-weight: 500; }
.dock-chevron { color: #64748b; font-size: 10px; margin-left: 2px; }

.dock-steps {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: min(520px, calc(100vw - 120px));
}
.dock-steps::-webkit-scrollbar { display: none; }

.dock-step {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  color: #94a3b8;
  background: transparent;
  white-space: nowrap;
  transition: all 0.15s var(--ease-out);
}
.dock-step:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.dock-step.active {
  color: #fff;
  background: linear-gradient(135deg, #334155, #475569);
}
.dock-step.dock-supplier.active {
  background: linear-gradient(135deg, #4f6ef7, #6366f1);
}
.dock-step.dock-mini.active {
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
}
.dock-step.dock-home.active {
  background: linear-gradient(135deg, #52c41a, #73d13d);
}

body.dock-collapsed .dock-steps { display: none; }
body.dock-collapsed .demo-tour-dock { padding-right: 5px; }

/* 折叠时不占布局空间；展开时留一点底边距 */
body.has-tour-dock:not(.dock-collapsed):not(.dock-bigscreen) { padding-bottom: 44px; }
body.has-tour-dock:not(.dock-collapsed) .phone-wrap { padding-bottom: 52px; }
body.dock-bigscreen { padding-bottom: 0 !important; }

/* 旧版白条废弃 */
.demo-tour-bar { display: none !important; }
body.has-tour-bar { padding-bottom: 0 !important; }

.demo-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.demo-path-card {
  display: block;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s var(--ease-out);
}
.demo-path-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.demo-path-card .step-num {
  width: 26px; height: 26px; line-height: 26px;
  text-align: center;
  background: #f6ffed;
  color: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 8px;
}
.demo-path-card h4 { font-size: 14px; margin-bottom: 4px; }
.demo-path-card p { font-size: 12px; color: #888; line-height: 1.45; }

body.bigscreen-mode .particle,
body.bigscreen-mode .scan-line,
body.supplier-bigscreen-mode .particle,
body.supplier-bigscreen-mode .scan-line { display: none; }
body.bigscreen-mode .grid-floor,
body.supplier-bigscreen-mode .grid-floor { animation: none; opacity: 0.45; }

/* 大屏底部 dock 浮在内容之上，不挤布局 */
body.dock-bigscreen .demo-tour-dock { opacity: 0.85; }
body.dock-bigscreen:not(.dock-collapsed) .demo-tour-dock { opacity: 1; }
body.dock-bigscreen .bigscreen-embed-wrap { padding-bottom: 8px !important; }

/* 大屏：深色底，侧栏默认在系统内 */
body.bigscreen-mode,
body.supplier-bigscreen-mode { background: #020818 !important; }
body.supplier-bigscreen-mode { background: #021208 !important; }
body.bigscreen-mode .content,
body.supplier-bigscreen-mode .content { padding: 0 !important; }
body.bigscreen-mode .bigscreen-embed-wrap,
body.supplier-bigscreen-mode .bigscreen-embed-wrap {
  margin: 0 !important;
  padding: 0 !important;
}

.btn-immersive {
  margin-right: 10px;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}
body.bigscreen-mode .btn-immersive {
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
}
body.supplier-bigscreen-mode .btn-immersive {
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}
.btn-immersive:hover { filter: brightness(1.12); }

body.demo-immersive .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease-out), opacity 0.25s;
}
body.demo-immersive .main { margin-left: 0 !important; transition: margin 0.25s var(--ease-out); }
body.demo-immersive .topbar { display: none !important; }
body.demo-immersive .bigscreen { min-height: 100vh !important; }
body.demo-immersive.dock-bigscreen .demo-tour-dock { bottom: 12px; }

body.has-tour-dock:not(.dock-collapsed) .hub { padding-bottom: 72px; }

/* ── 页面讲解提示 ── */
.demo-page-tip {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  animation: tipIn 0.4s var(--ease-out) both;
}
.demo-page-tip.tour-active {
  border-color: rgba(82, 196, 26, 0.45);
  box-shadow: 0 8px 32px rgba(82, 196, 26, 0.12);
}
.demo-page-tip.hidden { display: none; }
.demo-page-tip .tip-icon { flex-shrink: 0; font-size: 14px; }
.demo-page-tip .tip-text { flex: 1; margin: 0; }
.demo-page-tip .tip-close {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s;
}
.demo-page-tip .tip-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
body.dock-collapsed .demo-page-tip { bottom: 48px; }
body.dock-bigscreen .demo-page-tip { bottom: 46px; }
body:not(.has-tour-dock) .demo-page-tip { bottom: 16px; }
@keyframes tipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Toast ── */
.demo-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 10000;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(82, 196, 26, 0.35);
  border-radius: 999px;
  font-size: 13px;
  color: #86efac;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.demo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Dock 增强 ── */
.dock-nav-btn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dock-nav-btn:hover { background: rgba(82,196,26,0.25); color: #fff; transform: scale(1.08); }
.demo-tour-dock.on-tour { border-color: rgba(82,196,26,0.3); }
.dock-tour-badge {
  font-size: 10px;
  font-weight: 700;
  color: #86efac;
  padding: 2px 6px;
  background: rgba(82,196,26,0.15);
  border-radius: 4px;
}
body.dock-collapsed .dock-nav-btn,
body.dock-collapsed .dock-tour-badge { display: none; }

/* ── 页面切换 ── */
body.page-leave .content,
body.page-leave .phone-wrap,
body.page-leave .hub,
body.page-leave .spec-page {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ── 全局交互细节 ── */
a { transition: color 0.15s ease, opacity 0.15s ease; }
.nav-item { transition: background 0.15s ease, padding-left 0.15s ease; }
.nav-item.active { font-weight: 600; }
.nav-item:hover:not(.active) { padding-left: 22px; }
.card { border-radius: 12px; }
.card-header h2 { letter-spacing: -0.02em; }
.topbar {
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary, #52c41a) !important;
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.12);
}
.supplier-theme input:focus,
.supplier-theme select:focus,
.supplier-theme textarea:focus {
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
  border-color: #6366f1 !important;
}
.table-wrap tbody tr:hover { background: rgba(82, 196, 26, 0.04); }
.supplier-theme .table-wrap tbody tr:hover { background: rgba(79, 110, 247, 0.04); }
.task-card, .role-entry { transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out); }
.scan-result.show { animation: scanPop 0.35s var(--ease-out) both; }
@keyframes scanPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* 小程序底部安全区 */
.phone-wrap { transition: padding 0.2s ease; }
body.has-tour-dock:not(.dock-collapsed) .phone-wrap { padding-bottom: 88px !important; }

.chart-bar {
  transform-origin: bottom;
  animation: barGrow 0.55s var(--ease-out) both;
}
@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
