:root {
  --bg-main: #0a0f1e;
  --bg-card: #141b2d;
  --bg-card-2: #1a2238;
  --bg-input: #1f2840;
  --border: #2a3450;
  --text: white;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --green: #22c55e;
  --green-2: #16a34a;
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #eab308;
  --blue: #3b82f6;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --header-bg-1: #0d1224;
  --header-bg-2: #0a0f1e;
  --toggle-bg: #1a2238;
  --avatar-border: #2a3450;
  --tool-bg: rgba(255, 255, 255, 0.06);
  --tool-bg-h: rgba(255, 255, 255, 0.15);
  --stat-icon-bg: rgba(255, 255, 255, 0.05);
  --timeline-grid: rgba(255, 255, 255, 0.02);
  --on-dark: white;
  --green-soft-bg: rgba(34, 197, 94, 0.12);
  --green-soft-text: #22c55e;
  --h5-height: 100vh;
  --chat-bottom: 0;
}
[data-theme="light"] {
  --bg-main: #f0f2f7;
  --bg-card: white;
  --bg-card-2: #f5f7fa;
  --bg-input: #eef1f6;
  --border: #dfe3ea;
  --text: #1a202c;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --green: #16a34a;
  --green-2: #15803d;
  --red: #dc2626;
  --orange: #ea580c;
  --yellow: #ca8a04;
  --blue: #2563eb;
  --purple: #9333ea;
  --cyan: #0891b2;
  --header-bg-1: white;
  --header-bg-2: #f0f2f7;
  --toggle-bg: #eef1f6;
  --avatar-border: #dfe3ea;
  --tool-bg: rgba(0, 0, 0, 0.05);
  --tool-bg-h: rgba(0, 0, 0, 0.1);
  --stat-icon-bg: rgba(0, 0, 0, 0.04);
  --timeline-grid: rgba(0, 0, 0, 0.04);
  --on-dark: white;
  --green-soft-bg: rgba(34, 197, 94, 0.1);
  --green-soft-text: #16a34a;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  background: var(--bg-main);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  background: transparent !important;
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
}
input:disabled {
  background: transparent;
  pointer-events: none;
}
input::placeholder {
  color: var(--text-3);
}
button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
.back::before,
.arrow::before {
  content: "";
  width: 35%;
  height: 35%;
  border: 1px solid var(--text-3);
  border-right: none;
  border-bottom: none;
  transform: translate(-50%, -50%) rotate(-45deg);
  left: 60%;
  top: 50%;
  position: absolute;
}
.back,
.arrow,
.close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: 0.2s;
}
.arrow {
  transform: scale(-1);
}
.close:hover {
  transform: rotate(90deg);
}
.close::before,
.close::after {
  content: "";
  background: var(--text-3);
  width: 60%;
  height: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
  top: 50%;
  left: 50%;
  position: absolute;
}
.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.green,
.going {
  color: var(--green);
}
.red,
.end {
  color: var(--red);
}
.blue {
  color: var(--blue);
}
/* ===== Layout ===== */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}
/* ===== Header ===== */

.header {
  background: linear-gradient(0deg, var(--header-bg-1) 0%, var(--header-bg-2) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
  position: relative;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.logo span {
  color: var(--text);
  margin-left: 4px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin-left: 30px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  position: relative;
  transition: 0.2s;
}
.nav-item:hover {
  color: var(--text);
}
.nav-item.active {
  color: var(--text);
}
.nav-item.active::after {
  content: '';
  background: var(--green);
  width: 50%;
  height: 2px;
  position: absolute;
  bottom: -2px;
  left: 50%;
  right: 16px;
  transform: translateX(-50%);
  border-radius: 2px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.loginbtn {
  background: var(--toggle-bg);
  font-size: 14px;
  padding: 5px 16px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: 0.2s;
}
.loginbtn:hover {
  background: var(--avatar-border);
}
.avatar {
  background: var(--toggle-bg);
  color: rgba(255, 255, 255, 0.75);
  width: 38px;
  height: 38px;
  border: 2px solid var(--avatar-border);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s;
}
.avatar:hover {
  transform: scale(1.1);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar .icon {
  width: 24px;
  height: 24px;
  margin: 0 auto;
  opacity: 0.7;
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--toggle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: 0.2s;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover {
  color: var(--text);
}
.theme-toggle svg {
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.theme-toggle .sun {
  display: none;
  position: absolute;
}
[data-theme="light"] .theme-toggle .sun {
  display: block;
}
[data-theme="light"] .theme-toggle .moon {
  display: none;
}
/* ===== 第三方弹框/播放器 ===== */

.swal2-html-container,
.swal2-title {
  color: var(--text);
}
.swal2-confirm {
  background: var(--green);
  border: none;
  transition: 0.2s;
}
.swal2-confirm:hover {
  background: var(--green-2);
}
/* ===== Footer ===== */

.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 30px;
}
/* ===== Scrollbar ===== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2a3450;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4570;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
/* ===== Responsive ===== */

@media (max-width: 1024px) {
  .container {
    padding: 0 14px;
  }
}
@media (max-width: 768px) {
  .container {
    padding: 0;
  }
  .container.newH5 {
    height: calc(var(--h5-height) - 51px);
  }
  .container.header-inner {
    gap: 12px;
    height: 50px;
    padding: 0 10px;
  }
  .nav-item.active::after {
    width: 35%;
  }
  .logo {
    font-size: 18px;
  }
  .nav {
    gap: 0;
    margin-left: 10px;
  }
  .nav-item {
    padding: 8px 10px;
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .avatar {
    width: 32px;
    height: 32px;
  }
  .avatar .icon {
    width: 20px;
    height: 20px;
  }
  .theme-toggle {
    width: 32px;
    height: 32px;
  }
  .footer {
    font-size: 11px;
    padding: 14px;
  }
}
