/* schedule page styles — scoped to avoid breaking site header.js */
:root {
  --ink: #18212b;
  --muted: #667789;
  --faint: #93a2ad;
  --bg: #f5f8fa;
  --surface: #fff;
  --surface-soft: #fbfcfd;
  --line: #e3ebf0;
  --line-strong: #cfdae2;
  --topbar: #20252b;
  --green: #64c800;
  --green-hover: #58b800;
  --green-soft: #ecfadf;
  --green-ink: #173400;
  --cyan: #14818c;
  --red: #ba2d35;
  --red-soft: #fae5e6;
  --amber: #b87517;
  --amber-soft: #fff1d9;
  --blue: #386fa4;
  --blue-hover: #2f608f;
  --blue-soft: #e5f0fb;
  --blue-ink: #12395f;
  --shadow: 0 14px 30px rgba(24, 33, 43, 0.08);
  --radius: 8px;
  --header-height: 46px;
  --sticky-offset: 46px;
  --detail-drawer-width: min(560px, 42vw);
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

/*
 * 站点顶栏固定；查询模块随页面滚动。
 * 移动端侧栏 .iphone_nav 默认进文档流，靠 style.css + PC-web / 此处隐藏。
 */
body.PC-web {
  padding-top: var(--header-height);
}

body.PC-web > .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

.header .iphone_nav {
  display: none !important;
}

body.Wap-web > .header,
body.Wap-web .header {
  display: none !important;
}

body.Wap-web {
  padding-top: 0;
}

body.Wap-web.schedule-detail-open {
  overflow: hidden;
}

body.PC-web.schedule-detail-open {
  overflow: hidden;
}

/* 移动端：顶部菜单整栏隐藏（含 header.js 注入后的节点） */
@media (max-width: 768px) {
  body > .header,
  body .header {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.PC-web,
  body.Wap-web {
    padding-top: 0 !important;
  }

  .schedule-page {
    min-height: 0;
  }
}

.schedule-page,
.schedule-page * {
  box-sizing: border-box;
}

.schedule-page {
  width: 100%;
  max-width: none;
  min-height: 0;
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

.schedule-page button,
.schedule-page input {
  font: inherit;
}

.schedule-page button {
  cursor: pointer;
}

.schedule-page svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schedule-page h1,
.schedule-page h2,
.schedule-page h3,
.schedule-page p {
  margin: 0;
}

.schedule-page .login-prompt {
  color: var(--muted);
}

.schedule-page .schedule-login-link {
  color: #1e8ae5;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.schedule-page .schedule-login-link:hover {
  text-decoration: underline;
}

.schedule-page .page-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 24px 28px;
}

.top-actions,
.result-tools,
.detail-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.primary-button,
.secondary-button,
.text-button,
.search-button,
.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 6px;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.icon-button {
  position: relative;
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e9;
}

.icon-button:hover,
.secondary-button:hover {
  background: #f3f7f9;
}

.detail-close-button:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: #efc6c9;
}

.primary-button,
.search-button {
  min-width: 120px;
  padding: 0 16px;
  color: #18212b;
  background: var(--green);
  border: 1px solid var(--green);
  font-weight: 800;
}

.primary-button:hover,
.search-button:hover {
  color: #18212b;
  background: var(--green-hover);
  border-color: var(--green-hover);
}

.secondary-button {
  min-width: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e9;
  font-weight: 800;
}

.followed-only-button.active {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
}

.follow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 68px;
  padding: 0 10px;
  color: var(--green-ink);
  background: #fff;
  border: 1px solid #b7ed8c;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.follow-button:hover {
  background: var(--green-soft);
}

.follow-button.active {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
}

.detail-follow-button {
  min-height: 34px;
  min-width: 86px;
  padding: 0 14px;
}

.text-button {
  min-height: 28px;
  padding: 0;
  color: var(--green-ink);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.query-band {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.product-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.product-title-row h1 {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
}

.product-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lang-switch button {
  min-width: 58px;
  min-height: 30px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.lang-switch button.active {
  color: var(--green-ink);
  background: var(--green-soft);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 380px);
  padding: 3px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-tab {
  width: 100%;
  min-height: 32px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.mode-tab.active {
  color: var(--green-ink);
  background: var(--green-soft);
}

.query-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.25fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 0;
}

.query-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.query-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.query-grid input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e9;
  border-radius: 6px;
  outline: 0;
}

.laycan-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.laycan-range input[type="date"] {
  min-width: 0;
  padding-right: 6px;
}

.laycan-sep {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.query-grid input:focus {
  border-color: #b7ed8c;
  box-shadow: 0 0 0 3px rgba(100, 200, 0, 0.14);
}

.port-field {
  position: relative;
  min-width: 0;
}

.port-field input {
  padding-right: 32px;
}

.field-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.field-clear:hover {
  color: var(--ink);
  background: #eef3f6;
}

.field-clear[hidden] {
  display: none !important;
}

.query-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.query-reset-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.port-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #d9e3e9;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(13, 29, 45, 0.16);
}

.port-suggestions.open {
  display: grid;
  gap: 4px;
}

.port-option {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.port-option:hover,
.port-option.active {
  background: var(--green-soft);
}

.port-option-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-option-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-button {
  color: #18212b;
  height: 38px;
}

.schedule-page .search-button,
.schedule-page .search-button span {
  color: #18212b;
}

.schedule-page .query-reset-button,
.schedule-page .query-reset-button span {
  color: var(--green-ink);
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 20px;
  align-items: start;
  margin-top: 16px;
  width: 100%;
}

.workspace.detail-open {
  padding-right: 0;
}

.result-pane {
  grid-column: 1;
}

.detail-pane {
  display: none;
}

.workspace.detail-open .detail-pane {
  display: block;
}

.filter-pane,
.result-pane,
.detail-pane {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-pane {
  display: none;
}

.pane-title,
.result-header,
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-top > div:first-child {
  min-width: 0;
}

.pane-title h2,
.detail-top h2 {
  font-size: 18px;
  line-height: 1.3;
}

.filter-group {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.filter-group h3 {
  color: var(--ink);
  font-size: 13px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: #334252;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.result-pane {
  height: auto;
  overflow: visible;
}

.result-header {
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.result-header h1,
.result-header h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}

.result-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: visible;
  width: 100%;
}

.schedule-page .result-pane table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

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

.pagination-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pagination-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.page-size-control select {
  height: 30px;
  padding: 0 26px 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e9;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e9;
  border-radius: 6px;
  font-weight: 800;
}

.pagination-button:hover:not(:disabled),
.pagination-button.active {
  color: var(--green-ink);
  background: var(--green-soft);
  border-color: #b7ed8c;
}

.pagination-button:disabled {
  color: var(--faint);
  cursor: not-allowed;
  background: #f6f9fa;
}

.schedule-page .result-pane th:nth-child(1),
.schedule-page .result-pane td:nth-child(1) {
  width: 11%;
  padding-left: 12px;
  padding-right: 6px;
}

.schedule-page .result-pane th:nth-child(2),
.schedule-page .result-pane td:nth-child(2) {
  width: 34%;
  padding-left: 6px;
  padding-right: 6px;
  overflow: visible;
}

.schedule-page .result-pane th:nth-child(3),
.schedule-page .result-pane td:nth-child(3) {
  width: 8%;
  padding-left: 4px;
  padding-right: 4px;
}

.schedule-page .result-pane th:nth-child(4),
.schedule-page .result-pane td:nth-child(4) {
  width: 8%;
  padding-left: 4px;
  padding-right: 4px;
}

.schedule-page .result-pane th:nth-child(5),
.schedule-page .result-pane td:nth-child(5) {
  width: 8%;
  padding-left: 4px;
  padding-right: 4px;
}

.schedule-page .result-pane th:nth-child(6),
.schedule-page .result-pane td:nth-child(6) {
  width: 9%;
  padding-left: 4px;
  padding-right: 2px;
}

.schedule-page .result-pane th:nth-child(7),
.schedule-page .result-pane td:nth-child(7) {
  width: 10%;
  padding-left: 2px;
  padding-right: 4px;
  white-space: nowrap;
}

.schedule-page .result-pane th:nth-child(8),
.schedule-page .result-pane td:nth-child(8) {
  width: 5%;
  padding-left: 2px;
  padding-right: 4px;
  white-space: nowrap;
}

.schedule-page .result-pane th:nth-child(9),
.schedule-page .result-pane td:nth-child(9) {
  width: 5%;
  padding-left: 2px;
  padding-right: 8px;
  text-align: center;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th::after {
  content: " ↕";
  color: var(--faint);
  font-size: 11px;
}

.sortable-th[aria-sort="ascending"]::after {
  content: " ↑";
  color: var(--ink);
}

.sortable-th[aria-sort="descending"]::after {
  content: " ↓";
  color: var(--ink);
}

.distance-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.distance-port {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.distance-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.schedule-page .result-pane th,
.schedule-page .result-pane td {
  min-width: 0;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
}

.schedule-page .result-pane th {
  color: var(--muted);
  background: #f4f8fa;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.schedule-page .result-pane tbody tr {
  cursor: pointer;
}

.schedule-page .result-pane tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-page .result-pane tbody tr:hover,
.schedule-page .result-pane tbody tr.selected {
  background: #f4f8fe;
}

.empty-row td {
  height: auto !important;
  min-height: 0 !important;
  padding: 14px 12px !important;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.empty-row:hover {
  background: #fff;
}

/* 加载/空态：紧贴表头的一行提示，不撑高结果区 */
.schedule-status-tip {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  border-top: 1px solid var(--line);
  background: #fff;
}

.schedule-status-tip[hidden] {
  display: none !important;
}

.result-pane.is-status-only #scheduleRows {
  display: none;
}

.result-pane.is-status-only .pagination-bar:empty {
  display: none;
  min-height: 0;
  padding: 0;
  border: 0;
}

.vessel-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vessel-name {
  font-weight: 800;
}

.vessel-sub {
  color: var(--muted);
  font-size: 12px;
}

.vessel-name,
.vessel-sub,
.truncate-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-text {
  max-width: 100%;
}

.tooltip-target {
  cursor: help;
}

.estimated-time {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
  text-decoration: underline dotted rgba(24, 33, 43, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.call-time .estimated-time {
  color: inherit;
}

.delayed-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(480px, calc(100vw - 24px));
  padding: 8px 10px;
  color: #fff;
  background: rgba(24, 33, 43, 0.94);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(24, 33, 43, 0.22);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
  white-space: normal;
  word-break: break-word;
}

.delayed-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.rotation-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rotation-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.port-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  max-width: none;
  min-width: 0;
  min-height: 24px;
  padding: 2px 7px 2px 4px;
  background: #edf6f4;
  border: 1px solid #cfe4df;
  border-radius: 999px;
  white-space: nowrap;
}

.port-name {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.port-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  aspect-ratio: 1 / 1;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.route-separator {
  color: var(--muted);
  font-weight: 800;
}

.port-count {
  flex: 0 0 auto;
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.next-call,
.schedule-window {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.next-call strong,
.next-call span,
.schedule-window {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-call strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.next-call span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.schedule-window {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-confirmed {
  color: #246b48;
  background: #e1f4e9;
}

.status-planned {
  color: #2f608a;
  background: var(--blue-soft);
}

.status-locked {
  color: #86510f;
  background: var(--amber-soft);
}

.detail-pane {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  z-index: 35;
  width: var(--detail-drawer-width);
  overflow-y: auto;
  padding: 16px;
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.route-map-panel {
  margin-top: 16px;
}

.route-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.route-map-toolbar div:first-child {
  display: grid;
  gap: 2px;
}

.route-map-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-map-toolbar small {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.3;
}

.route-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.route-zoom-reset {
  min-height: 30px;
  min-width: 54px;
  padding: 0 10px;
}

#routeCanvas {
  display: block;
  width: 100%;
  height: 260px;
  cursor: grab;
  background:
    linear-gradient(90deg, rgba(24, 88, 106, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(24, 88, 106, 0.08) 1px, transparent 1px),
    #e5f0ee;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#routeCanvas.dragging {
  cursor: grabbing;
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 0;
}

.detail-list div {
  min-width: 0;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-list dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-card {
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.contact-card-head h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.contact-card-head span {
  flex: 0 0 auto;
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.contact-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
}

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

.contact-list dt {
  color: var(--muted);
  font-size: 12px;
}

.contact-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-locked-title {
  margin-top: 12px;
  color: var(--ink);
  font-weight: 800;
}

.contact-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.contact-unlock {
  width: 100%;
  margin-top: 12px;
}

/* 积分解锁确认弹窗（对齐租船页提示样式） */
.schedule-unlock-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-unlock-dialog[hidden] {
  display: none !important;
}

.schedule-unlock-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.schedule-unlock-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 40px));
  padding: 20px 22px 16px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(24, 33, 43, 0.22);
}

.schedule-unlock-title {
  margin: 0 0 14px;
  color: #303133;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.schedule-unlock-message {
  color: #606266;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}

.schedule-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.schedule-unlock-btn {
  min-width: 88px;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.schedule-unlock-btn-cancel {
  color: #606266;
  background: #fff;
  border: 1px solid #dcdfe6;
}

.schedule-unlock-btn-cancel:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background: #ecf5ff;
}

.schedule-unlock-btn-confirm {
  color: #fff;
  background: #409eff;
  border: 1px solid #409eff;
}

.schedule-unlock-btn-confirm:hover {
  background: #66b1ff;
  border-color: #66b1ff;
}

.call-plan {
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.call-plan h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.call-list {
  display: grid;
  gap: 10px;
}

.call-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.call-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.call-main {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.call-row:last-child .call-main {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.call-head strong {
  color: var(--ink);
  font-size: 14px;
}

.call-head span {
  flex: 0 0 auto;
  color: #246b48;
  background: #e1f4e9;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.call-time {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}


@media (max-width: 1449px) {
  .schedule-page .page-main {
    padding: 12px 16px 24px;
  }
  .schedule-page .result-pane .table-wrap {
    overflow-x: auto;
  }
  .schedule-page .result-pane table {
    min-width: 1180px;
  }
}

@media (max-width: 1240px) {
  :root {
    --detail-drawer-width: min(500px, 48vw);
  }

  .result-pane {
    grid-column: 1;
  }
}

@media (max-width: 960px) {
  .query-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .query-actions .search-button,
  .query-actions .query-reset-button {
    flex: 1;
  }

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

  .workspace.detail-open {
    padding-right: 0;
  }

  .filter-pane {
    display: none;
  }

  .result-pane {
    height: auto;
    grid-column: auto;
    order: 1;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  /* 详情改为全屏抽屉，避免挤在列表下方难读 */
  .detail-pane,
  .workspace.detail-open .detail-pane {
    position: fixed;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: none;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .workspace.detail-open .detail-pane {
    display: block;
  }
}

@media (max-width: 768px) {
  .schedule-page .page-main {
    padding: 10px 12px 20px;
  }

  .query-band {
    margin: 0;
    padding: 14px 12px;
    border-radius: 8px;
  }

  .product-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }

  .product-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .product-title-row h1 {
    font-size: 22px;
  }

  .product-description {
    font-size: 13px;
  }

  .mode-tabs {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-tab {
    min-height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  .query-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .laycan-range {
    grid-template-columns: 1fr auto 1fr;
    gap: 4px;
  }

  .laycan-range input[type="date"] {
    min-width: 0;
    font-size: 16px; /* 避免 iOS 自动放大 */
  }

  .query-grid input {
    height: 40px;
    font-size: 16px;
  }

  .query-actions {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 8px;
  }

  .search-button,
  .query-reset-button {
    width: 100%;
    min-height: 40px;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .result-header h1,
.result-header h2 {
    font-size: 18px;
  }

  .result-header p {
    font-size: 12px;
    line-height: 1.45;
  }

  .result-tools {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .followed-only-button {
    flex: 1;
    min-height: 36px;
  }

  .result-pane {
    border-radius: 8px;
    overflow: hidden;
  }

  /* 列表改为卡片，避免横向宽表（仅结果表，不影响 SEO 说明表） */
  .schedule-page .result-pane .table-wrap {
    overflow: visible;
    padding: 0 10px 10px;
    background: transparent;
  }

  .schedule-page .result-pane table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .schedule-page .result-pane thead {
    display: none;
  }

  .schedule-page .result-pane tbody,
  .schedule-page .result-pane tr,
  .schedule-page .result-pane td {
    display: block;
    width: 100% !important;
  }

  .schedule-page .result-pane tbody tr {
    margin: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(24, 33, 43, 0.04);
  }

  .schedule-page .result-pane tbody tr.selected {
    border-color: #b7ed8c;
    background: #f7fcf2;
  }

  .schedule-page .result-pane td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 7px 0 !important;
    border-bottom: 1px dashed var(--line);
    overflow: visible;
  }

  .schedule-page .result-pane td:last-child {
    border-bottom: 0;
    padding-bottom: 0 !important;
  }

  .schedule-page .result-pane td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    padding-top: 2px;
  }

  .schedule-page .result-pane td.follow-cell {
    align-items: center;
  }

  .schedule-page .result-pane .empty-row td {
    display: block;
    height: auto !important;
    min-height: 0 !important;
    padding: 14px 12px !important;
    text-align: center;
    border: 0;
  }

  .result-pane.is-status-only .table-wrap {
    padding-bottom: 0;
  }

  .schedule-status-tip {
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .schedule-page .result-pane .empty-row td::before {
    content: none;
  }

  .rotation-line {
    flex-wrap: wrap;
  }

  .distance-cell,
  .next-call,
  .vessel-cell {
    gap: 2px;
  }

  .pagination-bar {
    padding: 12px;
    gap: 10px;
  }

  .pagination-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pagination-button {
    width: 100%;
    min-height: 38px;
  }

  .page-size-control {
    flex-wrap: wrap;
  }

  .detail-top {
    align-items: flex-start;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -12px -14px 0;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .detail-top h2 {
    font-size: 18px;
    word-break: break-word;
  }

  .detail-top-actions {
    flex: 0 0 auto;
  }

  #routeCanvas {
    height: 220px;
  }

  .route-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-card,
  .call-plan {
    padding: 12px;
  }

  .schedule-unlock-panel {
    width: min(420px, calc(100vw - 24px));
    padding: 16px;
  }
}

@media (max-width: 620px) {
  .schedule-page .page-main {
    padding: 8px 10px 18px;
  }

  .product-title-row h1 {
    font-size: 20px;
  }

  .laycan-range {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .laycan-sep {
    justify-self: center;
  }

  .schedule-page .result-pane td {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .port-chip {
    max-width: 100%;
  }
}

/* UA 识别的移动端与窄屏共用全屏详情 */
body.Wap-web .detail-pane,
body.Wap-web .workspace.detail-open .detail-pane {
  top: 0;
}

/* —— 页底 SEO/GEO 说明区：对齐船期页卡片风格 —— */
.schedule-seo.hf-seo-block {
  width: 100%;
  max-width: none;
  margin: 16px 0 0;
  padding: 20px 22px 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font: 14px/1.55 "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.schedule-seo-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.schedule-seo.hf-seo-block .schedule-seo-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.schedule-seo.hf-seo-block .hf-seo-lead {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
}

.schedule-seo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  margin-bottom: 16px;
}

.schedule-seo-panel {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.schedule-seo.hf-seo-block .schedule-seo-panel > h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.schedule-seo-panel ul {
  margin: 0;
  padding-left: 1.15em;
  color: var(--ink);
}

.schedule-seo-panel li {
  margin: 6px 0;
  color: var(--ink);
  line-height: 1.55;
}

.schedule-seo-panel li::marker {
  color: var(--cyan);
}

.schedule-seo-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.schedule-seo table {
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.schedule-seo th,
.schedule-seo td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.schedule-seo th {
  width: 28%;
  color: var(--muted);
  background: #f3f7f9;
  font-weight: 700;
}

.schedule-seo td {
  width: 72%;
  color: var(--ink);
  background: #fff;
}

.schedule-seo-links {
  margin-bottom: 16px;
}

.schedule-seo-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-seo-link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--blue-ink);
  background: var(--blue-soft);
  border: 1px solid #d3e4f5;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.schedule-seo-link-row a:hover {
  background: #dcecfb;
  border-color: #b7d2ec;
}

.schedule-seo .hf-seo-faq {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  row-gap: 16px;
}

.schedule-seo .hf-seo-faq-item {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-sizing: border-box;
}

.schedule-seo .hf-seo-faq dt {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.schedule-seo .hf-seo-faq dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.schedule-seo .hf-seo-faq a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.schedule-seo .hf-seo-faq a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .schedule-seo-grid {
    grid-template-columns: 1fr;
  }

  .schedule-seo .hf-seo-faq {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
  }
}

@media (max-width: 768px) {
  .schedule-seo.hf-seo-block {
    width: 100%;
    margin: 12px 0 0;
    padding: 16px 14px 18px;
    border-radius: 8px;
  }

  .schedule-seo-title {
    font-size: 16px;
  }

  .schedule-seo .hf-seo-lead {
    font-size: 13px;
  }

  .schedule-seo-panel {
    padding: 12px;
  }

  .schedule-seo th {
    width: 34%;
  }

  .schedule-seo-link-row a {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }
}
