:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f1f4f9;
  --surface-raised: #ffffff;
  --line: #dfe4ee;
  --line-strong: #c9d2df;
  --text: #101114;
  --text-primary: var(--text);
  --text-2: #424a57;
  --text-3: #697386;
  --text-muted: var(--text-3);
  --muted: #8a94a6;
  --primary: #5e6ad2;
  --primary-2: #2563eb;
  --accent: var(--primary);
  --accent-light: #7c85ee;
  --primary-soft: rgba(94, 106, 210, .1);
  --primary-line: rgba(94, 106, 210, .34);
  --cyan: #0891b2;
  --green: #16a34a;
  --success: var(--green);
  --amber: #d97706;
  --warning: var(--amber);
  --red: #e5484d;
  --error: var(--red);
  --success-bg: rgba(22, 163, 74, .1);
  --warning-bg: rgba(217, 119, 6, .11);
  --error-bg: rgba(229, 72, 77, .11);
  --info-bg: rgba(8, 145, 178, .1);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  /* CDN-ready login background. Replace this value with the uploaded bg.jpg/bg.png CDN URL in production. */
  --login-bg-image: url("bg.jpg");
  --shadow-1: 0 1px 2px rgba(16, 17, 20, .05);
  --shadow-2: 0 18px 46px rgba(16, 17, 20, .1);
  --shadow-3: 0 32px 90px rgba(16, 17, 20, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.18, .9, .24, 1.12);
  --fast: 140ms var(--ease);
  --normal: 220ms var(--ease);
  --z-dropdown: 30;
  --z-sticky: 40;
  --z-overlay: 80;
  --z-modal: 90;
  --z-toast: 110;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080a0f;
    --bg-2: #0c1018;
    --surface: #10131a;
    --surface-2: #151922;
    --surface-3: #1b202b;
    --surface-raised: #121720;
    --line: #252b38;
    --line-strong: #343c4d;
    --text: #f5f7fb;
    --text-2: #d1d7e2;
    --text-3: #98a2b3;
    --muted: #758095;
    --primary: #8b91ff;
    --primary-2: #60a5fa;
    --accent-light: #a2a7ff;
    --primary-soft: rgba(139, 145, 255, .13);
    --primary-line: rgba(139, 145, 255, .38);
    --cyan: #22d3ee;
    --green: #34d399;
    --amber: #f59e0b;
    --red: #fb7185;
    --success-bg: rgba(52, 211, 153, .14);
    --warning-bg: rgba(245, 158, 11, .14);
    --error-bg: rgba(251, 113, 133, .14);
    --info-bg: rgba(34, 211, 238, .13);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-2: 0 10px 28px rgba(0, 0, 0, .28);
    --shadow-3: 0 28px 78px rgba(0, 0, 0, .48);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(94, 106, 210, .055), transparent 240px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled,
.btn-submit:disabled {
  cursor: not-allowed;
  opacity: .5;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

::selection {
  color: #ffffff;
  background: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden] {
  display: none;
}

.main-page,
.login-page {
  display: none;
}

.main-page.active,
.login-page {
  display: block;
}

.income,
.success,
.deposit-yes {
  color: var(--success) !important;
}

.warning {
  color: var(--warning) !important;
}

.danger,
.deposit-no {
  color: var(--error) !important;
}

/* Motion library */
.motion-fade-up {
  animation: fxFadeUp .24s var(--ease) both;
}

.motion-pop {
  animation: fxPop .2s var(--spring) both;
}

.motion-slide-in {
  animation: fxSlideIn .22s var(--ease) both;
}

.is-pressing {
  transform: translateY(1px) scale(.985) !important;
}

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

@keyframes fxPop {
  from { opacity: 0; transform: scale(.975); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fxSlideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fxShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

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

@keyframes fxShimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -120% 0; }
}

@keyframes fxFieldFlash {
  0% { box-shadow: 0 0 0 0 rgba(94, 106, 210, 0); }
  45% { box-shadow: 0 0 0 4px var(--primary-soft); }
  100% { box-shadow: 0 0 0 0 rgba(94, 106, 210, 0); }
}

/* Auth */
.login-page {
  min-height: 100dvh;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(94, 106, 210, .07), transparent 260px),
    var(--bg);
}

.login-page::before {
  display: none;
}

.login-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shell-card,
.shell-line {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  opacity: .18;
  transform: rotate(-4deg);
}

.shell-card-a {
  width: 260px;
  height: 150px;
  left: max(24px, 10vw);
  top: 20vh;
}

.shell-card-b {
  width: 220px;
  height: 124px;
  right: max(24px, 10vw);
  bottom: 18vh;
  transform: rotate(5deg);
}

.shell-line {
  width: 34vw;
  height: 1px;
  left: 33vw;
  top: 56vh;
  background: var(--line);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(404px, calc(100vw - 40px));
  height: auto;
  min-height: 0;
  margin: clamp(72px, 12vh, 118px) auto 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
  animation: fxPop .26s var(--ease) both;
  transform:
    perspective(920px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transition: transform var(--normal), border-color var(--fast), box-shadow var(--fast);
}

.login-card:hover {
  border-color: var(--line-strong);
}

.login-brand,
.forgot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-mark,
.forgot-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
}

.brand-mark-security {
  color: var(--success);
  border-color: rgba(22, 163, 74, .28);
  background: var(--success-bg);
}

.brand-copy {
  min-width: 0;
}

.brand-eyebrow,
.page-kicker {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-copy h1,
.page-hero h1,
.page-strip h1 {
  margin: 0;
  color: var(--text);
  font-weight: 720;
  letter-spacing: 0;
}

.brand-copy h1 {
  font-size: 24px;
}

.brand-copy p,
.page-hero p,
.card-header span,
.mode-intro p,
.rank-self-card p {
  margin: 0;
  color: var(--text-3);
}

.login-quote {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}

.lf,
.forgot-field,
.form-group,
.field {
  position: relative;
}

.lf + .lf,
.forgot-field + .forgot-field,
.form-group + .form-group {
  margin-top: 12px;
}

.lf label,
.forgot-field label,
.form-group label,
.field .label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

input,
textarea,
.cs-trigger,
.time-picker,
.date-display {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition:
    border-color var(--fast),
    box-shadow var(--fast),
    background var(--fast),
    transform var(--fast);
}

input,
textarea,
.cs-trigger,
.tp-trigger,
.date-display {
  padding: 0 11px;
}

textarea {
  min-height: 96px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder,
.cs-placeholder,
.tp-placeholder {
  color: color-mix(in srgb, var(--text-3) 78%, transparent);
}

input:hover,
textarea:hover,
.custom-select:hover .cs-trigger,
.time-picker:hover,
.date-display:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
.custom-select.cs-open .cs-trigger,
.cs-trigger.cs-focus,
.time-picker.tp-open,
.date-display:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

input[readonly],
textarea[readonly] {
  background: var(--surface-2) !important;
  color: var(--text-2) !important;
  cursor: default !important;
}

.login-btn,
.forgot-submit,
.btn-primary,
.quick-btn.primary,
#tab-submit .btn-submit,
#tab-submit .btn-smart-rec,
#tab-submit .btn-close-proof,
.gc-btn-now,
.lg-alert-btn {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.login-btn,
.forgot-submit,
.forgot-cancel,
.btn,
.quick-btn,
.logout-btn,
.btn-secondary,
.pagination button,
.modal-footer button,
.teammate-actions button,
.request-actions button,
.order-detail-btn,
.btn-edit-order,
#tab-submit .btn-back-mode,
#tab-submit .btn-submit,
#tab-submit .btn-smart-rec,
#tab-submit .btn-close-proof,
#tab-submit .btn-close-proof-reset,
.gc-nav-btn,
.gc-btn-clear,
.gc-btn-now,
.modal-close,
.history-drawer-close,
.forgot-pwd-toggle,
.btn-sm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 650;
  text-decoration: none;
  transition:
    color var(--fast),
    background var(--fast),
    border-color var(--fast),
    transform .18s var(--spring),
    box-shadow var(--fast);
}

.login-btn {
  width: 100%;
  height: 42px;
  margin-top: 16px;
}

.login-btn:hover,
.forgot-submit:hover,
.btn-primary:hover,
.quick-btn.primary:hover,
#tab-submit .btn-submit:hover:not(:disabled),
#tab-submit .btn-smart-rec:hover,
#tab-submit .btn-close-proof:hover,
.gc-btn-now:hover,
.lg-alert-btn:hover {
  background: color-mix(in srgb, var(--primary) 88%, #ffffff);
  border-color: color-mix(in srgb, var(--primary) 88%, #ffffff);
}

.quick-btn:hover,
.logout-btn:hover,
.btn-secondary:hover,
.forgot-cancel:hover,
.pagination button:hover:not(:disabled),
.teammate-actions button:hover,
.request-actions button:hover,
.order-detail-btn:hover,
.btn-edit-order:hover,
#tab-submit .btn-back-mode:hover,
#tab-submit .btn-close-proof-reset:hover,
.modal-close:hover,
.history-drawer-close:hover,
.forgot-pwd-toggle:hover,
.btn-sm-close:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.quick-btn.dense {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.quick-btn.danger,
.teammate-actions .danger,
.request-actions .reject {
  color: var(--error);
  border-color: rgba(229, 72, 77, .26);
  background: var(--error-bg);
}

.request-actions .accept {
  color: var(--success);
  border-color: rgba(22, 163, 74, .25);
  background: var(--success-bg);
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 650;
}

.link-btn:hover {
  text-decoration: underline;
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--text-3);
  font-size: 12px;
}

.login-err,
.err-msg,
#unfreezeErr {
  color: var(--error) !important;
  font-size: 12px;
}

.login-err {
  display: none;
  min-height: 18px;
  margin-top: 10px;
}

.err-msg {
  display: none;
  margin-top: 6px;
}

.err-msg.show {
  display: block;
}

.err,
.custom-select.err .cs-trigger,
.time-picker.err,
.close-proof.err {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px var(--error-bg) !important;
}

.shake {
  animation: fxShake .3s var(--ease);
}

/* Shell */
.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100dvh;
}

.workspace-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 18px 10px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, var(--bg));
  overflow-y: auto;
}

.rail-section-label {
  margin: 0 12px 12px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}

.tabbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-item,
.bottom-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition:
    color var(--fast),
    background var(--fast),
    border-color var(--fast),
    transform .18s var(--spring);
  user-select: none;
}

.tab-item {
  min-height: 36px;
  padding: 0 12px;
}

.tab-icon,
.bottom-nav-item .icon {
  display: grid;
  place-items: center;
  color: currentColor;
}

.tab-item:hover,
.bottom-nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab-item.active,
.bottom-nav-item.active {
  color: var(--primary);
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

.workspace-main {
  min-width: 0;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  justify-content: flex-end;
  min-height: 56px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-state,
.nav-pid {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.nav-state::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--success);
}

.content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px;
}

.tab-content {
  display: none;
  animation: fxFadeUp .18s var(--ease) both;
}

.tab-content.active {
  display: block;
}

/* Page sections */
.page-hero,
.page-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-hero {
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--primary-soft))),
    var(--surface);
}

.page-hero h1,
.page-strip h1 {
  margin-top: 2px;
  font-size: 26px;
  line-height: 1.15;
}

.page-hero p {
  margin-top: 6px;
}

.hero-actions,
.segmented-control,
.form-toolbar,
.form-toolbar-left,
.close-proof-actions,
.smart-rec-btns,
.forgot-actions,
.modal-footer,
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.stat-card,
.card,
.submit-card,
.rank-list-panel,
.modal,
.forgot-card,
.smart-rec-box,
.lg-alert-box,
.smodal,
.history-drawer,
.route-loader-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.stat-card {
  position: relative;
  min-height: 130px;
  padding: 14px;
  overflow: hidden;
  transform:
    perspective(860px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transition:
    border-color var(--fast),
    background var(--fast),
    transform .18s var(--spring);
}

.stat-card:hover,
.card:hover,
.submit-card:hover,
.rank-list-panel:hover {
  border-color: var(--line-strong);
}

.metric-icon,
.mode-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.accent-blue { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-line); }
.accent-amber { color: var(--warning); background: var(--warning-bg); border-color: rgba(217, 119, 6, .22); }
.accent-green { color: var(--success); background: var(--success-bg); border-color: rgba(22, 163, 74, .22); }

.stat-card .label,
.card-header span {
  font-size: 12px;
  font-weight: 600;
}

.stat-card .value {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
  font-weight: 760;
  color: var(--text);
}

.stat-card .value.compact {
  font-size: 18px;
}

.metric-foot {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 12px;
}

.month-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.split-metrics,
.strip-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
}

.split-metrics > div,
.strip-metrics > div {
  min-width: 96px;
}

.split-metrics strong,
.strip-metrics strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.split-metrics span,
.strip-metrics span {
  color: var(--text-3);
  font-size: 12px;
}

.dashboard-main,
.team-grid,
.profile-layout,
.rank-layout {
  display: grid;
  gap: 10px;
}

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

.team-grid,
.profile-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

.rank-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.card-body {
  padding: 14px;
}

.data-panel .card-body,
.recent-card .card-body {
  padding: 0;
}

.recent-card .card-body {
  overflow: auto;
}

/* Data tables */
.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--text-3);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

td {
  color: var(--text-2);
  font-size: 13px;
}

tbody tr {
  transition: background var(--fast);
}

tbody tr:hover {
  background: var(--surface-2);
}

.filter-bar {
  flex-wrap: wrap;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.filter-bar input {
  max-width: 260px;
}

.filter-bar .custom-select {
  width: 150px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
}

.pagination .info {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 12px;
}

/* Badges and state chips */
.badge,
.history-status,
.close-proof-status,
.current-mode-tag,
.sm-status,
.discount-hint,
.wage-hint,
.submit-closed-notice {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 650;
}

.badge,
.history-status,
.close-proof-status,
.current-mode-tag,
.sm-status {
  min-height: 24px;
  padding: 0 8px;
}

.badge.pending,
.history-status.pending,
.sm-status,
.close-proof-status.idle {
  color: var(--warning);
  border-color: rgba(217, 119, 6, .22);
  background: var(--warning-bg);
}

.badge.approved,
.history-status.approved,
.close-proof-status.passed,
.close-proof.passed .close-proof-status {
  color: var(--success);
  border-color: rgba(22, 163, 74, .22);
  background: var(--success-bg);
}

.badge.rejected,
.history-status.rejected,
.close-proof-status.failed,
.close-proof.failed .close-proof-status,
.close-proof.err .close-proof-status {
  color: var(--error);
  border-color: rgba(229, 72, 77, .24);
  background: var(--error-bg);
}

.close-proof.checking .close-proof-status,
.close-proof-status.checking,
.cmt-huhang,
.cmt-anchor,
.cmt-peiwan {
  color: var(--primary);
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

/* Empty and loading */
.loading,
.history-empty {
  display: grid;
  min-height: 136px;
  place-items: center;
  color: var(--text-3);
  font-size: 13px;
}

.loading::before,
.history-empty::before {
  content: "";
  width: 112px;
  height: 9px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(
      90deg,
      var(--surface-3) 0%,
      color-mix(in srgb, var(--surface-3) 70%, var(--primary)) 38%,
      var(--surface-3) 76%
    );
  background-size: 220% 100%;
  animation: fxShimmer 1.2s linear infinite;
}

.loading {
  color: transparent;
}

.empty-state {
  display: grid;
  min-height: 156px;
  place-items: center;
  padding: 24px;
  color: var(--text-3);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

/* Submit */
.submit-layout {
  max-width: 980px;
}

.submit-card {
  padding: 16px;
}

.submit-strip {
  align-items: center;
}

.process-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.process-steps span {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
}

.process-steps span.active {
  color: var(--primary);
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

.mode-intro {
  margin-bottom: 12px;
}

.mode-intro strong,
.section-title,
.close-proof-title,
.smart-rec-title,
.history-drawer-title {
  color: var(--text);
  font-weight: 700;
}

.mode-intro p {
  margin-top: 3px;
  font-size: 13px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mode-card {
  position: relative;
  min-height: 136px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(0);
  transition:
    border-color var(--fast),
    background var(--fast),
    transform .2s var(--spring),
    box-shadow var(--fast);
}

.mode-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(-2px);
}

.mode-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 2px 0 0 var(--primary);
}

.mi-huhang { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-line); }
.mi-peiwan { color: var(--cyan); background: var(--info-bg); border-color: rgba(8, 145, 178, .25); }
.mi-anchor { color: var(--warning); background: var(--warning-bg); border-color: rgba(217, 119, 6, .25); }

.mode-name {
  margin-top: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.mode-desc {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
}

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

.fullwidth {
  grid-column: 1 / -1;
}

.form-toolbar {
  justify-content: space-between;
  min-height: 40px;
}

.section-title {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.req {
  color: var(--error);
}

.opt {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.datetime-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dt-date-col,
.field-calendar-open {
  position: relative;
}

.dt-time-col {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-sep {
  color: var(--text-3);
  font-weight: 700;
}

.time-picker {
  position: relative;
  display: grid;
  grid-template-columns: 42px 20px;
  width: auto;
  min-width: 72px;
}

.tp-trigger {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.tp-arrow,
.cs-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transform: translateY(-50%);
  pointer-events: none;
}

.tp-dropdown,
.cs-dropdown,
.glass-calendar {
  position: absolute;
  z-index: var(--z-dropdown);
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
  animation: fxPop .14s var(--ease) both;
}

.tp-open .tp-dropdown {
  display: grid;
  right: 0;
  top: calc(100% + 6px);
  width: 82px;
  max-height: 240px;
  padding: 6px;
  overflow: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.tp-opt,
.cs-opt,
.gc-day {
  border-radius: var(--radius-sm);
  transition: color var(--fast), background var(--fast), transform var(--fast);
}

.tp-opt {
  min-height: 30px;
  padding: 6px 8px;
  color: var(--text-2);
}

.tp-opt:hover,
.tp-selected,
.cs-opt:hover,
.cs-selected,
.gc-day:hover,
.gc-selected {
  color: var(--primary);
  background: var(--primary-soft);
}

.custom-select {
  position: relative;
}

.cs-trigger {
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 32px;
}

.cs-open .cs-dropdown {
  display: grid;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 160px;
  padding: 6px;
}

.cs-opt {
  min-height: 32px;
  padding: 7px 9px;
  color: var(--text-2);
}

.glass-calendar.open {
  display: block;
  top: calc(100% + 6px);
  left: 0;
  width: 292px;
  padding: 10px;
}

.gc-head,
.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gc-month-label {
  color: var(--text);
  font-weight: 700;
}

.gc-weekdays,
.gc-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.gc-weekdays {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 11px;
  text-align: center;
}

.gc-days {
  margin-top: 6px;
}

.gc-day {
  display: grid;
  min-height: 32px;
  place-items: center;
  color: var(--text-2);
}

.gc-other-month {
  color: color-mix(in srgb, var(--text-3) 55%, transparent);
}

.gc-today {
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary-line);
}

.gc-foot {
  margin-top: 10px;
}

.edit-warning-bar,
.submit-closed-notice {
  display: none;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-color: rgba(217, 119, 6, .24);
  background: var(--warning-bg);
  color: var(--warning);
}

.edit-warning-bar.open,
.submit-closed-notice {
  display: flex;
}

.submit-closed-notice {
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 12px;
}

.submit-closed-title {
  font-weight: 750;
}

.submit-closed-desc {
  color: var(--text-2);
}

.close-proof,
.remark-locked,
.smart-rec-summary,
.discount-hint,
.wage-hint {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.close-proof {
  padding: 12px;
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}

.close-proof.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.close-proof-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.close-proof-desc,
.close-proof-hint,
.close-proof-words {
  color: var(--text-3);
  font-size: 12px;
}

.close-proof-actions {
  margin-top: 10px;
}

.close-proof-preview {
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.close-proof-preview img {
  display: block;
  max-width: 100%;
  max-height: 190px;
  border-radius: var(--radius-sm);
}

.close-proof-hint,
.close-proof-words {
  margin-top: 8px;
}

.close-proof-words {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.remark-locked {
  margin-bottom: 8px;
  padding: 9px 10px;
}

.remark-locked-title {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.remark-locked-content {
  margin-top: 4px;
  color: var(--text-3);
  white-space: pre-wrap;
}

.discount-hint,
.wage-hint {
  margin-top: 6px;
  padding: 8px 10px;
}

#tab-submit .btn-submit {
  width: 100%;
  height: 42px;
}

/* Lists */
.teammate-item,
.request-item,
.leaderboard-item,
.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  transition: background var(--fast);
}

.teammate-item:hover,
.request-item:hover,
.leaderboard-item:hover,
.history-card:hover {
  background: var(--surface-2);
}

.teammate-info,
.rank-info {
  min-width: 0;
  flex: 1;
}

.teammate-info .name,
.rank-info .name {
  color: var(--text);
  font-weight: 700;
}

.teammate-info .pid,
.teammate-info .remark,
.history-meta {
  color: var(--text-3);
  font-size: 12px;
}

.teammate-actions,
.request-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.teammate-avatar,
.rank-num {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 750;
}

.leaderboard-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.leaderboard-item {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.leaderboard-item:last-child,
.teammate-item:last-child,
.request-item:last-child {
  border-bottom: 0;
}

.leaderboard-item.me {
  background: var(--primary-soft);
}

.rank-num.gold {
  color: #9a5b00;
  border-color: rgba(217, 119, 6, .24);
  background: rgba(245, 158, 11, .16);
}

.rank-num.silver {
  color: var(--text-2);
  background: var(--surface-3);
}

.rank-num.bronze {
  color: #b45309;
  border-color: rgba(180, 83, 9, .22);
  background: rgba(217, 119, 6, .13);
}

.rank-stats .count {
  color: var(--text);
  font-weight: 750;
}

.rank-self-card .card-body,
.security-actions {
  display: grid;
  gap: 10px;
}

.kook-binding-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.kook-binding-status.bound {
  border-color: rgba(52, 199, 89, .35);
  background: rgba(52, 199, 89, .08);
  color: #248a3d;
}

.kook-binding-status.unbound {
  border-color: rgba(255, 159, 10, .35);
  background: rgba(255, 159, 10, .08);
  color: #a35f00;
}

.kook-binding-status.error {
  border-color: rgba(255, 59, 48, .3);
  color: #d70015;
}

.self-rank-row,
.profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.self-rank-row span,
.profile-item .label {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
}

.self-rank-row strong,
.profile-item span:last-child,
.profile-item .value {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.profile-item:last-child,
.self-rank-row:last-of-type {
  border-bottom: 0;
}

/* Modals and overlays */
.modal-overlay,
.success-overlay,
.lg-alert-overlay,
.smart-rec-overlay,
.route-loading {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 15, .54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-overlay.active,
.success-overlay.open,
.lg-alert-overlay.open,
.smart-rec-overlay.open,
.route-loading.active {
  display: flex;
}

.modal,
.forgot-card,
.smart-rec-box,
.lg-alert-box,
.smodal,
.route-loader-card {
  width: min(100%, 520px);
  max-height: min(86dvh, 760px);
  overflow: auto;
  animation: fxPop .18s var(--ease) both;
}

.modal-header,
.history-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3,
.forgot-brand h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close,
.history-drawer-close {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.modal-body,
.forgot-body {
  padding: 14px;
}

.modal-footer,
.forgot-actions {
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.forgot-card {
  width: min(100%, 430px);
}

.forgot-brand {
  padding: 18px 18px 0;
  margin-bottom: 0;
}

.forgot-brand p {
  margin: 2px 0 0;
  color: var(--text-3);
}

.forgot-pwd-wrap {
  position: relative;
}

.forgot-pwd-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 30px;
  min-height: 30px;
  padding: 0;
}

.forgot-pwd-wrap input {
  padding-right: 42px;
}

.smodal,
.lg-alert-box,
.route-loader-card {
  width: min(100%, 360px);
  padding: 22px;
  text-align: center;
}

.sm-check,
.lg-alert-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid rgba(22, 163, 74, .24);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success);
}

.lg-alert-icon {
  border-color: rgba(229, 72, 77, .24);
  background: var(--error-bg);
  color: var(--error);
}

.sm-text,
.lg-alert-text {
  margin: 0 0 14px;
  color: var(--text-2);
}

.history-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  background: rgba(8, 10, 15, .5);
}

.history-mask.open {
  display: block;
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-modal);
  width: min(420px, 100vw);
  height: 100dvh;
  border-radius: 0;
  transform: translateX(100%);
  transition: transform var(--normal);
}

.history-drawer.open {
  transform: translateX(0);
}

.history-list {
  height: calc(100dvh - 53px);
  overflow: auto;
}

.history-card {
  display: block;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-id {
  color: var(--text);
  font-weight: 750;
}

.history-card-body {
  margin-top: 8px;
  color: var(--text-2);
}

.smart-rec-box {
  width: min(720px, 100%);
}

.smart-rec-title {
  padding: 14px 14px 0;
}

.smart-rec-area {
  display: block;
  min-height: 260px;
  margin: 14px;
  width: calc(100% - 28px);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.smart-rec-summary {
  display: none;
  margin: 0 14px 14px;
  padding: 10px 12px;
  color: var(--text-2);
}

.smart-rec-summary.open {
  display: block;
}

.smart-rec-btns {
  justify-content: flex-end;
  padding: 0 14px 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-toast);
  min-width: 220px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--fast), transform var(--fast);
}

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

.toast.success {
  border-color: rgba(22, 163, 74, .26);
  color: var(--success);
}

.toast.error {
  border-color: rgba(229, 72, 77, .26);
  color: var(--error);
}

.route-loading.handoff {
  opacity: 0;
  transition: opacity .28s var(--ease);
}

.route-loader-mark {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: fxSpin .8s linear infinite;
}

.route-loader-card strong,
.route-loader-card small {
  display: block;
}

.route-loader-card small {
  margin-top: 4px;
  color: var(--text-3);
}

/* Mobile */
.bottom-nav {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .workspace-rail {
    padding-inline: 8px;
  }

  .rail-section-label,
  .tab-item span:not(.tab-icon) {
    display: none;
  }

  .tab-item {
    justify-content: center;
    padding: 0;
  }

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

  .team-grid,
  .profile-layout,
  .rank-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px),
       (max-width: 900px) and (max-height: 540px) and (orientation: landscape) {
  body {
    padding-bottom: 76px;
  }

  .app-shell {
    display: block;
  }

  .workspace-rail,
  .navbar {
    display: none;
  }

  .content {
    padding: 14px;
  }

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: var(--z-sticky);
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .bottom-nav-items {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 5px;
  }

  .bottom-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    font-size: 11px;
  }

  .page-hero,
  .page-strip,
  .form-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions,
  .segmented-control,
  .strip-metrics {
    width: 100%;
  }

  .hero-actions .quick-btn,
  .segmented-control .quick-btn,
  .strip-metrics > div {
    flex: 1;
  }

  .ops-grid,
  .mode-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar input,
  .filter-bar .custom-select {
    width: 100%;
    max-width: none;
  }

  .datetime-row {
    grid-template-columns: 1fr;
  }

  .dt-time-col,
  .close-proof-actions,
  .modal-footer,
  .forgot-actions,
  .smart-rec-btns {
    width: 100%;
  }

  .modal-footer button,
  .forgot-actions button,
  .smart-rec-btns button,
  .close-proof-actions button {
    flex: 1;
  }

  .glass-calendar.open {
    width: min(292px, calc(100vw - 48px));
  }

  .modal-overlay,
  .success-overlay,
  .lg-alert-overlay,
  .smart-rec-overlay {
    padding: 12px;
  }

  .modal,
  .forgot-card,
  .smart-rec-box,
  .lg-alert-box,
  .smodal {
    max-height: 88dvh;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 84px;
  }

  .login-page {
    padding: 18px;
  }

  .login-shell {
    display: none;
  }

  .login-card {
    width: 100%;
    margin-top: 7vh;
    padding: 18px;
  }
}

/* Target Mode redesign: large-radius B2B console with Uiverse-inspired CSS interactions */
:root {
  --primary: #3451ff;
  --primary-2: #0ea5e9;
  --accent: var(--primary);
  --accent-light: #6d7dff;
  --primary-soft: rgba(52, 81, 255, .1);
  --primary-line: rgba(52, 81, 255, .28);
  --cyan: #0891b2;
  --green: #16a34a;
  --amber: #d97706;
  --red: #e5484d;
  --card-radius: 14px;
  --panel-radius: 16px;
  --control-radius: 10px;
  --uiverse-glow: 0 0 0 1px var(--primary-line), 0 14px 32px rgba(52, 81, 255, .16);
  --login-panel-width: 440px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #9aa4ff;
    --primary-2: #38bdf8;
    --accent-light: #b8bfff;
    --primary-soft: rgba(154, 164, 255, .13);
    --primary-line: rgba(154, 164, 255, .36);
    --cyan: #22d3ee;
    --green: #34d399;
    --amber: #f59e0b;
    --red: #fb7185;
    --uiverse-glow: 0 0 0 1px var(--primary-line), 0 16px 36px rgba(154, 164, 255, .18);
  }
}

body {
  background:
    radial-gradient(circle at 16% -10%, rgba(94, 106, 210, .11), transparent 34%),
    radial-gradient(circle at 78% 6%, rgba(8, 145, 178, .08), transparent 30%),
    var(--bg);
}

.login-page {
  display: grid;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 54px);
  grid-template-columns: minmax(0, 1fr) var(--login-panel-width);
  align-items: center;
  gap: clamp(28px, 6vw, 84px);
  background:
    linear-gradient(90deg, rgba(6, 8, 14, .18), rgba(6, 8, 14, .42)),
    var(--login-bg-image) center / cover no-repeat,
    var(--bg);
}

#loginPage[style*="display: flex"],
#changePwdPage[style*="display: flex"] {
  display: grid !important;
}

@media (prefers-color-scheme: light) {
  .login-page {
    background:
      linear-gradient(90deg, rgba(246, 247, 251, .1), rgba(246, 247, 251, .64)),
      var(--login-bg-image) center / cover no-repeat,
      var(--bg);
  }
}

.login-page::after {
  content: "";
  display: none;
}

.login-shell {
  display: none;
}

.login-card {
  grid-column: 2;
  width: 100%;
  min-height: auto;
  margin: 0;
  padding: 28px;
  transform:
    perspective(920px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  border-radius: var(--panel-radius);
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 96%, transparent), var(--surface-raised));
  box-shadow: var(--shadow-3);
  transition:
    transform .22s var(--spring),
    box-shadow .22s var(--ease),
    border-color .22s var(--ease);
}

.login-card:hover {
  transform:
    perspective(920px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(-2px);
  box-shadow: var(--uiverse-glow);
}

.login-brand {
  margin-bottom: 24px;
}

.brand-mark,
.forgot-icon,
.metric-icon,
.mode-icon,
.teammate-avatar,
.rank-num,
.sm-check,
.lg-alert-icon {
  border-radius: var(--control-radius);
}

.brand-mark {
  width: 48px;
  height: 48px;
}

.brand-copy h1 {
  font-size: 29px;
  letter-spacing: -0.02em;
}

.login-quote {
  width: 100%;
  margin-bottom: 22px;
  padding: 13px 14px;
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--surface-2) 86%, var(--primary-soft));
}

.lf + .lf {
  margin-top: 14px;
}

input,
textarea,
.cs-trigger,
.time-picker,
.date-display {
  min-height: 46px;
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--surface) 96%, var(--primary-soft));
}

textarea {
  min-height: 118px;
}

.login-btn,
.forgot-submit,
.forgot-cancel,
.btn,
.quick-btn,
.logout-btn,
.btn-secondary,
.pagination button,
.modal-footer button,
.teammate-actions button,
.request-actions button,
.order-detail-btn,
.btn-edit-order,
#tab-submit .btn-back-mode,
#tab-submit .btn-close-proof-reset,
.gc-nav-btn,
.gc-btn-clear,
.gc-btn-now,
.modal-close,
.history-drawer-close,
.forgot-pwd-toggle,
.btn-sm-close,
#tab-submit .btn-smart-rec,
#tab-submit .btn-close-proof {
  min-height: 42px;
  border-radius: var(--control-radius);
}

.login-btn,
.quick-btn.primary,
.forgot-submit,
.btn-primary,
#tab-submit .btn-submit,
#tab-submit .btn-smart-rec,
#tab-submit .btn-close-proof {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-btn::before,
.quick-btn.primary::before,
.forgot-submit::before,
.btn-primary::before,
#tab-submit .btn-submit::before,
#tab-submit .btn-smart-rec::before,
#tab-submit .btn-close-proof::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background:
    linear-gradient(120deg, transparent 15%, rgba(255,255,255,.28), transparent 42%),
    linear-gradient(135deg, var(--primary), var(--primary-2));
  transform: translateX(-70%);
  transition: transform .55s var(--ease);
}

.login-btn:hover::before,
.quick-btn.primary:hover::before,
.forgot-submit:hover::before,
.btn-primary:hover::before,
#tab-submit .btn-submit:hover::before,
#tab-submit .btn-smart-rec:hover::before,
#tab-submit .btn-close-proof:hover::before {
  transform: translateX(0);
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.workspace-rail {
  padding: 18px 12px;
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
}

.tabbar {
  gap: 7px;
}

.tab-item {
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--control-radius);
}

.tab-icon {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  background: transparent;
  transition: background var(--fast), transform .18s var(--spring);
}

.tab-item.active .tab-icon,
.tab-item:hover .tab-icon {
  background: color-mix(in srgb, var(--primary-soft) 86%, transparent);
}

.tab-item:hover .tab-icon {
  transform: translateY(-1px);
}

.navbar {
  min-height: 68px;
  padding: 14px 28px;
}

.content {
  width: min(100%, 1240px);
  padding: 28px;
}

.page-hero,
.page-strip {
  margin-bottom: 18px;
}

.page-hero {
  min-height: 154px;
  padding: 28px;
  border-radius: var(--panel-radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 82%, var(--primary-soft))),
    var(--surface);
}

.page-hero h1,
.page-strip h1 {
  font-size: 32px;
  letter-spacing: -0.025em;
}

.ops-grid,
.dashboard-main,
.team-grid,
.profile-layout,
.rank-layout {
  gap: 16px;
}

.ops-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat-card,
.card,
.submit-card,
.rank-list-panel,
.modal,
.forgot-card,
.smart-rec-box,
.lg-alert-box,
.smodal,
.history-drawer,
.route-loader-card {
  border-radius: var(--card-radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface));
  box-shadow: var(--shadow-1);
  transition:
    transform .2s var(--spring),
    box-shadow .2s var(--ease),
    border-color .2s var(--ease),
    background-color .2s var(--ease);
}

.stat-card {
  min-height: 164px;
  padding: 20px;
  transform:
    perspective(860px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
}

.stat-card:hover,
.card:hover,
.submit-card:hover,
.rank-list-panel:hover,
.mode-card:hover {
  transform:
    perspective(860px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(-2px);
  box-shadow: var(--uiverse-glow);
}

.card-header {
  min-height: 70px;
  padding: 18px 20px;
}

.card-header h3 {
  font-size: 17px;
}

.card-body {
  padding: 20px;
}

.data-panel .card-body,
.recent-card .card-body {
  padding: 0;
}

.filter-bar {
  padding: 16px;
}

th,
td {
  height: 56px;
  padding: 0 18px;
}

.badge,
.history-status,
.close-proof-status,
.current-mode-tag,
.sm-status,
.discount-hint,
.wage-hint,
.submit-closed-notice {
  border-radius: 999px;
}

.badge,
.history-status,
.close-proof-status,
.current-mode-tag,
.sm-status {
  min-height: 28px;
  padding: 0 11px;
}

.submit-card {
  padding: 22px;
}

.submit-layout {
  max-width: 1080px;
}

.process-steps span {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
}

.mode-grid {
  gap: 14px;
}

.mode-card {
  min-height: 172px;
  padding: 20px;
  border-radius: var(--card-radius);
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transition:
    transform .22s var(--spring),
    box-shadow .22s var(--ease),
    border-color .22s var(--ease),
    background-color .22s var(--ease);
}

.mode-icon {
  width: 44px;
  height: 44px;
}

.form-grid {
  gap: 16px;
}

.section-title {
  min-height: 40px;
  margin-top: 8px;
  padding-top: 16px;
}

.close-proof,
.remark-locked,
.smart-rec-summary,
.discount-hint,
.wage-hint {
  border-radius: var(--card-radius);
}

.close-proof {
  padding: 18px;
}

.glass-calendar.open,
.tp-dropdown,
.cs-dropdown {
  border-radius: 20px;
}

.leaderboard-list {
  border-radius: var(--card-radius);
}

.teammate-item,
.request-item,
.leaderboard-item,
.history-card {
  padding: 16px 20px;
}

.modal,
.forgot-card,
.smart-rec-box {
  border-radius: var(--panel-radius);
}

.modal-header,
.history-drawer-head {
  min-height: 68px;
  padding: 16px 20px;
}

.modal-body,
.forgot-body {
  padding: 20px;
}

.modal-footer,
.forgot-actions {
  padding: 16px 20px;
}

.history-drawer {
  width: min(500px, 100vw);
}

.empty-state {
  min-height: 210px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 30px;
}

.empty-state::before {
  content: "";
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, var(--primary-soft), transparent 62%),
    var(--surface-2);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent);
}

.empty-state p {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 680;
}

.empty-state small {
  max-width: 280px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

td.empty-state {
  display: table-cell;
  height: 220px;
  vertical-align: middle;
}

td.empty-state::before {
  display: none;
}

.bottom-nav {
  border-radius: 24px;
}

.bottom-nav-item {
  border-radius: 18px;
}

.uiverse-card-glow,
.stat-card,
.mode-card,
.card {
  will-change: transform;
}

/* B-side layout rewrite */
.rail-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 76%, var(--primary-soft))),
    var(--surface);
}

.rail-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--control-radius);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.rail-brand strong,
.rail-brand span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-brand strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.rail-brand span {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
}

.rail-menu-label {
  margin: 16px 8px 6px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 760;
}

.navbar {
  justify-content: space-between;
}

.navbar-left {
  display: grid;
  gap: 2px;
}

.nav-breadcrumb {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
}

#navCurrentTitle {
  color: var(--text);
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: stretch;
}

.ops-assist-card {
  min-height: 100%;
}

.ops-assist-body,
.security-actions {
  display: grid;
  gap: 12px;
}

.assist-note {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background:
    linear-gradient(135deg, var(--primary-soft), transparent 68%),
    var(--surface-2);
}

.assist-note strong {
  color: var(--text);
  font-size: 13px;
}

.assist-note span {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.65;
}

.data-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 18px 20px 0;
}

.data-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.01em;
}

.data-panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12px;
}

.submit-layout {
  max-width: 1180px;
}

.submit-workbench {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.submit-guide-card {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface));
  box-shadow: var(--shadow-1);
}

.guide-head {
  display: grid;
  gap: 6px;
}

.guide-head span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}

.guide-head strong {
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.guide-list {
  display: grid;
  gap: 12px;
}

.guide-list div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.guide-list b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
}

.guide-list span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .rail-brand {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px;
  }

  .rail-brand > div:not(.rail-brand-mark),
  .rail-menu-label {
    display: none;
  }

  .dashboard-main-grid,
  .submit-workbench {
    grid-template-columns: 1fr;
  }

  .submit-guide-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 760px) {
  .login-page {
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 18px;
    background:
      linear-gradient(180deg, rgba(8, 10, 15, .18), rgba(8, 10, 15, .64)),
      var(--login-bg-image) center / cover no-repeat,
      var(--bg);
  }

  .login-page::after {
    display: none;
  }

  .login-card {
    grid-column: 1;
    width: 100%;
    margin: 0;
    padding: 22px;
    border-radius: 24px;
  }

  .content {
    padding: 16px;
  }

  .page-hero {
    padding: 20px;
  }

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

  .stat-card {
    min-height: 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .mode-card,
  .stat-card,
  .login-card {
    transform: none !important;
  }
}

/* Small-radius product refinement */
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --card-radius: 14px;
  --panel-radius: 16px;
  --control-radius: 10px;
}

.rail-brand,
.page-hero,
.page-strip,
.stat-card,
.card,
.submit-card,
.submit-guide-card,
.rank-list-panel,
.modal,
.forgot-card,
.smart-rec-box,
.lg-alert-box,
.smodal,
.history-drawer,
.route-loader-card,
.assist-note,
.empty-state::before,
.close-proof,
.remark-locked,
.discount-hint,
.wage-hint {
  border-radius: var(--card-radius);
}

.login-card {
  border-radius: var(--panel-radius);
}

.rail-brand-mark {
  overflow: hidden;
  color: inherit;
  background: var(--surface);
  box-shadow: none;
}

.rail-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-btn.primary,
#tab-submit .btn-submit,
#tab-submit .btn-smart-rec,
#tab-submit .btn-close-proof {
  color: #fff !important;
  border-color: color-mix(in srgb, var(--primary) 74%, #fff);
  background: var(--primary) !important;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 18%, transparent);
}

.quick-btn.primary::before,
#tab-submit .btn-submit::before,
#tab-submit .btn-smart-rec::before,
#tab-submit .btn-close-proof::before {
  display: none;
}

.quick-btn.primary:hover,
#tab-submit .btn-submit:hover:not(:disabled),
#tab-submit .btn-smart-rec:hover,
#tab-submit .btn-close-proof:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 92%, #000) !important;
  transform: translateY(-1px);
}

#tab-submit .btn-submit:active:not(:disabled),
#tab-submit .btn-smart-rec:active,
#tab-submit .btn-close-proof:active {
  transform: translateY(0);
}

#tab-submit .btn-submit:disabled {
  border-color: var(--line);
  background: var(--surface-3) !important;
  color: var(--muted) !important;
  box-shadow: none;
  opacity: 1;
}

.hero-actions .quick-btn {
  min-width: 112px;
}

.ops-assist-body .quick-btn {
  justify-content: center;
  width: 100%;
}

.ops-grid {
  grid-template-columns: 1.06fr 1.06fr 1.06fr 1.22fr;
  gap: 14px;
}

.stat-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 98%, transparent), color-mix(in srgb, var(--surface-2) 74%, var(--primary-soft))),
    var(--surface);
  box-shadow: 0 1px 2px rgba(16, 17, 20, .06);
}

.stat-card:nth-child(1) {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 92%, var(--surface)), var(--surface));
}

.stat-card:nth-child(2) {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--warning-bg) 88%, var(--surface)), var(--surface));
}

.stat-card:nth-child(3) {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--success-bg) 88%, var(--surface)), var(--surface));
}

.stat-card:hover,
.card:hover,
.submit-card:hover,
.rank-list-panel:hover,
.mode-card:hover {
  box-shadow: 0 10px 24px rgba(16, 17, 20, .09);
}

.metric-icon,
.mode-icon,
.tab-icon,
.bottom-nav-item .icon,
.brand-mark,
.forgot-icon,
.teammate-avatar,
.rank-num,
.sm-check,
.lg-alert-icon {
  border-radius: var(--control-radius);
}

.metric-icon {
  width: 36px;
  height: 36px;
}

.stat-card .value {
  margin-top: 8px;
  font-size: 28px;
}

.month-card .split-metrics {
  align-items: end;
  min-height: 70px;
}

.bottom-nav {
  border-radius: var(--card-radius);
}

.bottom-nav-item {
  border-radius: var(--control-radius);
}

.submit-strip {
  display: block;
}

.submit-workbench {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.submit-guide-card.uiverse-submit-card {
  position: sticky;
  top: 92px;
  min-height: 248px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform-style: preserve-3d;
}

.uiverse-card-layer {
  position: absolute;
  inset: 20px 10px;
  border-radius: var(--card-radius);
  transition:
    transform .24s var(--spring),
    box-shadow .24s var(--ease),
    border-color .24s var(--ease);
}

.uiverse-card-layer.layer-back {
  transform: translate(18px, 18px) rotate(3deg);
  border: 1px solid rgba(245, 158, 11, .24);
  background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(52, 81, 255, .08));
}

.uiverse-card-layer.layer-mid {
  transform: translate(8px, 8px) rotate(1.5deg);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, var(--primary-soft));
  box-shadow: 0 10px 22px rgba(16, 17, 20, .08);
}

.uiverse-card-layer.layer-front {
  display: grid;
  place-items: center;
  transform: translateZ(12px);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background:
    radial-gradient(circle at 24% 20%, rgba(245, 158, 11, .2), transparent 26%),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 70%, var(--primary-soft)));
  box-shadow: 0 16px 36px rgba(16, 17, 20, .1);
}

.uiverse-card-layer.layer-front span,
.uiverse-card-layer.layer-front b,
.uiverse-card-layer.layer-front i {
  display: block;
  border-radius: 999px;
}

.uiverse-card-layer.layer-front span {
  width: 58px;
  height: 58px;
  background:
    linear-gradient(135deg, #ff9f1c, #3451ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38);
}

.uiverse-card-layer.layer-front b {
  position: absolute;
  right: 34px;
  top: 38px;
  width: 20px;
  height: 20px;
  background: var(--success);
}

.uiverse-card-layer.layer-front i {
  position: absolute;
  left: 34px;
  bottom: 36px;
  width: 32px;
  height: 8px;
  background: color-mix(in srgb, var(--primary) 42%, transparent);
}

.submit-guide-card.uiverse-submit-card:hover .layer-back {
  transform: translate(24px, 22px) rotate(4deg);
}

.submit-guide-card.uiverse-submit-card:hover .layer-mid {
  transform: translate(12px, 10px) rotate(2deg);
}

.submit-guide-card.uiverse-submit-card:hover .layer-front {
  transform: translateY(-3px) translateZ(18px);
  box-shadow: 0 18px 38px rgba(16, 17, 20, .13);
}

@media (max-width: 1080px) {
  .ops-grid,
  .dashboard-main-grid,
  .submit-workbench {
    grid-template-columns: 1fr;
  }

  .submit-guide-card.uiverse-submit-card {
    position: relative;
    top: auto;
    min-height: 156px;
  }
}

/* Changelog tab */
.changelog-strip {
  align-items: center;
}

.changelog-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(22, 163, 74, .22);
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.firefly-dot,
.command-pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
  animation: fireflyPulse 1.9s ease-out infinite;
}

@keyframes fireflyPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 34%, transparent);
  }
  72% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--success) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 0%, transparent);
  }
}

.changelog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.changelog-card {
  overflow: hidden;
}

.changelog-body {
  padding: 0;
}

.changelog-entry {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  transition:
    background-color .18s var(--ease),
    transform .18s var(--ease);
}

.changelog-entry:last-child {
  border-bottom: 0;
}

.changelog-entry::before {
  content: "";
  position: absolute;
  left: 145px;
  top: 34px;
  bottom: -34px;
  width: 1px;
  background: var(--line);
}

.changelog-entry:last-child::before {
  display: none;
}

.changelog-entry::after {
  content: "";
  position: absolute;
  left: 140px;
  top: 31px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--text-3);
  box-shadow: 0 0 0 1px var(--line);
}

.changelog-entry.is-current {
  background:
    linear-gradient(135deg, var(--success-bg), transparent 62%),
    color-mix(in srgb, var(--surface) 96%, var(--primary-soft));
}

.changelog-entry.is-current::after {
  background: var(--success);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--success) 36%, transparent),
    0 0 16px color-mix(in srgb, var(--success) 24%, transparent);
}

.changelog-entry:hover {
  background-color: color-mix(in srgb, var(--surface-2) 80%, var(--primary-soft));
  transform: translateY(-1px);
}

.changelog-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.changelog-version {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
}

.changelog-entry.is-current .changelog-version {
  border-color: rgba(22, 163, 74, .28);
  background: var(--success-bg);
  color: var(--success);
}

.changelog-meta time {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
}

.changelog-copy {
  min-width: 0;
}

.changelog-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.changelog-entry-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
}

.changelog-entry-head span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.changelog-points {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.changelog-points li {
  position: relative;
  padding-left: 15px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.changelog-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .75em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--success);
}

.changelog-command-card {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  min-height: 212px;
  padding: 20px;
  overflow: hidden;
  border-color: rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at 18% 16%, rgba(52, 81, 255, .34), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(52, 211, 153, .18), transparent 24%),
    linear-gradient(145deg, #090d14, #121a28 58%, #0d121c);
  color: #f8fafc;
}

.changelog-command-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 50%;
  opacity: .7;
}

.changelog-command-head {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b8c3d8;
  font-size: 12px;
  font-weight: 760;
}

.changelog-command-card strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.2;
}

.changelog-signal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  align-self: end;
  padding-top: 8px;
}

.changelog-signal span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(52, 211, 153, .9), rgba(56, 189, 248, .78), rgba(255, 255, 255, .08));
  box-shadow: 0 0 18px rgba(52, 211, 153, .16);
  opacity: .9;
}

.changelog-signal span:nth-child(1) {
  width: 78%;
}

.changelog-signal span:nth-child(2) {
  width: 58%;
  background:
    linear-gradient(90deg, rgba(96, 165, 250, .88), rgba(154, 164, 255, .62), rgba(255, 255, 255, .06));
}

.changelog-signal span:nth-child(3) {
  width: 88%;
  background:
    linear-gradient(90deg, rgba(251, 146, 60, .82), rgba(52, 211, 153, .52), rgba(255, 255, 255, .06));
}

@media (max-width: 1080px) {
  .changelog-layout {
    grid-template-columns: 1fr;
  }

  .changelog-command-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 760px) {
  .changelog-strip {
    align-items: stretch;
  }

  .changelog-status {
    justify-content: center;
    width: 100%;
  }

  .changelog-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .changelog-entry::before,
  .changelog-entry::after {
    display: none;
  }

  .changelog-entry-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .bottom-nav-items {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
  }

  .bottom-nav-item {
    min-width: 0;
    font-size: 10px;
  }

  .bottom-nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .bottom-nav-item .icon svg {
    width: 17px;
    height: 17px;
  }
}

/* Mobile workspace adaptation */
@media (max-width: 760px),
       (max-width: 900px) and (max-height: 540px) and (orientation: landscape) {
  body {
    padding-bottom: 0;
    background:
      linear-gradient(180deg, rgba(52, 81, 255, .055), transparent 220px),
      var(--bg);
  }

  .main-page.active .workspace-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell {
    display: block;
  }

  .workspace-rail {
    display: none;
  }

  .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px))
      8px
      max(12px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
  }

  .navbar-left {
    min-width: 0;
  }

  .nav-breadcrumb,
  .nav-state {
    display: none;
  }

  #navCurrentTitle {
    display: block;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .navbar-right {
    flex: 0 0 auto;
    gap: 6px;
  }

  .nav-pid {
    min-height: 40px;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .logout-btn {
    min-height: 40px;
  }

  .content {
    width: 100%;
    padding:
      14px
      max(12px, env(safe-area-inset-right, 0px))
      16px
      max(12px, env(safe-area-inset-left, 0px));
  }

  .page-hero,
  .page-strip,
  .form-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 14px;
  }

  .page-hero {
    min-height: 0;
    padding: 18px;
  }

  .page-hero h1,
  .page-strip h1 {
    font-size: 28px;
    line-height: 1.16;
    overflow-wrap: anywhere;
  }

  .page-hero p {
    max-width: 34ch;
    font-size: 13px;
    line-height: 1.6;
  }

  .hero-actions,
  .segmented-control,
  .strip-metrics {
    width: 100%;
    gap: 8px;
  }

  .hero-actions .quick-btn,
  .segmented-control .quick-btn,
  .strip-metrics > div {
    flex: 1;
  }

  input,
  textarea,
  .cs-trigger,
  .time-picker,
  .date-display {
    min-height: 48px;
    font-size: 16px;
  }

  .quick-btn,
  .logout-btn,
  .btn,
  .btn-primary,
  .btn-secondary,
  .forgot-submit,
  .forgot-cancel,
  .pagination button,
  .modal-footer button,
  .teammate-actions button,
  .request-actions button,
  .order-detail-btn,
  .btn-edit-order,
  #tab-submit .btn-back-mode,
  #tab-submit .btn-submit,
  #tab-submit .btn-smart-rec,
  #tab-submit .btn-close-proof,
  #tab-submit .btn-close-proof-reset,
  .modal-close,
  .history-drawer-close,
  .forgot-pwd-toggle,
  .btn-sm-close {
    min-height: 44px;
    touch-action: manipulation;
  }

  .quick-btn.dense {
    min-height: 44px;
  }

  .ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    min-height: 120px;
    padding: 14px;
  }

  .stat-card .value {
    font-size: 26px;
  }

  .month-card {
    grid-column: 1 / -1;
    min-height: 112px;
  }

  .ops-grid .stat-card:nth-child(3) {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 76px;
  }

  .ops-grid .stat-card:nth-child(3) .metric-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .ops-grid .stat-card:nth-child(3) .label {
    grid-column: 2;
    grid-row: 1;
  }

  .ops-grid .stat-card:nth-child(3) .value {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0;
  }

  .month-card .split-metrics {
    min-height: 0;
    justify-content: space-between;
  }

  .split-metrics > div,
  .strip-metrics > div {
    min-width: 0;
  }

  .card-header,
  .data-panel-head {
    min-height: 0;
    padding: 14px 16px;
  }

  .card-header > div,
  .data-panel-head > div {
    min-width: 0;
  }

  .card-header span,
  .data-panel-head span {
    line-height: 1.45;
    white-space: normal;
  }

  .card-body,
  .submit-card {
    padding: 16px;
  }

  .data-panel .card-body,
  .recent-card .card-body {
    padding: 0;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .filter-bar input {
    grid-column: 1 / -1;
  }

  .filter-bar .custom-select {
    width: 100%;
    min-width: 0;
  }

  .filter-bar .custom-select:last-child {
    grid-column: 1 / -1;
  }

  .form-grid,
  .datetime-row {
    grid-template-columns: 1fr;
  }

  .table-wrap,
  .recent-card .card-body {
    overflow: visible;
  }

  .table-wrap table,
  .recent-card table {
    display: block;
    min-width: 0;
  }

  .table-wrap thead,
  .recent-card thead {
    display: none;
  }

  .table-wrap tbody,
  .recent-card tbody {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .table-wrap tbody tr,
  .recent-card tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    background: var(--surface);
  }

  .table-wrap tbody td,
  .recent-card tbody td {
    display: grid;
    align-content: start;
    gap: 3px;
    height: auto;
    min-height: 56px;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    color: var(--text);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .table-wrap tbody td::before,
  .recent-card tbody td::before {
    color: var(--text-3);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
  }

  .table-wrap tbody td:nth-child(1)::before,
  .recent-card tbody td:nth-child(1)::before { content: "订单编号"; }
  .table-wrap tbody td:nth-child(2)::before,
  .recent-card tbody td:nth-child(2)::before { content: "类型"; }
  .table-wrap tbody td:nth-child(3)::before,
  .recent-card tbody td:nth-child(3)::before { content: "金额"; }
  .table-wrap tbody td:nth-child(4)::before,
  .recent-card tbody td:nth-child(4)::before { content: "个人应得"; }
  .table-wrap tbody td:nth-child(5)::before,
  .recent-card tbody td:nth-child(5)::before { content: "状态"; }
  .table-wrap tbody td:nth-child(6)::before,
  .recent-card tbody td:nth-child(6)::before { content: "时间"; }
  .table-wrap tbody td:nth-child(7)::before,
  .recent-card tbody td:nth-child(7)::before { content: "派单客服"; }
  .table-wrap tbody td:nth-child(8)::before,
  .recent-card tbody td:nth-child(8)::before { content: "板板 ID"; }
  .table-wrap tbody td:nth-child(9)::before,
  .recent-card tbody td:nth-child(9)::before { content: "队友名称"; }
  .table-wrap tbody td:nth-child(10)::before,
  .recent-card tbody td:nth-child(10)::before { content: "操作"; }

  .table-wrap tbody td:nth-child(1),
  .table-wrap tbody td:nth-child(10),
  .recent-card tbody td:nth-child(1),
  .recent-card tbody td:nth-child(10),
  .table-wrap tbody td[colspan],
  .recent-card tbody td[colspan] {
    grid-column: 1 / -1;
  }

  .table-wrap tbody td:nth-child(1),
  .recent-card tbody td:nth-child(1) {
    border-bottom: 1px solid var(--line);
  }

  .table-wrap tbody td:nth-child(10),
  .recent-card tbody td:nth-child(10) {
    border-top: 1px solid var(--line);
  }

  .table-wrap tbody td:nth-child(10) button,
  .recent-card tbody td:nth-child(10) button {
    width: 100%;
  }

  .table-wrap tbody td[colspan],
  .recent-card tbody td[colspan] {
    min-height: 128px;
    place-items: center;
    text-align: center;
  }

  .table-wrap tbody td[colspan]::before,
  .recent-card tbody td[colspan]::before,
  .table-wrap tbody td.loading::before,
  .recent-card tbody td.loading::before,
  .table-wrap tbody td.empty-state::before,
  .recent-card tbody td.empty-state::before {
    content: "";
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px;
  }

  .pagination .info {
    flex-basis: 100%;
    justify-content: center;
    order: -1;
  }

  .submit-guide-card.uiverse-submit-card {
    display: none;
  }

  .submit-workbench {
    display: block;
  }

  .mode-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 270px);
    gap: 10px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .mode-grid::-webkit-scrollbar,
  .bottom-nav-items::-webkit-scrollbar {
    display: none;
  }

  .mode-card {
    min-height: 144px;
    scroll-snap-align: start;
  }

  .tp-open .tp-dropdown {
    width: 96px;
    max-height: min(264px, 50dvh);
    scroll-behavior: auto;
  }

  .tp-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
  }

  .empty-state {
    min-height: 160px;
    padding: 22px;
  }

  .modal-overlay,
  .smart-rec-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-overlay .modal,
  .modal-overlay .forgot-card,
  .modal-overlay .smodal,
  .smart-rec-overlay .smart-rec-box {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: mobileSheetIn .2s var(--ease) both;
  }

  .modal-close,
  .history-drawer-close {
    width: 44px;
    padding: 0;
  }

  .history-drawer {
    width: 100vw;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-nav {
    display: none;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  }

  .main-page.active + .bottom-nav {
    display: block;
  }

  .bottom-nav-items {
    display: grid;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 0;
    padding:
      5px
      max(4px, env(safe-area-inset-right, 0px))
      calc(5px + env(safe-area-inset-bottom, 0px))
      max(4px, env(safe-area-inset-left, 0px));
    overflow: visible;
    scrollbar-width: none;
  }

  .bottom-nav-item {
    min-width: 0;
    min-height: 54px;
    padding: 0 2px;
    font-size: 10px;
    touch-action: manipulation;
  }

  .bottom-nav-item .icon {
    width: 22px;
    height: 22px;
  }

  .login-page {
    min-height: 100dvh;
    align-items: end;
    padding:
      max(16px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
  }

  .login-card {
    margin: clamp(88px, 32dvh, 290px) 0 0;
    padding: 20px;
    border-radius: var(--panel-radius);
  }

  .login-meta {
    flex-wrap: wrap;
  }

  @media (hover: none) {
    .stat-card:hover,
    .card:hover,
    .submit-card:hover,
    .rank-list-panel:hover,
    .mode-card:hover,
    .submit-guide-card.uiverse-submit-card:hover .layer-front {
      transform: none;
      box-shadow: var(--shadow-1);
    }
  }
}

@media (max-width: 360px) {
  .nav-pid {
    display: none;
  }

  .logout-btn {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .logout-btn svg {
    width: 18px;
    height: 18px;
  }

  .page-hero h1,
  .page-strip h1 {
    font-size: 26px;
  }

  .card-header,
  .data-panel-head,
  .card-body,
  .submit-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .login-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 540px) {
  .login-page {
    align-items: center;
    padding: 12px max(16px, env(safe-area-inset-right, 0px));
  }

  .login-card {
    width: min(100%, 440px);
    margin: 0 0 0 auto;
  }

  .main-page.active .workspace-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav-item {
    min-height: 48px;
  }
}

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

/* Shared WebGL liquid-glass material for primary actions. */
.liquid-glass-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-image:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, .18),
      transparent 38%,
      rgba(255, 255, 255, .04) 62%,
      rgba(0, 0, 0, .09)
    ) !important;
  background-clip: padding-box;
  border-color: color-mix(
    in srgb,
    var(--liquid-glass-base, var(--primary)) 30%,
    transparent
  ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .20),
    0 2px 4px rgba(16, 17, 20, .12) !important;
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.liquid-glass-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block !important;
  pointer-events: none;
  background:
    radial-gradient(
      circle at var(--liquid-x, 50%) var(--liquid-y, 50%),
      rgba(255, 255, 255, .20),
      rgba(255, 255, 255, .06) 24%,
      transparent 52%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, .11), transparent 46%);
  opacity: .38;
  transform: none !important;
  transition: opacity var(--fast);
}

.liquid-glass-button:hover::before,
.liquid-glass-button:focus-visible::before,
.liquid-glass-button.is-liquid-active::before {
  opacity: .62;
}

.liquid-glass-button:hover,
.liquid-glass-button.is-liquid-active {
  border-color: color-mix(
    in srgb,
    var(--liquid-glass-base, var(--primary)) 42%,
    transparent
  ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 3px 6px rgba(16, 17, 20, .14) !important;
}

.liquid-glass-button:focus-visible {
  outline-color: color-mix(in srgb, var(--primary) 58%, transparent);
  outline-width: 2px;
  outline-offset: 2px;
}

.liquid-glass-webgl {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: screen;
}

.liquid-glass-content {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  max-width: 100%;
  pointer-events: none;
}

.liquid-glass-button:disabled::before {
  opacity: .18;
}

.no-liquid-webgl .liquid-glass-button::before {
  opacity: .46;
}

@media (prefers-color-scheme: dark) {
  .liquid-glass-button {
    border-color: rgba(255, 255, 255, .16) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .17),
      0 2px 4px rgba(0, 0, 0, .24) !important;
  }

  .liquid-glass-button:hover,
  .liquid-glass-button.is-liquid-active {
    border-color: rgba(255, 255, 255, .22) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .21),
      0 3px 6px rgba(0, 0, 0, .28) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .liquid-glass-webgl {
    display: none !important;
  }

  .liquid-glass-button::before {
    opacity: .42;
    transition: none;
  }
}

@media (forced-colors: active) {
  .liquid-glass-button {
    border: 1px solid ButtonText !important;
    background: ButtonFace !important;
    color: ButtonText !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .liquid-glass-button::before,
  .liquid-glass-webgl {
    display: none !important;
  }
}

/* AI privacy settings */
.ai-privacy-card {
  grid-column: 1 / -1;
}

.ai-privacy-card .card-header > div {
  min-width: 0;
}

.ai-privacy-card .card-header > div > span {
  display: block;
  margin-top: 2px;
}

.ai-privacy-state {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.ai-privacy-state.enabled {
  background: var(--success-bg);
  color: var(--success);
}

.ai-privacy-state.disabled {
  background: var(--surface-3);
  color: var(--text-3);
}

.ai-privacy-state.error {
  background: var(--error-bg);
  color: var(--error);
}

.ai-privacy-body {
  display: grid;
  gap: 14px;
}

.ai-privacy-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}

.ai-privacy-toggle:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.ai-privacy-toggle-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-privacy-toggle-copy strong {
  color: var(--text);
  font-size: 14px;
}

.ai-privacy-toggle-copy small {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.ai-privacy-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ai-privacy-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background var(--fast), border-color var(--fast);
}

.ai-privacy-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px rgba(16, 17, 20, .22);
  transition: transform var(--normal);
}

.ai-privacy-toggle input:checked + .ai-privacy-switch {
  border-color: var(--primary);
  background: var(--primary);
}

.ai-privacy-toggle input:checked + .ai-privacy-switch::after {
  transform: translateX(20px);
}

.ai-privacy-toggle input:disabled + .ai-privacy-switch {
  opacity: .55;
  cursor: wait;
}

.ai-query-history {
  display: grid;
  gap: 8px;
}

.ai-query-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-query-history-head strong {
  color: var(--text);
  font-size: 13px;
}

.ai-query-history-head span,
.ai-query-history-empty {
  color: var(--text-3);
  font-size: 12px;
}

.ai-query-history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.ai-query-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.ai-query-history-item:last-child {
  border-bottom: 0;
}

.ai-query-history-item > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-query-history-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-query-history-item span,
.ai-query-history-item time {
  color: var(--text-3);
  font-size: 11px;
}

.ai-query-history-item time {
  flex: 0 0 auto;
}

.ai-query-history-empty {
  padding: 16px 12px;
  text-align: center;
}

/* AI data assistant */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-assistant-trigger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-sticky);
  isolation: isolate;
  display: none;
  place-items: center;
  min-width: 128px;
  min-height: 50px;
  padding: 2px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, .28),
    0 0 24px rgba(104, 91, 255, .22);
  color: #f8f9ff;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.main-page.active + .ai-assistant-trigger {
  display: grid;
}

.ai-assistant-trigger::before {
  content: "";
  position: absolute;
  width: 190%;
  aspect-ratio: 1;
  background: conic-gradient(
    from 0deg,
    transparent 0 11%,
    #3be8ff 20%,
    #746bff 39%,
    #ee5dff 57%,
    #ff4f9a 68%,
    transparent 79% 100%
  );
  animation: aiAssistantSpin 3.2s linear infinite;
}

.ai-assistant-trigger::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(180deg, #171a25, #0f1118);
}

.ai-trigger-core {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 17px;
  font-weight: 750;
}

.ai-trigger-core svg {
  width: 20px;
  height: 20px;
  color: #c4c7ff;
  filter: drop-shadow(0 0 6px rgba(126, 116, 255, .8));
}

.ai-assistant-trigger:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .34),
    0 0 34px rgba(95, 203, 255, .3),
    0 0 28px rgba(223, 76, 255, .2);
}

.ai-assistant-trigger:active {
  transform: scale(.98);
}

.ai-assistant-trigger:focus-visible {
  outline: 3px solid rgba(124, 211, 255, .72);
  outline-offset: 4px;
}

.ai-assistant-open {
  overflow: hidden;
}

.ai-assistant-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  justify-items: end;
  background: rgba(4, 6, 10, .58);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity .2s var(--ease), visibility .2s var(--ease);
}

.ai-assistant-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ai-assistant-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 100vw);
  height: 100dvh;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(116, 126, 255, .055), transparent 230px),
    var(--surface);
  box-shadow: -18px 0 48px rgba(0, 0, 0, .34);
  transform: translateX(24px);
  transition: transform .24s var(--ease);
}

.ai-assistant-overlay.active .ai-assistant-panel {
  transform: translateX(0);
}

.ai-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.ai-assistant-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ai-assistant-mark,
.ai-message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-light);
  background: var(--primary-soft);
}

.ai-assistant-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.ai-assistant-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-assistant-title-row h2 {
  margin: 0;
  font-size: 16px;
}

.ai-assistant-title-row span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--accent-light);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 700;
}

.ai-assistant-identity p,
.ai-assistant-footer > p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

.ai-assistant-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 24px;
  line-height: 1;
}

.ai-assistant-close:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.ai-assistant-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.ai-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
  padding: 22px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 58%, var(--line-strong)) transparent;
}

.ai-assistant-messages::-webkit-scrollbar {
  width: 9px;
}

.ai-assistant-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-assistant-messages::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 55%, var(--line-strong));
  background-clip: padding-box;
}

.ai-assistant-messages::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 74%, var(--line-strong));
  background-clip: padding-box;
}

.ai-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 88%;
}

.ai-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.ai-message-avatar svg {
  width: 17px;
  height: 17px;
}

.ai-message p {
  margin: 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-message-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ai-message-content > p {
  width: 100%;
}

.ai-analysis {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.ai-analysis summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.ai-analysis summary::marker {
  color: var(--primary);
}

.ai-analysis ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 12px 11px 30px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.ai-candidates {
  display: grid;
  gap: 7px;
}

.ai-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  text-align: left;
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}

.ai-candidate:hover {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  color: var(--text);
}

.ai-candidate span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-candidate small {
  flex: 0 0 auto;
  color: var(--text-3);
}

.ai-message-user p {
  background: #525bd4;
  color: #ffffff;
}

.ai-message-typing:not([hidden]) {
  display: flex;
}

.ai-message-typing p {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-typing-label {
  color: var(--text-3);
  font-size: 12px;
}

.ai-message-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: aiAssistantPulse 1s ease-in-out infinite;
}

.ai-message-typing i:nth-child(2) { animation-delay: .12s; }
.ai-message-typing i:nth-child(3) { animation-delay: .24s; }

.ai-assistant-suggestions {
  display: flex;
  gap: 8px;
  padding: 0 18px 11px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 52%, var(--line-strong)) transparent;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.ai-assistant-suggestions.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.ai-assistant-suggestions::-webkit-scrollbar {
  height: 7px;
}

.ai-assistant-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.ai-assistant-suggestions::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 52%, var(--line-strong));
  background-clip: padding-box;
}

.ai-assistant-suggestions::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 72%, var(--line-strong));
  background-clip: padding-box;
}

.ai-suggestion {
  flex: 0 0 auto;
  max-width: 260px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}

.ai-suggestion:hover {
  border-color: var(--primary-line);
  color: var(--text);
  transform: translateY(-1px);
}

.ai-assistant-footer {
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.ai-assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.ai-assistant-form:focus-within {
  border-color: rgba(139, 145, 255, .72);
  box-shadow: 0 0 0 3px rgba(139, 145, 255, .1);
}

.ai-assistant-form textarea {
  min-height: 46px;
  max-height: 126px;
  padding: 9px 8px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
}

.ai-assistant-form textarea::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.ai-assistant-form button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #626be5;
  color: #ffffff;
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}

.ai-assistant-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #747cff;
}

.ai-assistant-form button svg {
  width: 19px;
  height: 19px;
}

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

@keyframes aiAssistantPulse {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 760px),
       (max-width: 900px) and (max-height: 540px) and (orientation: landscape) {
  .ai-assistant-trigger {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    min-width: 50px;
    width: 50px;
  }

  .ai-trigger-core {
    width: 46px;
    padding: 0;
  }

  .ai-trigger-core > span {
    display: none;
  }

  .ai-assistant-overlay {
    align-items: end;
  }

  .ai-assistant-panel {
    width: 100%;
    height: min(92dvh, 760px);
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 16px 16px 0 0;
    transform: translateY(24px);
  }

  .ai-assistant-overlay.active .ai-assistant-panel {
    transform: translateY(0);
  }

  .ai-assistant-head {
    min-height: 70px;
    padding: 13px 14px;
  }

  .ai-assistant-mark {
    width: 40px;
    height: 40px;
  }

  .ai-assistant-messages {
    padding: 17px 14px;
  }

  .ai-message {
    max-width: 94%;
  }

  .ai-assistant-suggestions {
    padding: 0 14px 10px;
    scrollbar-width: auto;
  }

  .ai-assistant-footer {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant-trigger::before,
  .ai-message-typing i {
    animation: none;
  }

  .ai-assistant-trigger,
  .ai-assistant-overlay,
  .ai-assistant-panel,
  .ai-suggestion,
  .ai-assistant-form button {
    transition: none;
  }

  .ai-assistant-messages {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .ai-assistant-trigger,
  .ai-assistant-close,
  .ai-suggestion,
  .ai-assistant-form,
  .ai-assistant-form button {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
    box-shadow: none;
  }

  .ai-assistant-trigger::before,
  .ai-assistant-trigger::after {
    display: none;
  }
}
