:root {
  --bg-app: #070916;
  --bg-deep: #050712;
  --bg-panel: rgba(8, 14, 32, 0.9);
  --bg-panel-raised: rgba(11, 22, 48, 0.92);
  --bg-input: rgba(5, 13, 31, 0.82);
  --accent-cyan: #16dbfe;
  --accent-blue: #167afe;
  --accent-bright: #56e7ff;
  --text-primary: #f4f8ff;
  --text-secondary: #b9c8dd;
  --text-muted: #7d91ad;
  --line: rgba(76, 151, 238, 0.48);
  --line-soft: rgba(88, 151, 220, 0.2);
  --glow: 0 0 14px rgba(22, 219, 254, 0.35);
  --glow-strong: 0 0 22px rgba(22, 122, 254, 0.56);
  --sidebar: 180px;
  --header: 70px;
  --danger: #ff6875;
  --success: #22d06b;
  --warning: #ffc928;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--text-primary);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

body {
  overflow: hidden;
  background: var(--bg-app);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

.is-hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(2, 8, 20, 0.5);
}

::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(56, 135, 226, 0.55);
}

/* ==================== 登录 ==================== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #07101c url("./assets/login-bg-dark.png") center / cover no-repeat;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 9, 20, 0.04), transparent 55%, rgba(2, 7, 17, 0.18)),
    radial-gradient(circle at 74% 52%, rgba(20, 113, 255, 0.08), transparent 34%);
}

.login-brand {
  position: absolute;
  top: 62px;
  left: 108px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 1.9px;
}

.login-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform: translateY(1px);
}

.login-brand span {
  transform: translateY(-1px) scaleY(0.99);
  transform-origin: center;
}

.login-card {
  position: absolute;
  top: calc(22% + 1px);
  right: calc(5.9% - 1px);
  z-index: 3;
  width: 466px;
  height: 565px;
  padding: 40px 38px 48px;
  border: 1px solid rgba(67, 151, 255, 0.9);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(8, 18, 39, 0.42), rgba(5, 13, 31, 0.5)),
    radial-gradient(circle at 50% 0, rgba(41, 126, 255, 0.12), transparent 48%);
  box-shadow:
    inset 0 0 30px rgba(20, 113, 255, 0.18),
    0 0 12px rgba(22, 219, 254, 0.8),
    0 0 36px rgba(20, 113, 255, 0.42);
}

.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-card::before {
  top: -2px;
  right: 28px;
  left: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 14px var(--accent-cyan);
}

.login-card::after {
  right: 0;
  bottom: -2px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #168bff, transparent);
  box-shadow: 0 0 13px #168bff;
}

.login-card h1 {
  margin: 0 0 41px;
  color: #fff;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 1.7px;
  text-align: center;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.16);
}

.login-card form {
  display: flex;
  flex-direction: column;
}

.login-card label {
  margin: 0 0 19px;
  color: #edf4ff;
  font-size: 24px;
  line-height: 1;
  transform: scaleY(1.05);
  transform-origin: left center;
}

.login-card label[for="account"] {
  margin-bottom: 26px;
}

.login-card input {
  width: 100%;
  height: 65px;
  margin: 0 0 30px;
  padding: 0 32px;
  border: 2px solid #77a0ff;
  border-radius: 0;
  outline: none;
  color: #fff;
  font-size: 19.5px;
  letter-spacing: -0.1px;
  background: rgba(7, 17, 33, 0.28);
  box-shadow:
    inset 0 0 18px rgba(25, 83, 155, 0.14),
    0 0 8px rgba(22, 122, 254, 0.16);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-card input::placeholder {
  color: rgba(226, 235, 247, 0.78);
}

.login-card input:focus {
  border-color: var(--accent-cyan);
  background: rgba(5, 17, 39, 0.86);
  box-shadow:
    inset 0 0 20px rgba(22, 122, 254, 0.18),
    0 0 13px rgba(22, 219, 254, 0.44);
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow:
    inset 0 0 0 1000px #071126,
    inset 0 0 18px rgba(25, 83, 155, 0.14),
    0 0 8px rgba(22, 122, 254, 0.16);
  transition: background-color 9999s ease-out;
}

.login-button {
  position: relative;
  width: calc(100% + 4px);
  height: 75px;
  margin-top: 16px;
  margin-left: -2px;
  overflow: hidden;
  border: 1px solid rgba(85, 157, 255, 0.95);
  border-radius: 0;
  color: #fff;
  font-size: 31.2px;
  background:
    linear-gradient(180deg, rgba(3, 64, 119, 0.82), rgba(2, 43, 84, 0.92)),
    #023462;
  box-shadow:
    inset 0 0 22px rgba(22, 122, 254, 0.22),
    0 0 13px rgba(22, 122, 254, 0.8),
    0 17px 28px rgba(0, 0, 0, 0.35);
  transition: filter 0.18s, transform 0.18s;
}

.login-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.16) 48%, transparent 72%);
  transform: translateX(-110%);
  transition: transform 0.45s ease;
}

.login-button:hover {
  filter: brightness(1.16);
}

.login-button:hover::before {
  transform: translateX(110%);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-button span {
  position: relative;
  z-index: 1;
  display: inline-block;
  transform: translate(0, -1px) scaleY(1.04);
  transform-origin: center;
}

.login-error {
  margin: -23px 0 8px;
  color: #ff7a86;
  font-size: 13px;
  text-align: left;
}

/* ==================== 公共框架 ==================== */
.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 62% 34% at 56% 0%, rgba(23, 79, 153, 0.28), transparent 68%),
    linear-gradient(180deg, #091328 0%, #080d1e 58%, var(--bg-app) 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  top: -12px;
  left: -137px;
  z-index: 0;
  width: 2039px;
  height: 1147px;
  pointer-events: none;
  opacity: 0.25;
  background: url("./assets/tech-bg.png") center / 100% 100% no-repeat;
  mix-blend-mode: plus-lighter;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  padding: 28px 0 24px;
  overflow: visible;
  border: 1px solid rgba(79, 163, 255, 0.82);
  border-left-color: rgba(54, 137, 245, 0.72);
  border-radius: 0 22px 22px 0;
  background:
    radial-gradient(circle at 12% 2%, rgba(65, 135, 242, 0.3), transparent 29%),
    linear-gradient(180deg, rgba(15, 29, 68, 0.92), rgba(11, 20, 49, 0.96)),
    var(--bg-deep);
  box-shadow:
    inset 24px 0 45px rgba(56, 119, 226, 0.44),
    inset -12px 0 34px rgba(17, 94, 178, 0.28),
    4px 0 7px rgba(164, 248, 255, 0.58),
    10px 0 22px rgba(22, 219, 254, 0.72),
    22px 0 34px rgba(22, 122, 254, 0.5);
  transition: transform 0.25s ease;
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sidebar::before {
  inset: 0;
  opacity: 0.68;
  background:
    linear-gradient(90deg, rgba(67, 139, 250, 0.36), transparent 24% 82%, rgba(36, 124, 225, 0.18)),
    radial-gradient(circle at 112% 50%, rgba(22, 122, 254, 0.42), transparent 38%);
}

.sidebar::after {
  top: 0;
  right: -6px;
  bottom: 0;
  width: 5px;
  background: linear-gradient(
    90deg,
    #7ad7f5 0%,
    #fff 25%,
    #a8f7ff 50%,
    #55cced 75%,
    #168bc9 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.88) 2%,
    rgba(0, 0, 0, 0.58) 16%,
    rgba(0, 0, 0, 0.82) 44%,
    #000 55%,
    rgba(0, 0, 0, 0.9) 62%,
    rgba(0, 0, 0, 0.64) 86%,
    #000 99%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.88) 2%,
    rgba(0, 0, 0, 0.58) 16%,
    rgba(0, 0, 0, 0.82) 44%,
    #000 55%,
    rgba(0, 0, 0, 0.9) 62%,
    rgba(0, 0, 0, 0.64) 86%,
    #000 99%,
    transparent 100%
  );
  filter:
    brightness(1.14)
    drop-shadow(-2px 0 5px rgba(218, 253, 255, 0.92))
    drop-shadow(5px 0 9px rgba(22, 219, 254, 0.86))
    drop-shadow(14px 0 22px rgba(22, 122, 254, 0.48));
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  height: 34px;
  padding: 0 12px;
  color: #f2f8ff;
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(5px, -7px);
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transform: translateX(-2px);
}

.brand span {
  transform: translateY(-2px) scale(0.98, 0.93);
  transform-origin: left center;
}

.app-shell:has(#page-ai) .brand {
  transform: translate(0, -9px);
}

.side-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 72px;
  padding: 0 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 0 4px 4px 0;
  color: #a9b7cb;
  font-size: 16px;
  white-space: nowrap;
  background: transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.nav-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-item span {
  transform: translateY(-2px);
}

.nav-item:hover {
  color: #e7f7ff;
  border-color: rgba(22, 122, 254, 0.36);
  background: rgba(13, 68, 126, 0.22);
}

.nav-item.is-active {
  color: #fff;
  border-color: rgba(22, 219, 254, 0.9);
  background: linear-gradient(90deg, rgba(20, 113, 255, 0.42), rgba(20, 113, 255, 0.08));
  box-shadow:
    inset 0 0 16px rgba(22, 122, 254, 0.38),
    0 0 12px rgba(22, 219, 254, 0.3);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  top: 7px;
  right: -1px;
  bottom: 7px;
  width: 1px;
  background: var(--accent-cyan);
  box-shadow: 0 0 9px var(--accent-cyan);
}

.nav-item.is-active[href="/stock"] img,
.nav-item.is-active[href="/system"] img {
  filter: brightness(1.7) sepia(1) hue-rotate(145deg) saturate(5);
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar);
  z-index: 20;
  display: flex;
  align-items: center;
  height: var(--header);
  padding: 0 24px;
  border-bottom: 1px solid rgba(56, 127, 209, 0.42);
  background: rgba(5, 8, 20, 0.42);
  box-shadow:
    0 5px 20px rgba(2, 8, 20, 0.3),
    0 7px 18px rgba(22, 122, 254, 0.15);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -1px;
  left: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(22, 219, 254, 0.75) 42%, rgba(22, 122, 254, 0.42) 76%, transparent);
  box-shadow: 0 0 9px rgba(22, 219, 254, 0.55);
}

.topbar h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  transform: translate(1px, 3px) scale(0.982, 1);
  transform-origin: left center;
}

.app-shell:has(#page-home) .topbar h2 {
  transform: translate(1px, 2px) scale(0.956, 0.98);
}

.app-shell:has(#page-ai) .topbar h2 {
  transform: translate(0, 2px) scale(0.982, 1);
}

.app-shell:has(#page-customers) .topbar h2 {
  transform: translate(1px, 4px) scale(0.982, 1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  transform: translateY(3px);
}

.icon-button,
.user-button,
.menu-button {
  padding: 0;
  border: 0;
  outline: none;
  background: none;
}

.icon-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.icon-button:hover {
  background: rgba(22, 122, 254, 0.12);
  box-shadow: 0 0 10px rgba(22, 219, 254, 0.3);
}

.icon-button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

#noticeButton img {
  transform: translateX(-4px);
}

#settingsButton img {
  transform: translateX(-1px);
}

.icon-button.has-dot::after {
  display: none;
}

.avatar {
  width: 48px;
  height: 48px;
  margin-left: 2px;
  overflow: hidden;
  border: 2px solid rgba(22, 219, 254, 0.35);
  border-radius: 50%;
  background: #91c9ed url("./assets/avatar-source.png") -1309px -14px / 1440px 900px no-repeat;
  box-shadow: 0 0 10px rgba(22, 219, 254, 0.22);
}

.user-button {
  width: 160px;
  max-width: 160px;
  overflow: hidden;
  color: #f1f7ff;
  font-size: 14px;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
  transition: color 0.18s, text-shadow 0.18s;
}

.user-button:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 9px rgba(22, 219, 254, 0.45);
}

.menu-button {
  display: none;
  margin-right: 12px;
  padding: 6px 8px;
  color: #fff;
  font-size: 22px;
}

.main-area {
  position: fixed;
  inset: var(--header) 0 0 var(--sidebar);
  z-index: 1;
  overflow: hidden;
  background: transparent;
}

.main-area::before {
  display: none;
}

.page {
  position: relative;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
}

.page.is-active {
  display: block;
  animation: none;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 科技面板基础 ==================== */
.metric-card,
.chart-card,
.welcome-card,
.activity-card,
.customer-panel,
.ai-content {
  position: relative;
  overflow: hidden;
  border: 1px solid #5ea9fe;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(13, 22, 47, 0.72), rgba(5, 12, 29, 0.68)),
    rgba(7, 13, 29, 0.24);
  box-shadow:
    inset 0 0 28px rgba(72, 151, 255, 0.48),
    inset 0 0 64px rgba(22, 122, 254, 0.66),
    inset 0 0 2px rgba(142, 213, 255, 0.68),
    0 0 22px rgba(22, 122, 254, 0.52);
}

.metric-card::before,
.chart-card::before,
.welcome-card::before,
.activity-card::before,
.customer-panel::before,
.ai-content::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1px;
  right: 10%;
  left: 10%;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 11px rgba(22, 219, 254, 0.9);
}

.metric-card::after,
.chart-card::after,
.welcome-card::after,
.activity-card::after,
.customer-panel::after,
.ai-content::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(30, 104, 192, 0.2);
}

/* ==================== 首页 ==================== */
.dashboard-page {
  padding: 24px 24px 30px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.049fr) minmax(320px, 1fr);
  gap: 20px;
  width: 100%;
  height: 100%;
}

.dashboard-left,
.dashboard-right {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 20px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  height: 207px;
  flex: 0 0 207px;
}

.metric-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  padding: 20px 27px;
  background:
    linear-gradient(135deg, rgba(8, 14, 31, 0.92), rgba(4, 9, 22, 0.9)),
    rgba(5, 10, 24, 0.7);
}

.metric-card.active-card {
  padding-left: 22px;
}

.metric-card.buyers-card {
  padding-left: 28px;
}

.metric-card::before {
  inset: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 207' preserveAspectRatio='none'%3E%3Cpath d='M22 7H382V183L365 199H8V21Z' fill='none' stroke='%235ea9fe' stroke-opacity='.9' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(40, 190, 255, 0.72));
}

.metric-card::after {
  display: none;
}

.metric-card > div {
  position: relative;
  z-index: 2;
  min-width: 0;
  transform: translateY(7px);
}

.metric-card.active-card > div {
  transform: translateY(6px);
}

.metric-card.active-card h3 {
  transform: translateX(-1px) scaleX(0.99);
  transform-origin: left center;
}

.metric-card h3,
.chart-card h3,
.activity-card h3,
.customer-panel > h3 {
  color: #d8e9ff;
  font-weight: 400;
}

.metric-card h3 {
  margin: 0 0 44px;
  color: #add7ff;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
}

.metric-card p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.metric-card strong {
  color: #00ffd4;
  font-family: "DIN", Arial, sans-serif;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  background: linear-gradient(90deg, #00ffd4, #45a5ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 8px rgba(22, 219, 254, 0.86),
    0 0 20px rgba(22, 122, 254, 0.42);
  transform: scaleX(0.975);
  transform-origin: left center;
}

.metric-card p span {
  display: none;
}

.metric-icon {
  position: absolute;
  top: 51px;
  right: 22px;
  z-index: 2;
  display: grid;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  place-items: center;
}

.metric-icon img {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.chart-card {
  display: flex;
  min-height: 0;
  padding: 0 24px 16px;
  flex: 1;
  flex-direction: column;
  border-top-color: transparent;
}

.chart-card::before {
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: 57px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 57' preserveAspectRatio='none'%3E%3Cpath d='M0 50H177L198 28H320L360 0H800' fill='none' stroke='%235faeff' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 5px rgba(40, 151, 255, 0.75));
}

.card-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 83px;
  min-height: 83px;
  flex: 0 0 83px;
}

.chart-card h3,
.activity-card h3 {
  position: relative;
  margin: 0;
  padding-left: 17px;
  color: #a4d4ff;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
}

.chart-card h3 {
  position: absolute;
  top: 13px;
  left: 3px;
}

.chart-card h3::before,
.activity-card h3::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  background: #70dcff;
  box-shadow:
    3px 3px 0 #1da7ff,
    0 0 8px var(--accent-cyan);
  transform: translateY(-5px);
}

.chart-filters {
  position: absolute;
  top: 54px;
  right: -6px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.range-button,
.chart-filters select {
  height: 30px;
  border: 1px solid rgba(117, 158, 212, 0.6);
  border-radius: 4px;
  outline: none;
  color: #b7c5d8;
  background: rgba(6, 12, 27, 0.78);
}

.range-button {
  min-width: 43px;
  padding: 0 11px;
}

.range-button.is-active {
  color: #fff;
  border-color: rgba(166, 197, 235, 0.85);
  background: rgba(22, 122, 254, 0.08);
  box-shadow: 0 0 5px rgba(22, 122, 254, 0.12);
}

.chart-filters select {
  width: 111px;
  min-width: 111px;
  padding: 0 22px 0 8px;
}

.chart-filters select option,
.filter-form select option,
.stock-form select option {
  color: #eaf4ff;
  background: #09142a;
}

.unit-label {
  position: relative;
  z-index: 2;
  margin: 9px 0 2px 25px;
  color: #fff;
  font-size: 12px;
}

.chart-wrap {
  position: relative;
  z-index: 2;
  min-height: 0;
  flex: 1;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.welcome-card {
  display: flex;
  align-items: center;
  height: 207px;
  padding: 23px 26px;
  flex: 0 0 207px;
  background:
    linear-gradient(118deg, rgba(12, 24, 47, 0.96), rgba(29, 64, 117, 0.72)),
    rgba(7, 14, 31, 0.94);
  clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px);
}

.welcome-card::before {
  inset: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 207' preserveAspectRatio='none'%3E%3Cg transform='translate(20 0)' fill='%237c92b0' fill-opacity='.62'%3E%3Cpath d='M36 0h14L28 22H14z'/%3E%3Cpath d='M58 0h14L50 22H36z'/%3E%3Cpath d='M80 0h14L72 22H58z'/%3E%3Cpath d='M102 0h14L94 22H80z'/%3E%3Cpath d='M124 0h14l-22 22h-14z'/%3E%3C/g%3E%3Cpath d='M24 1H389V206H1V24Z' fill='none' stroke='%235faeff' stroke-width='2'/%3E%3Cpath d='M32 8H382V179L364 199H44L8 164V32Z' fill='none' stroke='%23296bb8' stroke-opacity='.5' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(40, 151, 255, 0.72));
}

.welcome-card::after {
  display: none;
}

.welcome-card img {
  position: absolute;
  top: 38px;
  left: 22px;
  z-index: 2;
  width: 96px;
  height: 96px;
  margin: 0;
  object-fit: contain;
}

.welcome-card div {
  position: absolute;
  top: 64px;
  left: 137px;
  z-index: 2;
  min-width: 0;
  color: #add7ff;
}

.welcome-card p {
  width: 220px;
  height: 38px;
  margin: 0;
  font-size: 26px;
  line-height: 38px;
  white-space: nowrap;
}

.welcome-card .welcome-date {
  height: 20px;
  margin-bottom: 15px;
  color: #add7ff;
  font-size: 20px;
  line-height: 20px;
  transform: translate(-1px, 2px) scaleX(0.94);
  transform-origin: left center;
}

.activity-card {
  min-height: 0;
  padding: 7px 28px 20px;
  flex: 1;
  border-top-color: transparent;
}

.activity-card::before {
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: 57px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 57' preserveAspectRatio='none'%3E%3Cpath d='M0 50H147L168 29H249L289 0H390' fill='none' stroke='%235faeff' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 5px rgba(40, 151, 255, 0.75));
}

.activity-card h3 {
  position: relative;
  z-index: 2;
  top: 5px;
}

.legend {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 37px 8px;
  margin: 42px 0 0 35px;
  transform: translateY(5px);
}

.legend span {
  display: flex;
  align-items: center;
  min-width: 0;
  color: #d9e5f5;
  font-size: 20px;
  line-height: 29px;
}

.legend i {
  width: 8px;
  height: 8px;
  margin-right: 10px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.legend i.green { background: #28c65c; box-shadow: 0 0 8px rgba(40, 198, 92, 0.5); }
.legend i.yellow { background: #ffce12; box-shadow: 0 0 8px rgba(255, 206, 18, 0.5); }
.legend i.blue { background: #589ff7; box-shadow: 0 0 8px rgba(88, 159, 247, 0.5); }
.legend i.gray { background: #d9e1e9; }
.legend b { font-weight: 500; white-space: nowrap; }
.legend em { margin-left: 10px; color: #9fcfff; font-size: 18px; font-style: normal; white-space: nowrap; }

.legend span:nth-child(3) {
  transform: translateX(-18px);
}

.donut {
  position: relative;
  z-index: 2;
  width: min(284px, 90%);
  aspect-ratio: 1;
  margin: 46px auto 0;
  border-radius: 50%;
  background: conic-gradient(
    from -31deg,
    #589ff7 0 33.6%,
    #ffca05 33.6% 74.2%,
    #28c65c 74.2% 95.3%,
    #dce1e7 95.3% 100%
  );
  box-shadow:
    -11px 5px 22px rgba(40, 198, 92, 0.16),
    8px 18px 32px rgba(255, 202, 5, 0.24),
    0 0 18px rgba(42, 139, 255, 0.34),
    0 16px 35px rgba(0, 0, 0, 0.32);
  transform: translateX(6px);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22.5%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #152947 0%, #091329 58%, #050b19 100%);
  box-shadow:
    inset 0 0 20px rgba(22, 122, 254, 0.26),
    0 0 15px rgba(7, 14, 32, 0.78);
}

.donut > div {
  display: none;
}

/* ==================== 客户总汇 ==================== */
.customers-page,
.stock-page {
  padding: 24px 20px 24px 28px;
}

.customer-panel {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 19px 20px 16px;
  flex-direction: column;
  box-shadow:
    inset 0 -16px 32px rgba(72, 151, 255, 0.42),
    inset -12px 0 30px rgba(22, 122, 254, 0.44),
    inset 0 0 2px rgba(142, 213, 255, 0.68),
    9px 11px 24px rgba(22, 122, 254, 0.54);
}

.customer-panel > h3 {
  position: relative;
  z-index: 2;
  height: 26px;
  margin: 0 0 25px;
  padding-left: 0;
  color: #fff;
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
}

.customer-panel > h3::before {
  display: none;
}

.filter-form {
  position: relative;
  z-index: 2;
  display: block;
  height: 90px;
  margin-bottom: 20px;
}

.select-group {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.filter-form > .select-group:nth-child(1) {
  left: 0;
  top: 1px;
}

.filter-form > .select-group:nth-child(2) {
  left: 372px;
}

.filter-form > .select-group:nth-child(3) {
  left: 619px;
}

.select-group label {
  color: #d3e1f2;
  font-size: 16px;
  white-space: nowrap;
}

.filter-form select {
  width: 132px;
  height: 32px;
  padding: 0 44px 0 18px;
  appearance: none;
  border: 1px solid #0ea3ff;
  border-radius: 0;
  outline: none;
  color: #92a4bc;
  font-size: 12px;
  background-color: rgba(4, 13, 31, 0.88);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='8' viewBox='0 0 11 8'%3E%3Cpath d='M1 1.5 5.5 6 10 1.5' fill='none' stroke='%23c6d9ee' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 30px) calc(50% + 2px);
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 10px rgba(22, 122, 254, 0.16),
    0 0 6px rgba(22, 183, 255, 0.34);
}

.filter-form > .select-group:nth-child(1) select + select {
  margin-left: 30px;
}

#province {
  background-position-x: calc(100% - 29px);
}

#city {
  background-position-x: calc(100% - 28px);
}

.filter-form > .select-group:nth-child(2) select,
.filter-form > .select-group:nth-child(3) select {
  width: 137px;
  padding-right: 34px;
  padding-left: 8px;
  background-position: calc(100% - 20px) calc(50% + 2px);
}

.filter-form > .select-group:nth-child(3) select {
  background-position: calc(100% - 20px) calc(50% + 2px);
}

.filter-form select.has-value {
  color: #eff7ff;
}

.filter-form select:disabled {
  color: #92a4bc;
  opacity: 1;
}

.filter-form select:hover,
.filter-form select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 9px rgba(22, 219, 254, 0.26);
}

.search-box {
  position: relative;
  display: flex;
  position: absolute;
  top: 57px;
  left: 1px;
  width: 179px;
  height: 32px;
  min-width: 179px;
  align-items: center;
  border: 1px solid #0ea3ff;
  background: rgba(4, 13, 31, 0.88);
  box-shadow: 0 0 6px rgba(22, 183, 255, 0.32);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 9px rgba(22, 219, 254, 0.26);
}

.search-icon {
  display: grid;
  width: 29px;
  height: 100%;
  flex: 0 0 29px;
  place-items: center;
}

.search-icon img {
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  color: #edf6ff;
  background: transparent;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #8194ad;
}

.form-actions {
  position: absolute;
  top: 56px;
  right: 27px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.secondary-button,
.primary-button {
  min-width: 66px;
  width: 66px;
  height: 34px;
  padding: 0 12px;
  border-radius: 0;
  transition: filter 0.18s, box-shadow 0.18s, transform 0.18s;
}

.secondary-button {
  border: 1px solid rgba(122, 156, 201, 0.62);
  color: #b7c8dc;
  background: rgba(9, 18, 37, 0.72);
}

.primary-button {
  border: 1px solid rgba(22, 153, 255, 0.9);
  color: #e9f8ff;
  background: linear-gradient(180deg, rgba(13, 90, 166, 0.88), rgba(5, 53, 109, 0.92));
  box-shadow:
    inset 0 0 12px rgba(22, 122, 254, 0.24),
    0 0 10px rgba(22, 163, 255, 0.32);
}

.secondary-button:hover,
.primary-button:hover {
  filter: brightness(1.18);
  box-shadow: 0 0 10px rgba(22, 219, 254, 0.28);
}

.secondary-button:active,
.primary-button:active {
  transform: translateY(1px);
}

.table-wrap {
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(45, 169, 255, 0.84);
  background: rgba(3, 10, 25, 0.18);
  box-shadow:
    inset 0 0 16px rgba(22, 122, 254, 0.08),
    0 0 8px rgba(22, 183, 255, 0.22);
  flex: 1;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-wrap th,
.table-wrap td {
  overflow: hidden;
  border-bottom: 1px solid rgba(55, 145, 235, 0.56);
  color: #fff;
  font-size: 14px;
  vertical-align: middle;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 55px;
  color: #dff4ff;
  font-size: 16px;
  font-weight: 500;
  background:
    linear-gradient(180deg, rgba(21, 74, 130, 0.82), rgba(8, 35, 72, 0.92));
  box-shadow:
    inset 0 1px rgba(110, 221, 255, 0.62),
    inset 0 -1px rgba(0, 190, 255, 0.72),
    inset 0 0 14px rgba(22, 122, 254, 0.22),
    0 2px 9px rgba(22, 122, 254, 0.28);
}

.table-wrap td {
  height: 56px;
  padding: 0 12px;
  padding-top: 2px;
  background: rgba(6, 13, 29, 0.14);
}

.table-wrap tbody tr {
  transition: background 0.16s, box-shadow 0.16s;
}

.table-wrap tbody tr:hover td {
  color: #f2f8ff;
  background: rgba(15, 58, 111, 0.42);
}

.table-wrap th:first-child,
.table-wrap td:first-child {
  width: 16.25%;
}

.table-wrap th:first-child {
  padding-left: 0;
  text-align: center;
}

.table-wrap td:first-child {
  padding-left: 24px;
  text-align: left;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) { width: 14%; }
.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) { width: 13.5%; }
.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) { width: 12.45%; }
.table-wrap th:nth-child(5),
.table-wrap td:nth-child(5) { width: 13.75%; }
.table-wrap th:nth-child(6),
.table-wrap td:nth-child(6) { width: 16.2%; }
.table-wrap th:nth-child(7),
.table-wrap td:nth-child(7) { width: 13.85%; }

.level-badge {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 7px;
  color: #ffd900;
  background: rgba(255, 217, 0, 0.12);
  box-shadow:
    inset 0 0 8px rgba(255, 217, 0, 0.24),
    0 0 8px rgba(255, 217, 0, 0.25);
}

.level-badge.level-B {
  color: #3ca6e8;
  background: rgba(60, 166, 232, 0.12);
  box-shadow: inset 0 0 8px rgba(60, 166, 232, 0.22), 0 0 8px rgba(60, 166, 232, 0.22);
}

.level-badge.level-C {
  color: #3ce89b;
  background: rgba(60, 232, 155, 0.11);
  box-shadow: inset 0 0 8px rgba(60, 232, 155, 0.22), 0 0 8px rgba(60, 232, 155, 0.22);
}

.level-badge.level-D {
  color: #ccc;
  background: rgba(204, 204, 204, 0.12);
  box-shadow: inset 0 0 8px rgba(204, 204, 204, 0.22), 0 0 9px rgba(204, 204, 204, 0.32);
}

.table-footer {
  position: relative;
  z-index: 2;
  display: block;
  min-height: 63px;
  padding: 0 17px;
  color: #a8bad0;
  font-size: 14px;
}

#recordCount {
  position: absolute;
  bottom: 6px;
  left: 18px;
  line-height: 20px;
}

.pagination {
  position: absolute;
  right: 24px;
  bottom: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
}

.pagination button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  white-space: nowrap;
  border: 1px solid rgba(80, 130, 190, 0.58);
  border-radius: 3px;
  color: #b8c8dc;
  background: rgba(6, 14, 31, 0.78);
}

.pagination button:hover:not(:disabled):not(.is-current) {
  border-color: var(--accent-cyan);
  color: #fff;
}

.pagination button.is-current {
  border-color: var(--accent-blue);
  color: #fff;
  background: rgba(22, 122, 254, 0.3);
  box-shadow: 0 0 8px rgba(22, 122, 254, 0.3);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.pagination input {
  width: 40px;
  height: 28px;
  border: 1px solid rgba(80, 130, 190, 0.58);
  border-radius: 3px;
  outline: none;
  color: #fff;
  text-align: center;
  background: rgba(6, 14, 31, 0.78);
}

.empty-cell {
  height: 120px !important;
  padding: 28px 0 !important;
  color: #788ba5 !important;
  text-align: center !important;
}

.customers-page .customer-panel {
  border-color: #5faafe;
}

.customers-page .table-wrap {
  margin-right: -2px;
  overflow-x: auto;
  overflow-y: hidden;
}

.customers-page .table-wrap th {
  padding-top: 1px;
  border-bottom: 2px solid #0ea3ff;
  box-shadow:
    inset 0 -1px #0ea3ff,
    0 1px rgba(14, 163, 255, 0.45),
    inset 0 0 14px rgba(22, 122, 254, 0.22);
}

.customers-page .table-wrap td {
  border-bottom: 2px solid #2a5f89;
}

.customers-page .table-wrap tbody tr:first-child td {
  height: 66px;
}

.customers-page .table-wrap tbody tr:last-child td {
  height: 62px;
}

.customers-page .pagination span:first-of-type {
  margin-left: 20px;
}

/* ==================== AI 查询 ==================== */
.ai-page {
  padding: 24px;
}

.ai-content {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: rgba(3, 7, 20, 0.24);
  box-shadow:
    inset 0 0 32px rgba(72, 151, 255, 0.38),
    inset 0 0 84px rgba(22, 122, 254, 0.48),
    inset 0 -18px 34px rgba(72, 151, 255, 0.44),
    inset -14px 0 34px rgba(22, 122, 254, 0.48),
    inset 0 0 2px rgba(142, 213, 255, 0.68),
    10px 12px 26px rgba(22, 122, 254, 0.56);
}

.ai-content::after {
  display: none;
}

.ai-content > h1 {
  position: absolute;
  top: 216px;
  left: 50%;
  z-index: 2;
  width: 568px;
  height: 70px;
  margin: 0;
  color: #fff;
  font-size: 47px;
  line-height: 70px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  transform: translateX(-50%);
}

.prompt-box {
  position: absolute;
  top: 387px;
  left: 50%;
  z-index: 2;
  display: flex;
  width: 1006px;
  height: 215px;
  padding: 19px 29px 21px;
  border: 2px solid rgba(111, 183, 254, 0.94);
  border-radius: 0;
  background:
    linear-gradient(105deg, rgba(8, 10, 29, 0.96), rgba(7, 18, 42, 0.94) 58%, rgba(10, 38, 69, 0.9));
  box-shadow:
    inset 0 0 24px rgba(22, 122, 254, 0.12),
    0 0 12px rgba(22, 219, 254, 0.35);
  flex-direction: column;
  transform: translateX(-50%);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.prompt-box::before,
.prompt-box::after {
  content: "";
  position: absolute;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 10px rgba(22, 219, 254, 0.72);
}

.prompt-box::before {
  top: -1px;
  right: 7%;
  left: 7%;
}

.prompt-box::after {
  right: 22%;
  bottom: -1px;
  left: 22%;
}

.prompt-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow:
    inset 0 0 30px rgba(22, 122, 254, 0.15),
    0 0 17px rgba(22, 219, 254, 0.45);
}

.prompt-box textarea {
  width: 100%;
  min-height: 105px;
  padding: 7px 0 0 1px;
  resize: none;
  border: 0;
  outline: none;
  color: #edf7ff;
  font-size: 24px;
  line-height: 1;
  font-weight: 350;
  background: transparent;
  flex: 1;
}

.prompt-box textarea::placeholder {
  color: #d4d4d4;
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px 0 9px;
}

.prompt-footer > div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mode-chip {
  display: inline-flex;
  height: 36px;
  padding: 0 9px;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(131, 153, 184, 0.58);
  border-radius: 18px;
  color: #aebed1;
  font-size: 14px;
  background: rgba(5, 11, 25, 0.66);
  transform: translate(-1px, 7px) scaleX(0.99);
  transform-origin: left center;
  transition: color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.mode-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.mode-chip.is-active,
.mode-chip:hover {
  color: #f2fbff;
  border-color: var(--accent-cyan);
  background: rgba(22, 122, 254, 0.18);
  box-shadow: 0 0 9px rgba(22, 219, 254, 0.23);
}

.send-button {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(51, 78, 113, 0.72);
  box-shadow: 0 0 11px rgba(22, 122, 254, 0.24);
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.send-button span {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border: 0;
  background: #fff;
  /* 标准向右纸飞机：机头(右)尖锐，尾部(左)V形分叉，几何重心天然居中 */
  clip-path: polygon(100% 50%, 0 92%, 36% 50%, 0 8%);
  /* 形状本身对称居中；旋转-45deg让纸飞机朝右上方飞出（发送的常见朝向） */
  transform: rotate(-45deg);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
}

.send-button:hover {
  background: rgba(22, 122, 254, 0.8);
  box-shadow: 0 0 14px rgba(22, 219, 254, 0.44);
}

.send-button:active {
  transform: translateY(1px);
}

.send-button.is-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  transform: none;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-answer {
  position: relative;
  z-index: 2;
  width: min(1120px, 92%);
  max-height: 46vh;
  margin: 0 auto 28px;
  padding: 20px 22px;
  overflow: auto;
  border: 1px solid rgba(22, 122, 254, 0.62);
  color: #cbd9e9;
  line-height: 1.75;
  background: rgba(5, 13, 31, 0.9);
  box-shadow: inset 0 0 22px rgba(22, 122, 254, 0.1);
}

.ai-content.has-answer {
  display: flex;
  padding: 42px 60px;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
}

.ai-content.has-answer > h1 {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  margin: 0 0 24px;
  font-size: 28px;
  line-height: 1.2;
  transform: none;
}

.ai-content.has-answer .prompt-box {
  position: relative;
  top: auto;
  left: auto;
  width: min(1120px, 92%);
  height: 150px;
  flex: 0 0 150px;
  transform: none;
}

.ai-content.has-answer .prompt-box textarea {
  min-height: 40px;
}

.ai-answer .ai-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}

.ai-answer .ai-table th,
.ai-answer .ai-table td {
  padding: 9px 12px;
  border: 1px solid rgba(55, 122, 198, 0.35);
  color: #c9d8e9;
  text-align: left;
  white-space: nowrap;
}

.ai-answer .ai-table th {
  color: #dff4ff;
  font-weight: 500;
  background: rgba(14, 58, 108, 0.76);
}

/* ==================== 入库 / 系统 ==================== */
.stock-page {
  overflow: auto;
}

.stock-panel {
  height: auto;
  min-height: 0;
  margin-bottom: 20px;
  padding: 22px;
}

.stock-panel:first-child {
  min-height: 300px;
}

.stock-panel:last-child {
  min-height: 360px;
}

.stock-form {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 22px;
  max-width: 1120px;
}

.stock-form .field.span-2 {
  grid-column: span 2;
}

.stock-form .field label {
  display: block;
  margin-bottom: 8px;
  color: #bfd0e4;
  font-size: 13px;
}

.stock-form .field label i {
  color: #ff6672;
  font-style: normal;
}

.stock-form .field input,
.stock-form .field select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(60, 127, 205, 0.68);
  border-radius: 0;
  outline: none;
  color: #edf7ff;
  background: var(--bg-input);
}

.stock-form .field input::placeholder {
  color: #7489a5;
}

.stock-form .field input:focus,
.stock-form .field select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 9px rgba(22, 219, 254, 0.24);
}

.stock-form .form-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.stock-submit {
  width: auto;
  min-width: 104px;
}

.stock-error {
  color: #ff7682;
  font-size: 13px;
}

.row-delete {
  padding: 2px 6px;
  border: 0;
  color: #ff707d;
  background: none;
}

.row-delete:hover {
  color: #ff9aa3;
  text-decoration: underline;
}

.self-badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(75, 153, 246, 0.55);
  border-radius: 12px;
  color: #69b6ff;
  background: rgba(22, 122, 254, 0.12);
}

/* stock/system 表格不能继承客户页固定列宽 */
.stock-page .table-wrap th,
.stock-page .table-wrap td {
  width: auto;
  padding: 0 10px;
  text-align: center;
}

.stock-page .table-wrap th:first-child,
.stock-page .table-wrap td:first-child {
  width: auto;
  padding-left: 14px;
  text-align: left;
}

#page-stock .table-wrap table {
  min-width: 1080px;
}

@media (min-width: 981px) {
  #page-system .stock-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #page-system .stock-panel:first-child {
    min-height: 220px;
  }

  #page-system .stock-form + .table-wrap {
    margin-top: 18px;
  }
}

/* ==================== 通用反馈 ==================== */
.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1000;
  max-width: 360px;
  padding: 13px 20px;
  border: 1px solid rgba(22, 219, 254, 0.72);
  color: #eaf9ff;
  background: rgba(5, 17, 37, 0.96);
  box-shadow: 0 0 16px rgba(22, 219, 254, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-mask {
  display: none;
}

.nav-item:focus-visible,
.icon-button:focus-visible,
.user-button:focus-visible,
.menu-button:focus-visible,
.range-button:focus-visible,
.mode-chip:focus-visible,
.send-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.pagination button:focus-visible,
.login-button:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1240px) {
  :root {
    --sidebar: 146px;
  }

  .brand {
    font-size: 15px;
  }

  .nav-item {
    padding-left: 12px;
    font-size: 13px;
  }

  .metric-icon,
  .metric-icon img {
    width: 104px;
    height: 104px;
  }

  .metric-icon {
    flex-basis: 104px;
  }

  .metric-card h3 {
    font-size: 20px;
  }

  .metric-card strong {
    font-size: 34px;
  }

  .welcome-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .welcome-card img {
    width: 78px;
    height: 78px;
    margin-right: 12px;
  }

  .welcome-card p {
    font-size: 16px;
  }

  .filter-form {
    grid-template-columns: repeat(3, minmax(0, auto));
  }

  .search-box {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  :root {
    --header: 72px;
  }

  .sidebar {
    width: 200px;
    transform: translateX(-105%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .topbar {
    left: 0;
    padding-left: 12px;
  }

  .menu-button {
    display: block;
  }

  .main-area {
    position: relative;
    inset: auto;
    min-height: 100vh;
    padding-top: var(--header);
  }

  .page {
    min-height: calc(100vh - var(--header));
    height: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-left,
  .dashboard-right {
    min-height: 620px;
  }

  .dashboard-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .welcome-card {
    height: auto;
  }

  .activity-card {
    min-height: 420px;
  }

  .customers-page,
  .stock-page,
  .ai-page,
  .dashboard-page {
    padding: 18px;
  }

  .customer-panel {
    min-height: 720px;
  }

  .filter-form {
    display: grid;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
  }

  .select-group,
  .filter-form > .select-group:nth-child(1),
  .filter-form > .select-group:nth-child(2),
  .filter-form > .select-group:nth-child(3) {
    position: static;
    flex-wrap: wrap;
  }

  .filter-form > .select-group:nth-child(1) {
    grid-column: 1 / -1;
  }

  .filter-form > .select-group:nth-child(1) select + select {
    margin-left: 12px;
  }

  .search-box {
    position: static;
    width: 100%;
    grid-column: auto;
  }

  .form-actions {
    position: static;
    justify-content: flex-start;
  }

  .ai-content {
    display: flex;
    min-height: 720px;
    padding: 100px 42px 60px;
    align-items: center;
    flex-direction: column;
  }

  .ai-content > h1 {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    margin: 0 0 70px;
    font-size: 36px;
    line-height: 1.25;
    transform: none;
  }

  .prompt-box {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 1006px);
    transform: none;
  }

  .stock-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgba(1, 5, 13, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
  }

  .sidebar-mask.is-show {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 680px) {
  .login-brand {
    top: 34px;
    left: 24px;
    font-size: 27px;
  }

  .login-brand img {
    width: 44px;
    height: 44px;
  }

  .login-card {
    top: 50%;
    right: 20px;
    left: 20px;
    width: auto;
    height: auto;
    min-height: 520px;
    padding: 38px 26px;
    transform: translateY(-43%);
  }

  .login-card h1 {
    margin-bottom: 36px;
    font-size: 30px;
  }

  .login-card label {
    font-size: 18px;
  }

  .login-card input {
    height: 56px;
    margin-bottom: 28px;
    font-size: 16px;
  }

  .login-button {
    height: 62px;
    font-size: 24px;
  }

  .top-actions {
    gap: 7px;
  }

  .topbar h2 {
    font-size: 17px;
  }

  .icon-button {
    display: none;
  }

  .avatar {
    width: 38px;
    height: 38px;
    background-position: -1036px -11px;
    background-size: 1140px 713px;
  }

  .user-button {
    max-width: 92px;
    font-size: 13px;
  }

  .metric-row {
    grid-template-columns: 1fr;
    height: auto;
    flex-basis: auto;
  }

  .metric-card {
    min-height: 165px;
  }

  .dashboard-right {
    display: flex;
  }

  .chart-card {
    min-height: 500px;
  }

  .chart-filters {
    gap: 6px;
  }

  .range-button {
    min-width: 36px;
  }

  .chart-filters select {
    min-width: 94px;
  }

  .welcome-card {
    min-height: 175px;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }

  .select-group,
  .filter-form > .select-group:nth-child(1) {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: auto;
    gap: 8px;
  }

  .filter-form select {
    width: 100%;
  }

  .filter-form > .select-group:nth-child(1) select + select {
    margin-left: 0;
  }

  .search-box {
    width: 100%;
  }

  .table-wrap {
    min-height: 460px;
  }

  .table-wrap table {
    min-width: 920px;
  }

  .table-footer {
    min-height: 118px;
    padding-top: 12px;
  }

  #recordCount {
    position: static;
    display: block;
    margin-bottom: 14px;
  }

  .pagination {
    position: static;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .ai-content {
    min-height: 650px;
    padding: 90px 18px 36px;
  }

  .ai-content > h1 {
    width: 100%;
    margin-bottom: 54px;
    font-size: 27px;
    white-space: normal;
  }

  .prompt-box {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
  }

  .prompt-footer {
    padding-right: 0;
    padding-left: 0;
  }

  .prompt-footer > div {
    gap: 8px;
  }

  .mode-chip {
    padding: 0 8px;
    flex-shrink: 0;
    font-size: 12px;
    white-space: nowrap;
  }

  .stock-form {
    grid-template-columns: 1fr;
  }

  .stock-form .field.span-2 {
    grid-column: span 1;
  }
}
