/* ============================================================
   port-list 页专用样式
   由 pages/port-list.php 的内联 <style> 块外迁生成，
   经 header.php 的 $extraCss 机制按需加载。
   ============================================================ */

.port-page { max-width:var(--max-width); margin:0 auto; padding:clamp(28px,4vw,44px) clamp(16px,3vw,24px); }

.port-toolbar { display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.port-search-box { flex:1; min-width:240px; position:relative; }
.port-search-ico { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--md-on-surface-muted); font-size:14px; pointer-events:none; }
.port-input { width:100%; height:42px; padding:0 16px 0 38px; border:1px solid var(--md-outline-subtle); border-radius:var(--md-shape-md); font-size:14px; color:var(--md-on-surface); background:var(--md-surface); outline:none; transition:border-color var(--md-duration-short) var(--md-easing-standard), box-shadow var(--md-duration-short) var(--md-easing-standard); }
.port-input:focus { border-color:var(--md-primary); box-shadow:0 0 0 3px rgba(13,59,102,.08); }
.port-input::placeholder { color:var(--md-on-surface-muted); opacity:.7; }
.port-select { height:42px; padding:0 12px; border:1px solid var(--md-outline-subtle); border-radius:var(--md-shape-md); font-size:13px; color:var(--md-on-surface); background:var(--md-surface); max-width:200px; outline:none; }
.port-select:focus { border-color:var(--md-primary); }
.port-btn { height:42px; padding:0 22px; border:none; border-radius:var(--md-shape-md); font-size:14px; font-weight:600; color:var(--gray-0); background:var(--md-primary); cursor:pointer; white-space:nowrap; transition:filter var(--md-duration-short) var(--md-easing-standard), box-shadow var(--md-duration-short) var(--md-easing-standard); }
.port-btn:hover { filter:brightness(.94); box-shadow:var(--md-elevation-2); }

.port-results-count { font-size:12px; color:var(--md-on-surface-muted); margin-bottom:12px; }
.port-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; }
.port-card { background:var(--md-surface); border:1px solid var(--md-outline-subtle); border-radius:var(--md-shape-lg); padding:14px 16px; transition:box-shadow var(--md-duration-short) var(--md-easing-standard); }
.port-card:hover { box-shadow:var(--md-elevation-2); }
.port-card-head { display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; margin-bottom:10px; }
.port-icon { font-size:20px; flex-shrink:0; color:var(--md-on-surface-variant); width:24px; text-align:center; }
.port-main { min-width:0; flex:1; }
.port-name { font-size:14px; font-weight:600; color:var(--md-on-surface); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.port-meta { font-size:11px; color:var(--md-on-surface-variant); margin-top:2px; display:flex; flex-wrap:wrap; gap:5px; align-items:center; }
.port-locode { background:var(--md-surface-container-low); color:var(--md-on-surface-variant); padding:1px 6px; border-radius:4px; font-weight:500; letter-spacing:.5px; }
.port-detail-link { color:var(--md-primary); font-size:12px; margin-left:auto; flex-shrink:0; white-space:nowrap; }
.port-commodities { display:flex; flex-wrap:wrap; gap:4px; padding-top:8px; border-top:1px solid var(--md-outline-subtle); }
.port-chip { font-size:11px; color:var(--md-on-surface-variant); text-decoration:none; background:var(--md-surface-container-low); padding:3px 8px; border-radius:12px; transition:color var(--md-duration-short) var(--md-easing-standard); }
.port-chip:hover { color:var(--md-primary); }
.port-more { font-size:11px; color:var(--md-primary); text-decoration:none; padding:3px 8px; }

.port-pagination { display:flex; justify-content:center; flex-wrap:wrap; gap:6px; margin-top:24px; }
.port-pg { display:inline-block; padding:6px 14px; border-radius:6px; font-size:13px; text-decoration:none; transition:opacity var(--md-duration-short) var(--md-easing-standard); }
.port-pg-inactive { background:var(--md-surface-container-low); color:var(--md-on-surface); }
.port-pg-inactive:hover { opacity:.85; }
.port-pg-active { background:var(--md-primary); color:var(--gray-0); }
.port-pg-dots { display:inline-block; padding:6px 4px; color:var(--md-on-surface-muted); font-size:13px; }

.port-empty { text-align:center; padding:60px 20px; }
.port-empty p { font-size:15px; color:var(--md-on-surface-muted); margin:0 0 8px; }
.port-empty a { color:var(--md-primary); text-decoration:none; }

/* ── 按国家浏览（国家维度）── */
.port-country-dir{margin:0 0 26px;padding:18px 20px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg,12px);}
.port-country-dir-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px;}
.port-country-dir h2{font-size:16px;font-weight:600;line-height:1.4;color:var(--color-text-body);margin:0;}
.port-country-dir-count{font-size:12px;color:var(--color-text-tertiary);}
.port-country-group{display:flex;gap:12px;align-items:flex-start;padding:6px 0;border-top:1px solid var(--color-divider);}
.port-country-dir-head + .port-country-group{border-top:0;}
.port-country-letter{flex:0 0 20px;font-size:13px;font-weight:700;line-height:26px;text-align:center;color:var(--color-primary);}
.port-country-links{display:flex;flex-wrap:wrap;gap:6px;flex:1;min-width:0;}
.port-country-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--color-border);border-radius:999px;background:var(--color-background);font-size:12px;line-height:18px;color:var(--color-text-secondary);text-decoration:none;transition:background var(--md-duration-short,160ms),color var(--md-duration-short,160ms),border-color var(--md-duration-short,160ms);}
.port-country-chip:hover{background:var(--color-primary-container);border-color:var(--color-primary-container);color:var(--color-primary-active);}
.port-country-chip.is-active{background:var(--color-primary-container);border-color:var(--color-primary);color:var(--color-primary-active);font-weight:600;}
.port-country-num{font-size:10px;line-height:16px;min-width:16px;padding:0 4px;border-radius:999px;background:var(--color-surface);color:var(--color-text-tertiary);text-align:center;}
.port-country-chip:hover .port-country-num,.port-country-chip.is-active .port-country-num{background:var(--color-surface);color:var(--color-primary-active);}

/* ── 国家维度入口条（/ports 页）── */
.port-country-entry{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 26px;padding:16px 20px;background:var(--color-primary-container);border:1px solid var(--color-border);border-radius:var(--radius-lg,12px);}
.port-country-entry-txt{display:flex;flex-direction:column;gap:2px;min-width:0;}
.port-country-entry-txt strong{font-size:15px;font-weight:600;color:var(--color-primary-active);}
.port-country-entry-txt span{font-size:12px;color:var(--color-text-secondary);}
.port-country-entry-btn{flex-shrink:0;padding:8px 16px;border-radius:999px;background:var(--color-surface);border:1px solid var(--color-border);color:var(--color-primary-active);font-size:13px;font-weight:600;text-decoration:none;white-space:nowrap;}
.port-country-entry-btn:hover{background:var(--color-surface);border-color:var(--color-primary);}

/* ── 国家列表页 /ports/country ── */
.port-country-index{padding:20px 22px;}
.port-country-alpha{display:flex;flex-wrap:wrap;gap:4px;padding:0 0 14px;border-bottom:1px solid var(--color-divider);margin-bottom:6px;}
.port-country-alpha a{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 5px;border-radius:6px;background:var(--color-background);color:var(--color-text-secondary);font-size:12px;font-weight:600;text-decoration:none;}
.port-country-alpha a:hover{background:var(--color-primary-container);color:var(--color-primary-active);}
.port-country-index .port-country-group{padding:8px 0;scroll-margin-top:80px;}
.port-country-chip.is-empty{opacity:.62;}
.port-country-chip.is-empty .port-country-num{background:var(--color-background);}

@media (max-width:600px){ .port-grid{grid-template-columns:1fr;} .port-toolbar{flex-direction:column;align-items:stretch;} .port-select{max-width:100%;} .port-btn{width:100%;} .port-country-dir{padding:14px 12px;} .port-country-group{flex-direction:column;gap:4px;} .port-country-letter{text-align:left;} .port-country-entry{flex-direction:column;align-items:flex-start;} .port-country-alpha{gap:3px;} }

