/**
 * Shanghai Shipping Exchange — Ship Trading section (new design)
 * Scope: body.sse-shipsp only — does not modify legacy allen.css / shipsp.css
 */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-regular.ttf") format("truetype");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-medium.ttf") format("truetype");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-semibold.ttf") format("truetype");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-bold.ttf") format("truetype");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-regular.ttf") format("truetype");
}

:root {
  --sse-navy: #0b1f3a;
  --sse-navy-mid: #12325c;
  --sse-ocean: #1a5f8a;
  --sse-teal: #2a8f8f;
  --sse-gold: #c4a052;
  --sse-gold-soft: #e8d5a3;
  --sse-bg: #eef3f8;
  --sse-surface: #ffffff;
  --sse-surface-alt: #f7fafc;
  --sse-border: #d4dee8;
  --sse-text: #1a2d42;
  --sse-text-muted: #5c7086;
  --sse-link: #1a5f8a;
  --sse-link-hover: #0e4568;
  --sse-radius: 6px;
  --sse-shadow: 0 2px 12px rgba(11, 31, 58, 0.08);
  --sse-shadow-lg: 0 8px 28px rgba(11, 31, 58, 0.12);
  --sse-font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --sse-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sse-width: 1200px;
  --sse-sidebar-width: 248px;
  --sse-main-gap: 16px;
}

/* ── Base ── */
body.sse-shipsp {
  width: var(--sse-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 24px;
  box-sizing: border-box;
  font: 13px/1.65 var(--sse-font);
  color: var(--sse-text);
  background: var(--sse-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(26, 95, 138, 0.14), transparent 55%),
    linear-gradient(180deg, #e4edf5 0%, var(--sse-bg) 120px);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

body.sse-shipsp::after {
  content: "";
  display: table;
  clear: both;
  width: 100%;
}

body.sse-shipsp a:link,
body.sse-shipsp a:visited {
  color: var(--sse-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

body.sse-shipsp a:hover {
  color: var(--sse-link-hover);
  text-decoration: underline;
}

body.sse-shipsp p {
  margin: 0 0 0.75em;
}

/* ── Header banner ── */
body.sse-shipsp #logo {
  width: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, var(--sse-navy) 0%, var(--sse-navy-mid) 42%, var(--sse-ocean) 100%);
  box-shadow: var(--sse-shadow-lg);
  position: relative;
  overflow: hidden;
}

body.sse-shipsp #logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(196, 160, 82, 0.06) 50%, transparent 100%),
    repeating-linear-gradient(
      -55deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.025) 18px,
      rgba(255, 255, 255, 0.025) 19px
    );
  pointer-events: none;
}

body.sse-shipsp .sse-shipsp-banner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 160px;
  padding: 36px 40px 32px;
  box-sizing: border-box;
}

body.sse-shipsp .sse-shipsp-banner__title {
  margin: 0;
  font-family: var(--sse-serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.sse-shipsp .sse-shipsp-banner__subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sse-gold-soft);
}

/* ── Top navigation ── */
body.sse-shipsp #menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  min-height: 44px;
  padding: 8px 14px;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--sse-navy-mid) 0%, var(--sse-navy) 100%);
  border-bottom: 3px solid var(--sse-gold);
  box-shadow: var(--sse-shadow);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

body.sse-shipsp #menu.whitezi,
body.sse-shipsp #menu a {
  color: #f0f4f8 !important;
}

body.sse-shipsp #menu a {
  padding: 6px 14px;
  border-radius: 4px;
  line-height: 1.4;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

body.sse-shipsp #menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sse-gold-soft) !important;
  text-decoration: none !important;
}

body.sse-shipsp #menu .sse-menu-logo {
  padding: 0;
}

body.sse-shipsp #menu .sse-menu-logo:hover {
  background: transparent;
}

body.sse-shipsp #menu .sse-menu-logo img {
  vertical-align: middle;
  border-radius: 3px;
}

/* ── Main layout ── */
body.sse-shipsp .sse-shipsp-main {
  display: flex;
  align-items: flex-start;
  gap: var(--sse-main-gap);
  width: 100%;
  margin-top: var(--sse-main-gap);
  clear: both;
}

body.sse-shipsp .sse-shipsp-sidebar {
  flex: 0 0 var(--sse-sidebar-width);
  width: var(--sse-sidebar-width);
}

body.sse-shipsp .sse-shipsp-sidebar-menu {
  background: var(--sse-surface);
  border: 1px solid var(--sse-border);
  border-radius: var(--sse-radius);
  box-shadow: var(--sse-shadow);
  overflow: hidden;
}

body.sse-shipsp .sse-shipsp-sidebar-menu h4 {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--sse-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #fff;
  text-align: center;
  background: linear-gradient(90deg, var(--sse-navy-mid), var(--sse-ocean));
  border-bottom: 2px solid var(--sse-gold);
}

body.sse-shipsp .sse-shipsp-sidebar-menu .nav {
  margin: 0;
  padding: 8px 0 12px;
  list-style: none;
}

body.sse-shipsp .sse-shipsp-sidebar-menu .nav > li {
  margin: 0;
  padding: 0;
  line-height: 1.4;
  font-size: 13px;
}

body.sse-shipsp .sse-shipsp-sidebar-menu .nav > li a {
  display: block;
  padding: 9px 16px 9px 28px;
  color: var(--sse-text);
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Ccircle cx='3' cy='3' r='2' fill='%231a5f8a'/%3E%3C/svg%3E") no-repeat 14px 14px;
}

body.sse-shipsp .sse-shipsp-sidebar-menu .nav > li a:hover {
  background-color: var(--sse-surface-alt);
  color: var(--sse-ocean);
  text-decoration: none !important;
}

body.sse-shipsp .sse-shipsp-sidebar-menu .nav > li.active a {
  font-weight: 600;
  color: var(--sse-navy);
  background-color: rgba(26, 95, 138, 0.08);
  border-left-color: var(--sse-gold);
}

body.sse-shipsp .sse-shipsp-sidebar-menu .icon-chevron-right {
  display: none;
}

body.sse-shipsp .u-hidden {
  display: none !important;
}

/* ── Content panel ── */
body.sse-shipsp .sse-shipsp-content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 28px;
  box-sizing: border-box;
  background: var(--sse-surface);
  border: 1px solid var(--sse-border);
  border-radius: var(--sse-radius);
  box-shadow: var(--sse-shadow);
  overflow: hidden;
}

body.sse-shipsp .sse-shipsp-page-title {
  margin: 0 0 20px;
  padding-bottom: 12px;
  font-family: var(--sse-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--sse-navy);
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--sse-gold);
}

/* ── Buttons ── */
body.sse-shipsp .sse-shipsp-btn {
  display: inline-block;
  min-width: 72px;
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 4px;
  font: 600 13px/32px var(--sse-font);
  letter-spacing: 0.03em;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

body.sse-shipsp .sse-shipsp-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--sse-ocean) 0%, var(--sse-navy-mid) 100%);
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.15);
}

body.sse-shipsp .sse-shipsp-btn--primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

body.sse-shipsp .sse-shipsp-btn:active {
  transform: translateY(0);
}

/* ── Listing table ── */
body.sse-shipsp .sse-shipsp-list {
  width: 100%;
}

body.sse-shipsp .sse-shipsp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 8px;
  background: var(--sse-surface);
  border: 1px solid var(--sse-border);
  border-radius: var(--sse-radius);
  overflow: hidden;
  box-shadow: var(--sse-shadow);
}

body.sse-shipsp .sse-shipsp-table th {
  padding: 11px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  background: linear-gradient(180deg, var(--sse-teal) 0%, var(--sse-ocean) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.sse-shipsp .sse-shipsp-table td {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
  border: 1px solid var(--sse-border);
  background: #fff;
}

body.sse-shipsp .sse-shipsp-table tr.sse-shipsp-row--alt td {
  background: var(--sse-surface-alt);
}

body.sse-shipsp .sse-shipsp-table tbody tr:hover td,
body.sse-shipsp .sse-shipsp-table tr:not(:first-child):hover td {
  background: rgba(26, 95, 138, 0.06);
}

body.sse-shipsp .sse-shipsp-table tr > td:nth-child(2) {
  text-align: left;
  font-weight: 500;
}

body.sse-shipsp .sse-shipsp-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--sse-ocean) !important;
  text-decoration: none !important;
  background: var(--sse-surface-alt);
  border: 1px solid var(--sse-border);
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.sse-shipsp .sse-shipsp-detail-link:hover {
  color: #fff !important;
  background: var(--sse-ocean);
  border-color: var(--sse-ocean);
  text-decoration: none !important;
}

/* ── Pagination ── */
body.sse-shipsp .sse-shipsp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 0;
  border-top: 1px solid var(--sse-border);
  margin-top: 12px;
}

body.sse-shipsp .sse-shipsp-pagination__goto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 13px;
  color: var(--sse-text);
}

body.sse-shipsp .sse-shipsp-pagination__goto input {
  width: 52px;
  padding: 6px 8px;
  border: 1px solid var(--sse-border);
  border-radius: 4px;
  font: 13px var(--sse-font);
  text-align: center;
  box-sizing: border-box;
}

body.sse-shipsp .sse-shipsp-pagination__goto input:focus {
  outline: none;
  border-color: var(--sse-ocean);
  box-shadow: 0 0 0 2px rgba(26, 95, 138, 0.15);
}

body.sse-shipsp .sse-shipsp-pagination__prev a,
body.sse-shipsp .sse-shipsp-pagination__next a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--sse-ocean) !important;
  text-decoration: none !important;
  background: var(--sse-surface);
  border: 1px solid var(--sse-border);
  border-radius: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.sse-shipsp .sse-shipsp-pagination__prev a:hover,
body.sse-shipsp .sse-shipsp-pagination__next a:hover {
  color: #fff !important;
  background: var(--sse-ocean);
  border-color: var(--sse-ocean);
  text-decoration: none !important;
}

body.sse-shipsp .sse-shipsp-pagination__prev span,
body.sse-shipsp .sse-shipsp-pagination__next span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sse-text-muted);
  background: var(--sse-surface-alt);
  border: 1px solid var(--sse-border);
  border-radius: 4px;
  opacity: 0.65;
  cursor: default;
}

/* ── Ship notices (shipgn.jsp) ── */
body.sse-shipsp .sse-shipsp-notice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--sse-border);
  border-radius: var(--sse-radius);
  overflow: hidden;
  box-shadow: var(--sse-shadow);
}

body.sse-shipsp .sse-shipsp-notice-list li {
  border-bottom: 1px solid var(--sse-border);
}

body.sse-shipsp .sse-shipsp-notice-list li:last-child {
  border-bottom: none;
}

body.sse-shipsp .sse-shipsp-notice-list li a {
  display: block;
  padding: 12px 16px 12px 32px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--sse-text);
  text-decoration: none !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Ccircle cx='3' cy='3' r='2' fill='%231a5f8a'/%3E%3C/svg%3E") no-repeat 14px 18px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.sse-shipsp .sse-shipsp-notice-list li a:hover {
  color: var(--sse-ocean);
  background-color: var(--sse-surface-alt);
  text-decoration: none !important;
}

/* ── Detail modal (CSP-safe, class toggled) ── */
body.sse-shipsp .sse-shipsp-blocker.u-hidden {
  display: none !important;
}

body.sse-shipsp.sse-shipsp-modal-open {
  overflow: hidden;
}

body.sse-shipsp .blocker {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
  background-color: rgba(11, 31, 58, 0.72);
  text-align: center;
}

body.sse-shipsp .blocker::before {
  content: "";
  display: inline-block;
  height: 100%;
  vertical-align: middle;
  margin-right: -0.05em;
}

body.sse-shipsp .modal {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  z-index: 1001;
  max-width: 720px;
  box-sizing: border-box;
  width: 94%;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(11, 31, 58, 0.25);
  text-align: left;
}

body.sse-shipsp .modal a.close-modal {
  position: absolute;
  top: 10px;
  right: 12px;
  display: block;
  width: 28px;
  height: 28px;
  text-indent: -9999px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='13' fill='rgba(255,255,255,0.2)'/%3E%3Cpath d='M9 9l10 10M19 9L9 19' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0.9;
  z-index: 2;
  transition: opacity 0.15s ease;
}

body.sse-shipsp .modal a.close-modal:hover {
  opacity: 1;
}

body.sse-shipsp .sse-shipsp-detail {
  padding: 0;
}

body.sse-shipsp .sse-shipsp-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

body.sse-shipsp .sse-shipsp-detail-table tr:first-child td {
  padding: 16px 48px 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--sse-navy-mid) 0%, var(--sse-ocean) 100%);
  border-bottom: 2px solid var(--sse-gold);
}

body.sse-shipsp .sse-shipsp-detail-table td {
  padding: 9px 14px;
  line-height: 1.45;
  vertical-align: top;
  border: 1px solid var(--sse-border);
}

body.sse-shipsp .sse-shipsp-detail-table tr:not(:first-child) td:first-child {
  width: 38%;
  max-width: 220px;
  font-weight: 600;
  color: var(--sse-navy);
  background: var(--sse-surface-alt);
}

body.sse-shipsp .sse-shipsp-detail-table tr:not(:first-child) td:last-child,
body.sse-shipsp .sse-shipsp-detail-table tr:not(:first-child) td:not(:first-child) {
  background: #fff;
  color: var(--sse-text);
}

body.sse-shipsp .sse-shipsp-detail-table tr:nth-child(even):not(:first-child) td:not(:first-child) {
  background: var(--sse-surface-alt);
}

@media (max-width: 960px) {
  body.sse-shipsp .sse-shipsp-main {
    flex-direction: column;
  }

  body.sse-shipsp .sse-shipsp-sidebar {
    flex: none;
    width: 100%;
  }

  body.sse-shipsp .sse-shipsp-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  body.sse-shipsp .sse-shipsp-pagination__goto {
    margin-right: 0;
  }

  body.sse-shipsp .sse-shipsp-pagination__prev,
  body.sse-shipsp .sse-shipsp-pagination__next {
    text-align: center;
  }
}
