:root {
  --ink: #10233f; --muted: #64748b; --line: #dce5ef; --paper: #ffffff;
  --navy: #092a4a; --blue: #1268b3; --cyan: #25a8b8; --orange: #f06432;
  --soft: #f3f7fa; --warning-bg: #fff0e8; --warning-ink: #a43b16;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: #edf3f7; font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #d9eef1 0, transparent 30%), #edf3f7; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100% - 1160px)/2)); background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(16,35,63,.09); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--navy); font-size: 20px; font-weight: 750; text-decoration: none; letter-spacing: .02em; }
.brand-logo { width: 58px; height: 40px; object-fit: contain; }
.admin-link { color: var(--blue); text-decoration: none; font-size: 14px; }
main { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 72px 0 42px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3 { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 12px; color: var(--navy); font-size: clamp(34px, 5vw, 58px); line-height: 1.12; letter-spacing: -.04em; }
.subtitle { max-width: 760px; margin: 0 0 30px; color: var(--muted); line-height: 1.75; }
.search-card { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 14px; padding: 22px; background: var(--paper); border: 1px solid rgba(16,35,63,.08); border-radius: 18px; box-shadow: 0 18px 50px rgba(22,54,82,.1); }
.field { display: flex; flex-direction: column; gap: 8px; }
label, .meta-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
input, select { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #cbd8e4; border-radius: 9px; color: var(--ink); background: white; font: inherit; outline: none; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(37,168,184,.13); }
button { border: 0; cursor: pointer; font: inherit; font-weight: 750; transition: transform .15s ease, opacity .15s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
.primary { display: flex; align-items: center; justify-content: center; gap: 20px; height: 48px; padding: 0 22px; color: white; background: linear-gradient(135deg, var(--blue), var(--navy)); border-radius: 9px; }
.secondary { height: 42px; padding: 0 17px; color: var(--blue); background: #eaf4fb; border-radius: 9px; }
.message { margin-top: 16px; padding: 12px 15px; border-radius: 9px; color: var(--navy); background: #ddecf5; }
.message.error { color: #9b2c21; background: #fee8e5; }.message.success { color: #17663e; background: #e0f5e9; }
.history-panel { margin: 0 0 28px; padding: 28px; background: rgba(255,255,255,.94); border: 1px solid rgba(16,35,63,.08); border-radius: 20px; box-shadow: 0 18px 50px rgba(22,54,82,.08); }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }.history-heading h2 { margin-bottom: 8px; font-size: 28px; }.history-heading p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.history-controls { display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 12px; min-width: 210px; }.history-controls input { height: 40px; }.live-status { grid-column: 1/-1; display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: #18714a; font-size: 12px; font-weight: 700; }.live-status i { width: 8px; height: 8px; background: #24b26b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(36,178,107,.13); }
.history-stats { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 1px; margin: 24px 0 14px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 11px; }.history-stats > div { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; background: var(--soft); }.history-stats strong { font-size: 20px; }.history-stats div:last-child strong { font-size: 14px; }.history-stats span { color: var(--muted); font-size: 11px; }
.history-list { display: flex; flex-direction: column; gap: 14px; }.history-directory { padding: 12px; background: #f7fafc; border: 1px solid var(--line); border-radius: 13px; }.history-directory-label { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 9px; color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .04em; }.history-directory-label small { color: var(--muted); font-weight: 650; letter-spacing: 0; }.history-directory-children { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 0 28px; padding-left: 15px; border-left: 2px solid #b9dce5; }.history-directory-children:empty { display: none; }.history-directory-unassigned { background: #fffaf5; }.history-directory-children-unassigned { margin-left: 0; }.history-record { display: grid; grid-template-columns: minmax(170px,1.6fr) minmax(100px,1fr) 90px 150px 22px 48px; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; color: var(--ink); text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }.history-record-master { border-color: #a8d4df; box-shadow: 0 5px 16px rgba(22,54,82,.05); }.history-record-child { position: relative; padding-top: 13px; padding-bottom: 13px; }.history-record-child::before { position: absolute; left: -17px; top: 50%; width: 15px; height: 2px; content: ""; background: #b9dce5; }.history-record:hover { border-color: #78b8ca; background: #f9fcfd; }.history-record.has-warning { border-left: 4px solid var(--orange); }.history-record-main { display: flex; flex-direction: column; gap: 4px; }.history-record-number { display: flex; align-items: center; gap: 9px; }.history-delete { justify-self: end; padding: 5px 9px; color: #b42318; background: #fee8e5; border-radius: 5px; font-size: 11px; }.history-record-main small, .history-record-time { color: var(--muted); font-size: 12px; }.history-record-status { overflow: hidden; color: var(--blue); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.history-record-count { color: var(--muted); font-size: 12px; }.history-record-time { text-align: right; }.history-record-arrow { color: var(--cyan); font-size: 19px; }.history-empty { padding: 26px; color: var(--muted); text-align: center; background: var(--soft); border-radius: 10px; }
.result { margin-bottom: 70px; padding: 30px; background: var(--paper); border-radius: 20px; box-shadow: 0 18px 55px rgba(22,54,82,.1); }
.result-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.result-heading h2 { margin-bottom: 10px; font-size: 30px; letter-spacing: .02em; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }.badge { padding: 5px 9px; color: var(--blue); background: #eaf4fb; border-radius: 5px; font-size: 12px; font-weight: 750; }
.warning { margin: 24px 0 0; padding: 17px 20px; color: var(--warning-ink); background: var(--warning-bg); border-left: 4px solid var(--orange); border-radius: 7px; font-weight: 750; }
.route-panel { display: grid; grid-template-columns: minmax(120px,1fr) minmax(100px,3fr) minmax(120px,1fr); align-items: center; margin: 30px 0 22px; padding: 26px; color: white; background: linear-gradient(120deg, #0c304f, #145681); border-radius: 14px; }
.port { display: flex; flex-direction: column; gap: 8px; }.port .meta-label { color: #a9cedf; }.port strong { font-size: 18px; }.align-right { text-align: right; }
.route-line { position: relative; height: 1px; margin: 0 30px; background: repeating-linear-gradient(90deg,#7bc5d0 0,#7bc5d0 7px,transparent 7px,transparent 13px); }.ship { position: absolute; left: 55%; top: -14px; color: #9adbe2; font-size: 22px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }.facts > div { display: flex; flex-direction: column; gap: 8px; min-height: 86px; padding: 18px; border-right: 1px solid var(--line); }.facts > div:last-child { border: 0; }.facts strong { font-size: 14px; }
.timeline-section { margin-top: 34px; }.section-title { display: flex; justify-content: space-between; color: var(--muted); }.section-title h3 { color: var(--navy); }
.timeline { margin: 10px 0 0 6px; padding: 0; list-style: none; }.timeline-item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 30px; min-height: 114px; padding: 0 0 26px 30px; border-left: 2px solid var(--line); }.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -8px; top: 3px; width: 14px; height: 14px; background: var(--cyan); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 2px var(--cyan); }.timeline-time { color: var(--muted); font-size: 13px; line-height: 20px; }.timeline-card strong { color: var(--navy); }.timeline-card p { margin: 6px 0; color: #334b65; }.timeline-card span { color: var(--muted); font-size: 13px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); background: var(--soft); border-radius: 12px; }.empty-state span { display: block; margin-bottom: 8px; font-size: 30px; }.empty-state p { margin-bottom: 0; }
.associated { margin-top: 28px; }.container-chips { display: flex; flex-wrap: wrap; gap: 8px; }.chip { padding: 8px 11px; color: var(--blue); background: #eaf4fb; border-radius: 7px; }
footer { padding: 0 20px 32px; color: var(--muted); text-align: center; font-size: 12px; }
.delete-dialog { width: min(470px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(9,42,74,.28); }.delete-dialog::backdrop { background: rgba(9,42,74,.45); }.delete-form { padding: 26px; }.delete-form h3 { margin-bottom: 8px; }.delete-form p { color: var(--muted); line-height: 1.55; }.delete-form .delete-warning { color: #9b2c21; }.delete-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }.danger { height: 42px; padding: 0 17px; color: white; background: #b42318; border-radius: 9px; }
.admin-main { padding: 54px 0; }.admin-card { padding: 30px; background: white; border-radius: 18px; box-shadow: 0 18px 50px rgba(22,54,82,.1); }.admin-card h1 { font-size: 38px; }.token-field { max-width: 480px; margin: 24px 0; }.route-form { display: grid; grid-template-columns: repeat(4,1fr) auto; gap: 12px; align-items: end; padding: 20px; background: var(--soft); border-radius: 12px; }.table-wrap { margin-top: 25px; overflow-x: auto; }table { width: 100%; border-collapse: collapse; }th,td { padding: 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }th { color: var(--muted); font-size: 12px; }.muted { color: var(--muted); text-align: center; }
@media (max-width: 900px) { .search-card { grid-template-columns: 1fr 1fr; }.field-wide { grid-column: 1/-1; }.facts { grid-template-columns: 1fr 1fr; }.facts > div:nth-child(2) { border-right: 0; }.route-form { grid-template-columns: 1fr 1fr; }.history-record { grid-template-columns: minmax(150px,1.5fr) 1fr 80px 22px 48px; }.history-record-time { display: none; } }
@media (max-width: 560px) { .topbar { padding: 0 16px; }.hero { padding-top: 42px; }.search-card { grid-template-columns: 1fr; }.field-wide { grid-column: auto; }.history-panel { padding: 20px; }.history-heading { flex-direction: column; }.history-controls { width: 100%; }.history-stats { grid-template-columns: 1fr 1fr; }.history-stats > div:last-child { grid-column: 1/-1; }.history-directory { padding: 9px; }.history-directory-children { margin-left: 12px; padding-left: 10px; }.history-record { grid-template-columns: 1fr auto auto; }.history-record-status, .history-record-count { grid-column: 1; }.history-record-arrow { grid-column: 2; grid-row: 1/4; }.history-delete { grid-column: 3; grid-row: 1/4; }.result { padding: 20px; }.result-heading { flex-direction: column; }.route-panel { grid-template-columns: 1fr; gap: 18px; }.route-line { margin: 0; }.align-right { text-align: left; }.facts { grid-template-columns: 1fr; }.facts > div { border-right: 0; border-bottom: 1px solid var(--line); }.timeline-item { grid-template-columns: 1fr; gap: 4px; }.admin-card { padding: 20px; }.route-form { grid-template-columns: 1fr; } }
.history-record-child { grid-template-columns: minmax(170px,1.6fr) minmax(100px,1fr) 90px 150px 22px; }
@media (max-width: 900px) { .history-record-child { grid-template-columns: minmax(150px,1.5fr) 1fr 80px 22px; } }
@media (max-width: 560px) { .history-record-child { grid-template-columns: 1fr auto; }.history-record-child .history-record-arrow { grid-column: 2; } }
.history-record-master { grid-template-columns: minmax(170px,1.6fr) minmax(100px,1fr) 90px 150px 22px 126px; }
.history-actions { display: flex; justify-content: flex-end; gap: 6px; }.history-actions button { white-space: nowrap; }.history-edit { padding: 5px 9px; color: var(--blue); background: #eaf4fb; border-radius: 5px; font-size: 11px; }
.bill-metadata { margin: 8px 2px 2px; }.bill-metadata-values { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 9px; }.bill-metadata-values > span { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 10px 12px; background: #fff; }.bill-metadata-values small { color: var(--muted); font-size: 10px; }.bill-metadata-values strong { overflow: hidden; color: var(--navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.metadata-empty { color: #9aa8b5; font-weight: 500; }.bill-metadata-editor { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 14px; background: #edf5f8; border-radius: 9px; }.bill-metadata-editor[hidden] { display: none; }.bill-metadata-editor label { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }.bill-metadata-editor input { width: 100%; height: 39px; padding: 0 10px; background: white; border: 1px solid var(--line); border-radius: 7px; }.metadata-token { grid-column: 1/3; }.metadata-editor-actions { display: flex; grid-column: 3/5; align-items: end; justify-content: flex-end; gap: 8px; }.metadata-editor-actions button { height: 39px; }
.bill-auto-logistics { margin: 8px 2px 0; }.bill-auto-logistics-label { padding: 8px 12px 6px; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .1em; }.bill-auto-logistics-values { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; overflow: hidden; background: #c8e4ea; border: 1px solid #c8e4ea; border-radius: 9px; }.bill-auto-logistics-values > span { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 10px 12px; background: #f2fafb; }.bill-auto-logistics-values small { color: var(--muted); font-size: 10px; }.bill-auto-logistics-values strong { overflow: hidden; color: var(--navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .history-record-master { grid-template-columns: minmax(150px,1.5fr) 1fr 80px 22px 126px; }.bill-metadata-values, .bill-auto-logistics-values, .bill-metadata-editor { grid-template-columns: 1fr 1fr; }.metadata-token, .metadata-editor-actions { grid-column: auto; } }
@media (max-width: 560px) { .history-record-master { grid-template-columns: 1fr auto; }.history-record-master .history-record-status, .history-record-master .history-record-count { grid-column: 1; }.history-record-master .history-record-arrow { display: none; }.history-actions { grid-column: 2; grid-row: 1/4; flex-direction: column; }.bill-metadata-values, .bill-auto-logistics-values, .bill-metadata-editor { grid-template-columns: 1fr; }.metadata-editor-actions { justify-content: stretch; }.metadata-editor-actions button { flex: 1; } }
@media (max-width: 560px) { .brand { font-size: 16px; } }
