:root {
  --navy-950: #071528;
  --navy-900: #0c2038;
  --navy-800: #153452;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --slate-950: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #fff;
  --red-700: #b91c1c;
  --red-100: #fee2e2;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --amber-700: #a16207;
  --amber-100: #fef3c7;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--slate-800);
  background: #eef3f8;
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 236px;
  flex-direction: column;
  color: #dce8f4;
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.2), transparent 28%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  box-shadow: 12px 0 35px rgba(7, 21, 40, 0.16);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 9px 20px rgba(37,99,235,0.32);
  font-family: "Songti SC", SimSun, serif;
  font-size: 24px;
  font-weight: 700;
}
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 16px; letter-spacing: .04em; }
.brand small { margin-top: 4px; color: #91a9c2; font-size: 11px; letter-spacing: .1em; }
.side-nav { display: grid; gap: 8px; padding: 24px 14px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #b9cadd;
  text-decoration: none;
  transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59,130,246,.95), rgba(37,99,235,.78));
  border-color: rgba(147,197,253,.35);
  box-shadow: 0 10px 24px rgba(29,78,216,.24);
}
.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  font-size: 20px;
  line-height: 1;
}
.sidebar-user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.12);
}
.user-actions { display: flex; align-items: center; gap: 2px; }
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2d5d87;
  font-weight: 700;
}
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { color: #fff; font-size: 13px; }
.user-copy small { margin-top: 2px; color: #8ca4bb; font-size: 11px; }
.user-action-link, .logout-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 7px;
  color: #9fb4c8;
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
}
.user-action-link:hover, .logout-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.app-main { min-height: 100vh; margin-left: 236px; }
.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 32px 34px 48px; }
.mobile-header { display: none; }
.sidebar-scrim { display: none; }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-heading h1 { margin: 0; color: var(--slate-950); font-size: 27px; line-height: 1.25; }
.page-heading p { margin: 7px 0 0; color: var(--slate-500); line-height: 1.6; }
.heading-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--slate-500);
  font-size: 13px;
}
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); box-shadow: 0 8px 17px rgba(37,99,235,.22); }
.button-primary:hover { box-shadow: 0 11px 24px rgba(37,99,235,.3); }
.button-secondary { color: var(--slate-700); background: #fff; border-color: var(--slate-200); box-shadow: 0 2px 5px rgba(15,23,42,.04); }
.button-secondary:hover { border-color: #b8c5d4; background: var(--slate-50); }
.button-danger { color: var(--red-700); background: #fff; border-color: #fecaca; }
.button-danger:hover { background: #fff5f5; }
.button-small { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 13px; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }

.flash { margin: 0 0 18px; padding: 13px 16px; border: 1px solid; border-radius: 11px; line-height: 1.55; }
.flash-success { color: var(--green-700); background: var(--green-100); border-color: #bbf7d0; }
.flash-error { color: var(--red-700); background: #fff1f2; border-color: #fecdd3; }
.flash-warning { color: var(--amber-700); background: var(--amber-100); border-color: #fde68a; }
.flash-info { color: #1e40af; background: var(--blue-50); border-color: #bfdbfe; }

.panel { background: #fff; border: 1px solid var(--slate-200); border-radius: 16px; box-shadow: var(--shadow); }
.filter-panel { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 15px; }
.search-wrap { position: relative; flex: 1; }
.search-input {
  width: 100%;
  height: 43px;
  padding: 0 15px;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  outline: none;
}
.search-input:focus { background: #fff; border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.11); }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px; background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; box-shadow: 0 8px 22px rgba(15,23,42,.05); }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--slate-500); font-size: 13px; }
.stat-card strong { margin-top: 7px; color: var(--slate-950); font-size: 25px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.data-table th { color: var(--slate-500); background: var(--slate-50); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.data-table td { color: var(--slate-700); }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.order-number { color: var(--blue-700); font-weight: 700; text-decoration: none; }
.guest-cell strong, .guest-cell small { display: block; }
.guest-cell strong { color: var(--slate-900); }
.guest-cell small { margin-top: 4px; color: var(--slate-500); }
.money-value { color: var(--slate-950); font-weight: 650; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; color: var(--green-700); background: var(--green-100); border-radius: 99px; font-size: 12px; font-weight: 700; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; content: ""; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.link-action { padding: 5px 3px; color: var(--blue-700); background: none; border: 0; cursor: pointer; text-decoration: none; font-weight: 600; }
.link-action.danger { color: var(--red-700); }
.empty-state { padding: 68px 24px; text-align: center; }
.empty-state strong { display: block; color: var(--slate-900); font-size: 18px; }
.empty-state p { margin: 8px 0 20px; color: var(--slate-500); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-top: 1px solid var(--slate-200); color: var(--slate-500); font-size: 13px; }
.pagination-links { display: flex; gap: 7px; }
.pagination a, .pagination span.page-current { display: grid; min-width: 34px; height: 34px; place-items: center; border: 1px solid var(--slate-200); border-radius: 8px; color: var(--slate-700); background: #fff; text-decoration: none; }
.pagination span.page-current { color: #fff; background: var(--blue-600); border-color: var(--blue-600); }

.sheet-shell { padding: 22px; overflow-x: auto; }
.order-form-page .content { max-width: none; padding: 16px 24px 28px; }
.order-form-layout {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1086px) 144px;
  align-items: start;
  justify-content: center;
  gap: 24px;
}
.order-form-layout > form { min-width: 0; }
.order-form-sheet-shell { width: 100%; }
.order-action-dock {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}
.order-action-dock .button {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 14px;
}
.order-sheet { width: min(1040px, 100%); min-width: 960px; margin: 0 auto; padding: 24px; background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; }
.order-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--slate-300); border-radius: 10px; overflow: hidden; }
.order-table th, .order-table td { border-right: 1px solid var(--slate-300); border-bottom: 1px solid var(--slate-300); vertical-align: middle; }
.order-table th:last-child, .order-table td:last-child { border-right: 0; }
.order-table > tbody:last-of-type > tr:last-child > * { border-bottom: 0; }
.order-table th { color: var(--slate-600); background: var(--slate-50); font-weight: 650; text-align: center; }
.order-table .sheet-title { padding: 15px 11px 19px; background: #fff; }
.sheet-title input { min-height: auto !important; padding: 0 8px !important; color: var(--slate-950); font-family: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", SimSun, serif !important; font-size: clamp(29px, 3.2vw, 43px) !important; font-weight: 700 !important; line-height: 1.2 !important; letter-spacing: 2px; }
.order-table .label { width: 12.5%; min-width: 100px; padding: 10px 7px; font-size: 14px; white-space: nowrap; }
.order-table .section-title { height: 41px; color: var(--slate-800); background: #fff; font-size: 18px; }
.order-table .cell { position: relative; padding: 0; background: #fff; }
.order-table input, .order-table textarea, .order-table select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--slate-800);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  text-align: center;
  resize: none;
}
.order-table textarea { display: block; min-height: 52px; line-height: 1.5; overflow: hidden; text-align: left; }
.order-table input:focus, .order-table textarea:focus { position: relative; z-index: 1; background: var(--blue-50); box-shadow: inset 0 0 0 2px #3b82f6; }
.order-table input[readonly], .order-table textarea[readonly] { color: var(--slate-800); cursor: default; }
.order-table .left-input { text-align: left; }
.order-table .route-input { min-height: 59px; }
.order-table .plan-input { min-height: 40px; height: 40px; line-height: 1.4; overflow: hidden; }
.order-table .cell-wrap-input { min-height: 40px; height: 40px; line-height: 1.4; overflow: hidden; text-align: center; }
.order-table .id-info { min-height: 106px; padding-top: 9px; }
.order-table .remarks { min-height: 68px; text-align: center; }
.money-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; padding-left: 9px; }
.money-wrap input { padding-left: 5px; text-align: left; font-variant-numeric: tabular-nums; }
.remove-row { position: absolute; top: 50%; right: 6px; min-height: 27px; padding: 0 8px; transform: translateY(-50%); color: var(--red-700); background: #fff; border: 1px solid #fecaca; border-radius: 6px; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.itinerary-row:hover .remove-row, .remove-row:focus-visible { opacity: 1; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.form-note { color: var(--slate-500); font-size: 12px; line-height: 1.5; }
.form-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-save { display: none; }
.required-mark { color: var(--red-700); }
.readonly-banner { margin: 0 0 16px; padding: 11px 14px; color: #1e40af; background: var(--blue-50); border: 1px solid #bfdbfe; border-radius: 10px; }

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 10%, rgba(59,130,246,.28), transparent 26%),
    radial-gradient(circle at 85% 90%, rgba(14,165,233,.16), transparent 30%),
    linear-gradient(145deg, #071426, #102d49 60%, #0b2138);
}
.login-layout { display: grid; width: min(940px, 100%); grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: rgba(255,255,255,.97); box-shadow: 0 35px 80px rgba(0,0,0,.28); }
.login-layout.install-layout { grid-template-columns: .8fr 1.2fr; }
.login-intro { display: flex; min-height: 545px; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff; background: linear-gradient(155deg, rgba(21,52,82,.98), rgba(7,21,40,1)); }
.login-intro .brand-mark { width: 56px; height: 56px; font-size: 30px; }
.login-intro h1 { max-width: 420px; margin: 0; font-family: "Songti SC", SimSun, serif; font-size: 38px; line-height: 1.28; letter-spacing: .04em; }
.login-intro p { max-width: 390px; margin: 16px 0 0; color: #a8c0d8; line-height: 1.8; }
.login-footnote { color: #7894ae; font-size: 12px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; }
.login-panel h2 { margin: 0; color: var(--slate-950); font-size: 28px; }
.login-panel > p { margin: 9px 0 28px; color: var(--slate-500); line-height: 1.6; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--slate-700); font-size: 13px; font-weight: 650; }
.form-control { width: 100%; height: 46px; padding: 0 13px; color: var(--slate-900); background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px; outline: 0; }
.form-control:focus { background: #fff; border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.11); }
.settings-wrap { width: min(680px, 100%); margin: 0 auto; }
.settings-card { padding: 28px; }
.settings-card h2 { margin: 0 0 8px; color: var(--slate-950); font-size: 20px; }
.settings-card > p { margin: 0 0 24px; color: var(--slate-500); line-height: 1.65; }
.settings-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.password-hint { margin: -7px 0 18px; color: var(--slate-500); font-size: 12px; line-height: 1.6; }
.login-submit { width: 100%; min-height: 47px; margin-top: 5px; }
.login-help { margin-top: 19px; color: var(--slate-500); font-size: 12px; line-height: 1.6; text-align: center; }

@media (max-width: 1050px) {
  .sidebar { width: 218px; }
  .app-main { margin-left: 218px; }
  .content { padding: 26px 22px 42px; }
  .order-form-page .content { padding: 14px 14px 134px; }
  .order-form-layout { display: block; }
  .order-action-dock {
    position: fixed;
    inset: auto 16px 16px auto;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    width: min(300px, calc(100vw - 32px));
    gap: 8px;
    padding: 9px;
  }
  .order-action-dock .button { min-height: 40px; }
}
@media (max-width: 820px) {
  .sidebar { width: min(280px, 84vw); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-header { display: flex; height: 58px; align-items: center; gap: 14px; padding: 0 16px; color: #fff; background: var(--navy-900); }
  .menu-button { min-height: 36px; padding: 0 10px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 8px; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(7,21,40,.48); backdrop-filter: blur(2px); }
  .sidebar-scrim[hidden] { display: none; }
  .content { padding: 21px 15px 36px; }
  .order-form-page .content { padding: 12px 12px 134px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .stats-row { grid-template-columns: 1fr; }
  .sheet-shell { padding: 8px; overflow-x: auto; }
  .order-sheet { min-width: 960px; padding: 12px; }
  .remove-row { opacity: 1; }
  .mobile-save { display: inline-flex; }
  .login-layout { max-width: 480px; grid-template-columns: 1fr; }
  .login-layout.install-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 28px; }
  .login-intro h1 { margin-top: 48px; font-size: 28px; }
  .login-intro p { margin-bottom: 10px; }
  .login-footnote { display: none; }
  .login-panel { padding: 34px 28px; }
  .settings-card { padding: 22px 18px; }
  .settings-actions { align-items: stretch; flex-direction: column-reverse; }
  .settings-actions .button { width: 100%; }
}
@media (max-width: 560px) {
  .filter-panel { align-items: stretch; flex-direction: column; }
  .filter-panel .button { width: 100%; }
  .heading-actions .button { flex: 1; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 15px; border-bottom: 1px solid var(--slate-200); }
  .data-table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border: 0; white-space: normal; }
  .data-table td::before { color: var(--slate-500); content: attr(data-label); font-size: 12px; }
  .data-table td.actions-cell { justify-content: flex-end; padding-top: 12px; }
  .data-table td.actions-cell::before { display: none; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@page { size: A4 portrait; margin: 6mm; }
@media print {
  html, body { width: 198mm; background: #fff !important; }
  .sidebar, .mobile-header, .sidebar-scrim, .page-heading, .flash, .form-footer, .readonly-banner, .order-action-dock { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { max-width: none; padding: 0 !important; }
  .order-form-layout { display: block !important; }
  .panel, .sheet-shell { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .panel, .sheet-shell, .order-sheet { overflow: visible !important; }
  .order-sheet { width: calc(198mm / var(--print-scale, 1)); max-width: none; min-width: 0; padding: 0; border: 0; border-radius: 0; zoom: var(--print-scale, 1); }
  .remove-row { display: none !important; }
  .order-table { border-color: #000; border-radius: 0; }
  .order-table th, .order-table td { border-color: #000; }
  .order-table input, .order-table textarea { min-height: 25px; padding: 2px 5px; background: transparent !important; box-shadow: none !important; }
  .sheet-title input { font-size: 36px !important; }
  .order-table .label { padding: 3px 4px; font-size: 12px; }
  .order-table .section-title { height: 28px; font-size: 14px; }
  .order-table .route-input { min-height: 34px; }
  .order-table .id-info { min-height: 84px; }
  .order-table .remarks { min-height: 52px; }
  .itinerary-row { break-inside: avoid; page-break-inside: avoid; }
}
