:root {
  --blue: #1c65de;
  --blue-soft: #edf4ff;
  --navy: #153f6f;
  --ink: #172d43;
  --muted: #687887;
  --line: #e8edf2;
  --surface: #ffffff;
  --background: #f5f7fa;
  --orange: #f2673b;
  --green: #138568;
  --red: #c34444;

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: var(--ink);
  background: var(--background);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 11px 18px;
  font-weight: 550;
  background: var(--blue);
  color: white;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.secondary {
  background: var(--blue-soft);
  color: var(--blue);
}
button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
button.danger {
  background: #fff0f0;
  color: var(--red);
}
button.small {
  padding: 7px 11px;
  font-size: 12px;
}
a {
  color: var(--blue);
  text-decoration: none;
}
.layout {
  display: grid;
  grid-template-columns: 226px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--navy);
  color: #dce8f8;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 23px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 0 13px 6px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: #a8c4e7;
  font-weight: 500;
  margin: 10px 0 40px;
}
.nav {
  display: block;
  width: 100%;
  background: none;
  color: #c0d2e9;
  text-align: left;
  font-weight: 450;
  margin-bottom: 9px;
  padding: 14px 16px;
}
.nav.active {
  background: #28578e;
  color: white;
}
.sidebar-footer {
  margin-top: auto;
  color: #a8c4e7;
  font-size: 12px;
  padding: 14px;
}
.main {
  padding: 36px 42px;
  max-width: 1700px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 9px 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
  margin: 0 0 10px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 24px;
  margin: 20px 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 23px;
}
.metric .number {
  font-size: 33px;
  margin-top: 15px;
  font-weight: 650;
}
.metric .label {
  color: var(--muted);
  font-size: 12px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
th {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  background: #f5f8fd;
}
td,
th {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
}
td.wrap {
  white-space: normal;
  min-width: 210px;
  max-width: 370px;
}
td strong {
  font-weight: 550;
}
tr:last-child td {
  border-bottom: 0;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #eaf6f1;
  color: var(--green);
}
.tag.warn {
  background: #fff0e9;
  color: #b54a20;
}
.tag.bad {
  background: #fff0f0;
  color: var(--red);
}
.tag.gray {
  background: #f0f2f5;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 7px;
}
.notice {
  background: var(--blue-soft);
  color: #315c87;
  padding: 15px 18px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.8;
  margin: 18px 0;
}
.notice.warn {
  background: #fff4ec;
  color: #9b4f24;
}
.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  align-items: center;
}
.toolbar input {
  max-width: 370px;
}
input,
select,
textarea {
  padding: 11px 13px;
  border: 1px solid #dce4eb;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  width: 100%;
  outline: none;
}
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
input[type='checkbox'] {
  width: auto;
  accent-color: var(--blue);
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.7;
}
label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin: 16px 0 7px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.trip-schedule,
.form-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.trip-schedule h3,
.form-section h3 {
  margin: 0;
  font-size: 14px;
}
.trip-schedule > h3,
.form-section > h3 {
  font-size: 16px;
}
.trip-schedule p {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.7;
}
.trip-schedule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
}
.trip-schedule .field-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
}
.trip-schedule input {
  min-width: 0;
}
.trip-schedule input[type='search'] {
  margin-bottom: 8px;
}
.trip-time-preview {
  margin-bottom: 0;
  padding: 12px 14px;
}
.trip-time-line:not(:first-child) {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .trip-schedule-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}
.checklist {
  max-height: 190px;
  overflow: auto;
  background: #f5f8fd;
  border-radius: 8px;
  padding: 6px 14px;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.money {
  color: var(--orange);
  font-size: 18px;
  font-weight: 600;
}
.old {
  text-decoration: line-through;
  color: var(--muted);
  margin-left: 8px;
  font-size: 12px;
}
.login {
  max-width: 410px;
  margin: 13vh auto;
}
.login h1 {
  font-size: 28px;
}
.login button {
  width: 100%;
  margin-top: 22px;
}
.error {
  color: var(--red);
  background: #fff0e9;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
}
.loading {
  padding: 120px;
  text-align: center;
  color: var(--muted);
}
dialog {
  width: min(740px, 94vw);
  border: 0;
  border-radius: 17px;
  padding: 30px;
  color: var(--ink);
  box-shadow: 0 25px 120px #0c254e26;
  max-height: 90vh;
}
dialog::backdrop {
  background: #0c254e78;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 25px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  word-break: break-all;
}
.detail-row span:first-child {
  color: var(--muted);
}
.code {
  font-family: monospace;
  font-size: 15px;
}
.marketing-preview {
  background: var(--navy);
  color: white;
  padding: 24px;
  border-radius: 15px;
  max-width: 360px;
  line-height: 1.7;
}
.marketing-preview .money {
  color: #ffd2a5;
  font-size: 35px;
}
.marketing-preview .muted {
  color: #c0d2e9;
}
.marketing-preview h2 {
  margin: 10px 0;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  border-radius: 10px;
  padding: 14px 24px;
  display: none;
  z-index: 999;
  max-width: 90vw;
}
.import-row {
  max-height: 360px;
  overflow: auto;
}
.thin {
  font-weight: 400;
}
/* API_V4 §1.2 商品表单内的派生价预览表 */
.price-preview {
  margin: 18px 0 4px;
}
.price-preview table {
  font-size: 12px;
}
.price-preview td,
.price-preview th {
  padding: 9px 10px;
}
.price-preview p {
  margin: 10px 0 0;
}
/* 工具行/卡片行内联 label（全局汇率、订阅航次筛选） */
.rate-label {
  display: inline;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
#usd-rate {
  max-width: 140px;
}
#wait-voyage {
  width: auto;
  min-width: 250px;
  max-width: 320px;
}
.search-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 28px;
}
.info-link {
  cursor: pointer;
}
.split-list {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.split-list:last-child {
  border: 0;
}
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 180px 1fr;
  }
  .main {
    padding: 25px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }
  .brand small,
  .sidebar-footer {
    display: none;
  }
  .nav {
    display: inline-block;
    width: auto;
    margin: 8px 2px 0;
    padding: 10px;
  }
  .main {
    padding: 20px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .topbar {
    align-items: flex-start;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 18px;
  }
  .card {
    padding: 17px;
  }
}

/* Compact navigation and contained work areas on every screen. */
.sidebar {
  padding: 28px 16px 18px;
  overflow: hidden;
}
.sidebar nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #6c91bf transparent;
}
.brand {
  font-size: 21px;
  flex-shrink: 0;
}
.brand small {
  margin-bottom: 28px;
}
.nav {
  margin-bottom: 4px;
  padding: 11px 14px;
  border-radius: 8px;
}
.nav.active {
  background: #28578e;
  box-shadow: inset 3px 0 #9fc3ff;
}
.sidebar-footer {
  flex-shrink: 0;
  line-height: 1.7;
}
.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card {
  min-width: 0;
}
.toolbar {
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1 1 180px;
}
.toolbar button,
.topbar button {
  flex-shrink: 0;
}
.metric .label,
.muted {
  color: var(--muted);
}
.tag.gray {
  color: var(--muted);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
tbody tr:hover {
  background: #f5f8fd;
}
.price-preview table {
  min-width: 540px;
}
.login {
  width: min(410px, calc(100% - 32px));
}
@media (max-width: 1000px) {
  .grid2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .sidebar {
    padding: 18px 16px 8px;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    margin-top: 12px;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }
  .nav {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
    padding: 10px 12px;
  }
  .nav.active {
    box-shadow: inset 0 -2px #9fc3ff;
  }
  .main {
    padding: 22px 16px;
  }
  h1 {
    font-size: 25px;
  }
  .topbar {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input {
    max-width: none;
  }
  #wait-voyage {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
  dialog {
    padding: 20px;
  }
  .split-list {
    gap: 12px;
    align-items: center;
  }
  .split-list button {
    flex-shrink: 0;
  }
}

/* Motion communicates navigation and input, without delaying operations. */
@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
#content {
  animation: content-enter 180ms ease-out both;
}
dialog[open] {
  animation: dialog-enter 180ms ease-out both;
}
button,
a,
input,
select,
textarea {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}
button:not(:disabled):active {
  transform: scale(0.98);
}
@media (hover: hover) {
  button:not(:disabled):hover {
    box-shadow: 0 3px 10px #153f6f1a;
  }
  button:not(.nav):not(:disabled):not(:active):hover {
    transform: translateY(-1px);
  }
  button.ghost:not(:disabled):hover,
  button.secondary:not(:disabled):hover {
    background: #e3edfc;
  }
  .nav:not(.active):hover {
    background: #ffffff12;
    color: #fff;
  }
  a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
button[aria-busy='true'] {
  cursor: progress;
}
.loading::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: loading-spin 800ms linear infinite;
}
#toast {
  box-shadow: 0 8px 30px #153f6f26;
  animation: toast-enter 150ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  #content,
  dialog[open],
  .loading::before,
  #toast {
    animation: none;
  }
  button,
  a,
  input,
  select,
  textarea {
    transition: none;
  }
  button:not(:disabled):hover,
  button:not(:disabled):active {
    transform: none;
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.task-board h2,
.task-row h3 {
  margin: 0;
}
.task-board > .row {
  margin-bottom: 20px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid #e5ecf3;
}
.task-row .grow {
  flex: 1;
  min-width: 0;
}
.task-row h3 {
  font-size: 16px;
  line-height: 1.5;
}
.task-row p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.6;
}
.task-target {
  font-size: 13px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.task-count {
  background: #edf4ff;
  color: #2563eb;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.aftercare-records table {
  table-layout: fixed;
  white-space: normal;
}
.aftercare-records th,
.aftercare-records td {
  overflow-wrap: anywhere;
}
.aftercare-records button {
  white-space: nowrap;
}
.aftercare-records th:first-child {
  width: 27%;
}
.aftercare-records th:last-child {
  width: 19%;
}
.task-shortcuts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  button {
    min-width: 44px;
    min-height: 44px;
  }
  .task-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .task-row button {
    align-self: flex-end;
    min-height: 44px;
    padding: 10px 16px;
  }
}
