/* =========================================================
   PowerTool · 船舶管理专属样式
   共享样式见 ../styles/common.css
   ========================================================= */

/* ---------- 船舶区 ---------- */
.fleet-section {
  padding: 40px 0 64px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 140, 66, 0.06), transparent 70%),
    var(--bg-900);
  border-bottom: 1px solid var(--border-soft);
  min-height: calc(100vh - var(--header-h) - 200px);
}
.fleet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.fleet-head-copy {
  min-width: 0;
}
.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 8px;
}
.fleet-title {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.fleet-sub {
  margin: 0;
  color: var(--text-2);
  font-size: 0.96rem;
}
.fleet-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 容器外壳 */
.fleet-shell {
  background: var(--bg-850);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* 搜索框（沿用共享 .search-box 视觉，补专属样式） */
.search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
}
.search-input {
  width: 220px;
  max-width: 50vw;
  height: 32px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.84rem;
}
.search-input::placeholder {
  color: var(--text-4);
}
.search-input::-webkit-search-cancel-button {
  display: none;
}

/* ---------- 船舶表格 ---------- */
.table-wrap {
  position: relative;
  overflow-x: auto;
  min-height: 220px;
}
.ship-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ship-table thead {
  background: var(--bg-800);
}
.ship-table th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ship-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  vertical-align: middle;
}
.ship-table tbody tr {
  transition: background 0.12s;
}
.ship-table tbody tr:hover {
  background: rgba(255, 140, 66, 0.04);
}
.ship-table tbody tr:last-child td {
  border-bottom: none;
}
.col-id {
  width: 60px;
}
.col-actions {
  width: 96px;
  text-align: right;
}
.cell-id {
  font-family: var(--font-mono);
  color: var(--text-4);
  font-size: 0.82rem;
}
.cell-name {
  color: var(--text);
  font-weight: 600;
}
.cell-name .cell-name-empty {
  color: var(--text-4);
  font-style: italic;
  font-weight: 400;
}
.cell-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--phosphor-soft);
}
.cell-mono.cell-imei {
  color: var(--amber-soft);
}
.cell-muted {
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.cell-openid {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空状态 / 加载状态 */
.table-empty,
.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
}
.table-empty[hidden],
.table-loading[hidden] {
  display: none;
}
.empty-icon {
  color: var(--text-4);
  opacity: 0.6;
}
.empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-2);
}
.empty-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-3);
}

/* ---------- 弹窗 ---------- */
.modal {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-850);
  color: var(--text);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 140, 66, 0.08) inset;
}
.modal-sm {
  width: min(400px, calc(100vw - 32px));
}
.modal::backdrop {
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-form {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-800);
}
.modal-message {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
}
.modal-message strong {
  color: var(--text);
}
.modal-hint {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
  color: var(--alert);
}

/* 弹窗内表单（覆盖共享 .form-grid 间距） */
.modal-body .form-row {
  margin-bottom: 14px;
}
.modal-body .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

/* =========================================================
   响应式 · 船舶页专属断点
   ========================================================= */
@media (max-width: 760px) {
  .fleet-section {
    padding: 28px 0 48px;
  }
  .fleet-head {
    align-items: flex-start;
  }
  .statusbar {
    padding: 10px 12px;
  }
  .search {
    flex: 1;
    width: 100%;
  }
  .search-input {
    width: 100%;
    max-width: none;
    flex: 1;
  }
  .ship-table th,
  .ship-table td {
    padding: 10px 12px;
  }
  .cell-openid {
    max-width: 120px;
  }
}

/* 超窄屏：表格转为卡片视图 */
@media (max-width: 560px) {
  .ship-table thead {
    display: none;
  }
  .ship-table,
  .ship-table tbody,
  .ship-table tr,
  .ship-table td {
    display: block;
    width: 100%;
  }
  .ship-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-850);
  }
  .ship-table tbody tr:last-child {
    border-bottom: none;
  }
  .ship-table td {
    padding: 6px 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  .ship-table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-4);
    text-align: left;
  }
  .col-actions,
  .ship-table td[data-label="操作"] {
    justify-content: flex-end;
  }
  .cell-openid {
    max-width: 60vw;
  }
  .modal-body .form-grid {
    grid-template-columns: 1fr;
  }
}
