/* 未至旅行内部平台 v1.0：视觉覆盖层，不改变业务结构与数据行为。 */
html {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

::selection { color: var(--ink); background: rgb(228 0 43 / 14%); }
* { scrollbar-color: rgb(17 17 19 / 22%) transparent; scrollbar-width: thin; }
button, input, select, textarea { font-family: inherit; }

button,
.button,
[role="button"] {
  min-height: 44px;
  border-radius: var(--radius-control);
  transition: color 140ms var(--ease-standard), background-color 140ms var(--ease-standard), border-color 140ms var(--ease-standard), box-shadow 140ms var(--ease-standard), transform 100ms ease;
}

button:active:not(:disabled),
.button:active:not(:disabled),
[role="button"]:active:not(:disabled) { transform: scale(.985); }

button:focus-visible,
.button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(228 0 43 / 18%);
  outline-offset: 2px;
}

/* Application frame */
.app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--canvas);
  transition: grid-template-columns 300ms var(--ease-standard);
}

.app-shell.is-sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

.sidebar {
  z-index: 60;
  width: 100%;
  height: 100dvh;
  color: var(--sidebar-text);
  background: var(--sidebar);
  border-right: 1px solid rgb(255 255 255 / 8%);
  box-shadow: none;
}

.brand-block {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 14px;
  justify-items: stretch;
  min-height: 64px;
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.brand-block .brand-mark { display: block; width: 6px; height: 32px; background: var(--accent); border-radius: 2px; }
.brand-block > div { display: grid; min-width: 0; align-content: center; }
.brand-block strong { color: var(--paper); font-size: 17px; font-weight: 720; letter-spacing: -.035em; white-space: nowrap; }
.brand-block div > span { display: block; margin-top: 0; color: #9ca8b6; font-size: 11px; white-space: nowrap; }
.primary-nav { gap: 24px; padding: 18px 12px 28px; }
.nav-group { gap: 4px; }
.nav-group-label { padding: 0 12px 5px; color: #8190a3; font-size: 11px; font-weight: 650; letter-spacing: 0; }

.nav-item {
  position: relative;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  overflow: hidden;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
}

.nav-item::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 2px;
  content: "";
  background: transparent;
  border-radius: 2px;
}

.nav-item:hover,
.nav-item.is-active { color: var(--paper); background: var(--sidebar-active); border-color: transparent; }
.nav-item.is-active::before { background: var(--accent); }
.nav-item span, .nav-item:hover span, .nav-item.is-active span { color: currentColor; }
.nav-item strong { color: inherit; font-size: 14px; font-weight: 520; }
.nav-icon, .nav-icon img { width: 20px; height: 20px; }
.nav-icon img { opacity: .78; filter: none; }
.nav-item:hover .nav-icon img, .nav-item.is-active .nav-icon img { opacity: 1; }

.sidebar-foot { padding: 16px 20px 20px; background: var(--sidebar); border-top: 1px solid rgb(255 255 255 / 10%); }
.sidebar-foot p { color: var(--sidebar-text); }
.demo-label { color: #d5dbe2; background: rgb(255 255 255 / 8%); border: 0; border-radius: 999px; }
.sidebar-foot .text-button { color: var(--paper); }
.app-shell.is-sidebar-collapsed .brand-block { grid-template-columns: 1fr; justify-items: center; min-height: 64px; }
.app-shell.is-sidebar-collapsed .brand-block .brand-mark { display: none; }
.app-shell.is-sidebar-collapsed .brand-compact { color: var(--accent); }
.app-shell.is-sidebar-collapsed .primary-nav { gap: 2px; padding: 12px 8px; }
.app-shell.is-sidebar-collapsed .nav-item { min-height: 44px; padding: 10px; }

.main-stage { min-width: 0; background: var(--canvas); }
.topbar {
  min-height: 64px;
  padding: 0 32px;
  gap: 20px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: saturate(130%) blur(14px);
}

.topbar-leading { gap: 14px; }
.sidebar-toggle { width: 44px; height: 44px; border-radius: var(--radius-control); }
.sidebar-toggle:hover { background: var(--surface-soft); }
.sidebar-toggle img { width: 20px; height: 20px; opacity: .76; filter: grayscale(1) contrast(1.2); }
.topbar-title { display: grid; gap: 1px; align-items: center; }
.topbar p { gap: 7px; color: var(--quiet); font-size: 10px; font-weight: 520; }
.topbar p span + span { padding-left: 7px; color: var(--quiet); border-color: var(--line); }
.topbar h1 { margin: 0; color: var(--ink); font-size: 24px; font-weight: 720; letter-spacing: -.035em; line-height: 1.2; }

.global-search-shell { position: relative; width: min(420px, 34vw); }
.global-search-shell > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.global-search-shell input { min-height: 40px; margin: 0; padding: 8px 14px; background: var(--surface-soft); border: 1px solid transparent; border-radius: var(--radius-control); }
.global-search-results { top: calc(100% + 8px); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-control); box-shadow: var(--shadow-floating); }
.shift-state { display: flex; gap: 16px; align-items: center; min-width: 0; padding: 0; color: var(--muted); text-align: right; border: 0; }
.shift-state > div { min-width: 0; }
.shift-state span, .shift-state small { color: var(--quiet); font-size: 10px; }
.shift-state strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.permission-preview { padding-right: 16px; border-right: 1px solid var(--line); }
.permission-preview > em { color: var(--muted); }

.page-dsh-action { min-height: 40px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-control); }
.page-dsh-action:hover, .page-dsh-action:focus-visible { color: var(--ink); background: var(--surface-soft); border-color: var(--ink); }
.view-root { width: 100%; max-width: 1504px; margin: 0 auto; padding: 32px 32px 64px; }
.view-root > * { animation: none; }

/* Type and structure */
.section-heading h2,
.resource-section-heading h2,
.dashboard-panel > header h2,
.order-record-head h2,
.profit-ledger header h2,
.assistant-context-panel h2 { color: var(--ink); font-weight: 650; letter-spacing: -.025em; }
.section-heading h2, .resource-section-heading h2 { font-size: 24px; }
.section-heading > div > span, .quote-summary > span, .profit-ledger header > span, .resource-section-heading > span, .integration-identity span, .assistant-context-panel header span { color: var(--quiet); }
.section-intro, .overview-owner-banner, .dashboard-scope-bar, .rule-note, .system-note { color: var(--muted); background: transparent; border: 0; border-left: 2px solid var(--accent); border-radius: 0; box-shadow: none; }
.section-intro { max-width: 920px; margin-bottom: 24px; padding: 3px 0 3px 16px; }

/* Controls */
label, fieldset { gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, select, textarea {
  min-height: 44px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  box-shadow: none;
  transition: background-color 160ms var(--ease-standard), border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { color: var(--ink); background: var(--paper); border-color: var(--ink); box-shadow: 0 0 0 3px rgb(228 0 43 / 10%); outline: none; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; accent-color: var(--accent); }

.primary-button { min-height: 44px; padding: 10px 18px; color: var(--paper); font-size: 14px; font-weight: 650; background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius-control); box-shadow: none; }
.primary-button:hover { color: var(--paper); background: #29292d; border-color: #29292d; }
.secondary-button, .compact-button { min-height: 44px; padding: 10px 16px; color: var(--ink); font-size: 14px; font-weight: 600; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-control); }
.secondary-button:hover, .compact-button:hover { color: var(--ink); background: var(--surface-soft); border-color: var(--ink); }
.text-button, .record-number-button { color: var(--ink); text-decoration: none; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; }
.text-button:hover, .record-number-button:hover { color: var(--accent); background: transparent; border-bottom-color: var(--accent); }
.danger-text-button { color: var(--danger); background: transparent; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; }

.segmented, .mode-switch, .binary-choice { gap: 4px; padding: 4px; overflow: visible; background: var(--surface-soft); border: 0; border-radius: 16px; }
.segmented button, .mode-switch button, .binary-choice button { min-height: 36px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; }
.segmented button:last-child, .mode-switch button + button, .binary-choice button + button { border: 0; }
.segmented button.is-selected, .mode-switch button.is-selected, .binary-choice button.is-selected { color: var(--ink); background: var(--paper); border-color: transparent; box-shadow: 0 2px 8px rgb(38 42 52 / 8%); }

/* Panels */
.dashboard-panel, .dashboard-metric, .lead-cost-panel, .editor-grid, .quote-workspace, .resource-workspace, .order-record, .profit-ledger, .system-table, .data-table, .ticket-list, .group-table, .itinerary-list, .admin-library-card, .integration-card, .ai-config-panel, .assistant-layout, .collaboration-console, .finance-document-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: none;
}
.dashboard-panel, .editor-grid, .resource-workspace, .order-record, .profit-ledger, .system-table, .data-table, .ticket-list, .group-table, .itinerary-list, .assistant-layout, .collaboration-console { overflow: hidden; }
.dashboard-panel > header, .custom-route-library > header, .admin-library-toolbar, .resource-section-heading, .order-record-head, .profit-ledger header { min-height: 72px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dashboard-scope-bar { padding: 4px 0 4px 18px; border-top: 0; }
.dashboard-metrics { gap: 12px; margin: 24px 0; }
.dashboard-metric, .dashboard-metrics-eight .dashboard-metric { min-height: 120px; padding: 20px 22px; color: var(--ink); border-radius: var(--radius-panel); box-shadow: none; }
.dashboard-metric::before { inset: 20px auto 20px 0; width: 2px; background: var(--line-strong); }
.dashboard-metric:first-child::before { background: var(--accent); }
.dashboard-metric:hover, .dashboard-metric:focus-visible { border-color: var(--line-strong); box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.dashboard-metric.is-red, .dashboard-metric.is-blue, .dashboard-metric.is-orange, .dashboard-metric.is-purple, .dashboard-metric.is-green, .dashboard-metric > strong, .dashboard-metric > em { color: var(--ink); }
.dashboard-metric > strong, .axis-item > strong, .profit-strip strong, .quote-summary h2, .order-record-head strong, .ledger-total strong, .system-metric strong { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; }
.dashboard-metric > strong { font-size: clamp(28px, 3vw, 38px); font-weight: 650; }
.dashboard-main-grid { gap: 24px; }
.dashboard-quick-grid { gap: 1px; padding: 0; background: var(--line); }
.dashboard-quick-grid button { min-height: 84px; padding: 16px 18px; background: var(--paper); border: 0; border-radius: 0; }
.dashboard-quick-grid button:hover { background: var(--surface-soft); }

.number-axis, .profit-strip, .group-summary-axis, .group-cost-strip, .order-meta-grid, .order-status-grid, .order-detail-strip, .linked-quote-lines, .price-table { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: none; }
.axis-item, .profit-strip div, .number-axis > div { background: var(--paper); border-color: var(--line); }
.axis-item > strong, .number-axis strong, .quote-summary h2, .order-record-head h2, .order-record-head strong, .profit-ledger header strong { color: var(--ink); }
.profit-strip .profit-emphasis { color: var(--ink); background: var(--surface-soft); border-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.profit-strip .profit-emphasis span { color: var(--muted); }

.order-flow li.is-current {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: inset 0 2px 0 var(--accent);
}

.resource-tab-nav button.is-active,
.mobile-task-nav strong {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: inset 2px 0 0 var(--accent);
}

.attraction-option.has-issue,
.ai-result.has-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgb(201 29 54 / 18%);
}

.ai-result.is-reasonable {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgb(35 122 75 / 18%);
}

.ai-result.has-error p,
.ai-result.is-reasonable p { color: inherit; }

/* Tables */
.data-table, .system-table, .group-table, .ticket-list, .dashboard-order-table, .profit-ledger { overflow-x: auto; scrollbar-gutter: stable; }
.table-row, .system-table-row, .group-table-row, .ticket-row, .dashboard-order-row, .ledger-row, .payable-row { min-height: 52px; color: var(--ink); background: var(--paper); border-bottom: 1px solid var(--line); }
.table-row:last-child, .system-table-row:last-child, .group-table-row:last-child, .ticket-row:last-child, .dashboard-order-row:last-child, .ledger-row:last-child, .payable-row:last-child { border-bottom: 0; }
.table-row:not(.table-head):hover, .system-table-row:not(.system-table-head):hover, .group-table-row:not(.group-table-head):hover, .ticket-row:not(.ticket-row-head):hover, .dashboard-order-row:not(.dashboard-order-head):hover, .ledger-row:not(.ledger-head):hover { background: var(--canvas); }
.table-row > *, .system-table-row > *, .group-table-row > *, .ticket-row > *, .ledger-row > *, .prospect-row > *, .order-search-row > *, .group-resource-grid > div > *, .price-table > div, .linked-quote-lines > * { border-right: 0 !important; border-bottom: 0 !important; }
.table-head, .system-table-head, .group-table-head, .ticket-row-head, .dashboard-order-head, .ledger-head { min-height: 48px; color: var(--quiet); font-size: 12px; font-weight: 650; background: var(--surface-soft); }
.table-row.is-current, .system-table-row.is-current, .group-table-row.is-current, .ticket-row.is-current, .order-search-row.is-current, .custom-route-library-list article.is-current { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.table-actions, .employee-action, .action-row { gap: 8px; }
.table-actions button, .employee-action button, .action-row .compact-button { min-height: 40px; }

/* Status */
.status-tag, .collaboration-state { min-height: 26px; padding: 3px 9px; color: var(--muted); font-size: 11px; font-weight: 560; letter-spacing: 0; background: var(--surface-soft); border: 1px solid transparent; border-radius: 999px; }
.status-tag.is-success { color: var(--success); background: var(--success-soft); border-color: rgb(35 122 75 / 18%); }
.status-tag.is-warning { color: var(--warning); background: var(--warning-soft); border-color: rgb(154 99 0 / 18%); }
.status-tag.is-danger { color: var(--danger); background: var(--danger-soft); border-color: rgb(201 29 54 / 18%); }
.status-tag.is-info { color: var(--info); background: var(--info-soft); border-color: rgb(49 90 138 / 18%); }
.system-alert { color: var(--danger); background: var(--danger-soft); border: 1px solid rgb(201 29 54 / 16%); border-left: 2px solid var(--danger); border-radius: var(--radius-control); }
.empty-state, .inline-empty, .assistant-empty, .admin-library-empty { min-height: 180px; color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); border-radius: var(--radius-panel); }

/* Dialogs and notifications */
dialog { width: min(520px, calc(100vw - 32px)); max-height: min(860px, calc(100dvh - 32px)); padding: 24px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-dialog); box-shadow: var(--shadow-floating); }
dialog::backdrop { background: rgb(17 17 19 / 42%); backdrop-filter: blur(4px); }
dialog[open] { animation: dialog-enter 280ms var(--ease-enter) both; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialog-head { min-height: auto; margin-bottom: 24px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { color: var(--ink); font-size: 20px; font-weight: 650; }
.catalog-dialog { width: min(920px, calc(100vw - 32px)); }
.toast-region { right: 24px; bottom: 24px; gap: 10px; }
.toast { padding: 13px 16px; color: var(--paper); background: var(--ink); border: 0; border-left: 2px solid var(--success); border-radius: var(--radius-control); box-shadow: var(--shadow-floating); }
.toast.is-error { border-left-color: var(--danger); }

/* AI workspace follows the platform language. */
.assistant-status-strip, .assistant-mode-tabs { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-top: 0; border-radius: var(--radius-panel); }
.assistant-mode-tabs button.is-active { color: var(--ink); background: var(--surface-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.assistant-mode-tabs button.is-active small { color: var(--muted); }
.collaboration-console { --console-surface: var(--paper); --console-panel: var(--canvas); --console-line: var(--line); --console-text: var(--ink); --console-muted: var(--quiet); --console-signal: var(--accent); min-height: 680px; color: var(--ink); font-family: var(--font); }
.collaboration-console *, .collaboration-console button, .collaboration-console input, .collaboration-console select, .collaboration-console textarea { font-family: inherit; }
.collaboration-task-panel, .collaboration-inbox, .collaboration-message.is-dsh, .collaboration-composer, .assistant-mode-field > header { background: var(--canvas); }
.collaboration-thread, .collaboration-message, .collaboration-composer input, .collaboration-composer select, .collaboration-composer textarea { color: var(--ink); background: var(--paper); }
.collaboration-composer { border: 1px solid var(--line-strong); border-radius: var(--radius-control); }
.collaboration-composer-heading { background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.collaboration-composer-heading em, .collaboration-composer button[type="submit"], .collaboration-task-panel > header button.is-active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.collaboration-console button { min-height: 40px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; }
.collaboration-console button:hover, .collaboration-console button:focus-visible { color: var(--ink); background: var(--surface-soft); border-color: var(--ink); }
.collaboration-task.is-active { background: var(--accent-soft); border-left-color: var(--accent) !important; }
.collaboration-message > div, .collaboration-inbox-message p, .collaboration-console header strong { color: var(--ink); }
.assistant-mode-field > header strong, .collaboration-message header em, .collaboration-inbox-message header strong, .collaboration-composer-heading span, .collaboration-message-input > span { color: var(--accent); }
.finance-document-grid { gap: 16px; background: transparent; border: 0; }
.finance-document-card { padding: 16px; }

@media (max-width: 1279px) {
  .app-shell:not(.is-sidebar-collapsed) { grid-template-columns: 208px minmax(0, 1fr); }
  .topbar, .view-root { padding-left: 24px; padding-right: 24px; }
  .global-search-shell { width: min(340px, 31vw); }
  .shift-state > div:last-child { display: none; }
}

@media (max-width: 767px) {
  .app-shell, .app-shell.is-sidebar-collapsed, .app-shell:not(.is-sidebar-collapsed) { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); height: 100dvh; transform: translateX(0); transition: transform 300ms var(--ease-standard), box-shadow 300ms var(--ease-standard); box-shadow: var(--shadow-floating); }
  .app-shell.is-sidebar-collapsed .sidebar { transform: translateX(-102%); box-shadow: none; }
  .app-shell.is-sidebar-collapsed .brand-block { display: grid; grid-template-columns: 6px minmax(0, 1fr); place-items: initial; padding: 12px 20px; }
  .app-shell.is-sidebar-collapsed .brand-block > div, .app-shell.is-sidebar-collapsed .nav-group-label, .app-shell.is-sidebar-collapsed .nav-item strong, .app-shell.is-sidebar-collapsed .sidebar-foot { display: block; }
  .app-shell.is-sidebar-collapsed .brand-compact { display: none; }
  .app-shell.is-sidebar-collapsed .primary-nav, .primary-nav { display: flex; gap: 24px; padding: 18px 12px 28px; }
  .app-shell.is-sidebar-collapsed .nav-group, .nav-group { display: grid; }
  .app-shell.is-sidebar-collapsed .nav-item, .nav-item { grid-template-columns: 24px minmax(0, 1fr); justify-items: initial; min-height: 44px; padding: 10px 12px; border: 0; }
  .topbar { position: sticky; min-height: 64px; padding: 8px 16px; flex-wrap: wrap; }
  .topbar-leading { flex: 1 1 auto; }
  .topbar h1 { font-size: 20px; }
  .global-search-shell { order: 3; width: 100%; }
  .shift-state, .page-dsh-action { display: none; }
  .view-root { padding: 24px 16px 48px; }
  .section-heading h2, .resource-section-heading h2 { font-size: 20px; }
  .field-pair, .dashboard-main-grid, .editor-grid, .split-grid, .permission-matrix, .integration-card { grid-template-columns: 1fr; }
  .dashboard-metrics, .dashboard-metrics.dashboard-metrics-eight { grid-template-columns: 1fr; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 20px; border-radius: 20px; }
  .toast-region { right: 16px; bottom: 16px; width: calc(100vw - 32px); }
}

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