*,*::before,*::after{box-sizing:border-box;}
*{margin:0;padding:0;}

:root{
    --bg:#faf9f7;
    --bg-soft:#f5f1ec;
    --surface:#ffffff;
    --surface-subtle:#f7f4ef;
    --text:#1a1a1a;
    --muted:#6f6a64;
    --faint:#a39b93;
    --line:#e5ded6;
    --line-strong:#d8cec4;
    --primary:#cc785c;
    --primary-soft:#f8ebe5;
    --success:#567c65;
    --success-soft:#edf5ef;
    --warning:#b87545;
    --danger:#c43d3d;
    --radius:8px;
    --shadow:0 1px 2px rgba(42,32,24,.04),0 8px 22px rgba(42,32,24,.05);
}

html{min-height:100%;}
body{
    min-height:100vh;
    background:var(--bg);
    color:var(--text);
    display:flex;
    flex-direction:column;
    font-family:"Microsoft YaHei","PingFang SC","Hiragino Sans GB","Noto Sans SC",Arial,sans-serif;
    line-height:1.45;
    text-rendering:optimizeLegibility;
}

body::before{
    content:"";
    position:fixed;
    inset:0 0 auto 0;
    height:220px;
    background:linear-gradient(180deg,#f2ebe3 0%,rgba(250,249,247,0) 100%);
    pointer-events:none;
    z-index:-1;
}

.page-header{
    max-width:1440px;
    width:100%;
    margin:0 auto;
    padding:28px 18px 16px;
    flex-shrink:0;
}

.page-header h1{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:var(--text);
    font-size:28px;
    font-weight:700;
    letter-spacing:0;
    text-align:center;
}

.header-logo{
    width:auto;
    height:34px;
    flex-shrink:0;
}

.page-header .subtitle{
    margin-top:6px;
    color:var(--muted);
    font-size:13px;
    text-align:center;
}

.search-bar{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    max-width:1440px;
    width:100%;
    margin:0 auto 18px;
    padding:0 18px;
    flex-shrink:0;
}

.search-half{min-width:0;display:flex;}
.search-form{
    width:100%;
    min-width:0;
    display:flex;
    align-items:stretch;
    position:relative;
}

.search-bar input,
.search-bar .doubao-entry{
    width:100%;
    min-height:42px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
    color:var(--text);
    font-size:14px;
    outline:none;
    transition:border-color .15s,background-color .15s,box-shadow .15s;
}

.search-bar input{
    padding:10px 14px 10px 46px;
    height:100%;
    box-sizing:border-box;
}

.search-bar input::placeholder{color:var(--faint);}
.search-bar input:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(204,120,92,.16);
}

.search-bar .doubao-entry{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:10px 14px;
    color:#3f3934;
    text-decoration:none;
    background:#fff;
}

.search-bar .doubao-entry:hover{
    border-color:#d5ad9d;
    background:var(--primary-soft);
}

.search-brand-icon{
    width:28px;
    height:28px;
    flex:0 0 28px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.search-brand-icon img{
    width:28px;
    height:28px;
    display:block;
    object-fit:contain;
}

.search-form .search-brand-icon{
    position:absolute;
    left:13px;
    top:50%;
    transform:translateY(-50%);
    z-index:1;
    pointer-events:none;
}

.baidu-brand img{border-radius:5px;}
.doubao-brand img{border-radius:50%;}

.sections-container{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    max-width:1440px;
    width:100%;
    margin:0 auto;
    padding:0 18px 8px;
    flex:1;
}

.load-error{
    grid-column:1/-1;
    min-height:160px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:28px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:var(--surface);
    color:var(--muted);
    text-align:center;
}

.load-error strong{color:var(--danger);font-size:16px;}
.load-error span{font-size:13px;}

.category{
    min-width:0;
    height:100%;
    display:flex;
    flex-direction:column;
    padding:14px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
    box-shadow:var(--shadow);
}

.category:hover{
    border-color:#d9c7ba;
}

.category-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:start;
    padding-bottom:10px;
    margin-bottom:10px;
    border-bottom:1px solid var(--line);
}

.header-left{
    min-width:0;
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.category-header h2{
    min-width:0;
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:var(--text);
    font-size:15px;
    font-weight:700;
    letter-spacing:0;
    cursor:pointer;
    user-select:none;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.category-header h2:hover{color:var(--primary);}

.collapse-mark{
    color:#8f867d;
    font-size:10px;
    transform:translateY(-1px);
}

.category-icon{
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #d8cfc4;
    border-radius:6px;
    background:#f8f4ed;
    color:var(--icon-ink,#332b25);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75),0 1px 2px rgba(42,32,24,.06);
    position:relative;
    overflow:hidden;
}

.category-icon::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:3px;
    border-radius:6px 0 0 6px;
    background:var(--icon-accent,#7a1f1f);
    opacity:.88;
    pointer-events:none;
}

.category-icon svg{
    width:21px;
    height:21px;
    display:block;
    position:relative;
    z-index:1;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.category-icon .icon-fill-soft{
    fill:var(--icon-accent,#7a1f1f);
    opacity:.12;
    stroke:none;
}

.category-icon .icon-accent{
    stroke:var(--icon-accent,#7a1f1f);
}

.category-icon .icon-accent-fill{
    fill:var(--icon-accent,#7a1f1f);
    stroke:none;
}

.category-title-text{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
}

.icon-classification{--icon-ink:#342a24;--icon-accent:#7f1d1d;background:#f8f4ed;}
.icon-energy-efficiency{--icon-ink:#343229;--icon-accent:#6f7356;background:#f7f3ea;}
.icon-maritime-admin{--icon-ink:#2f3431;--icon-accent:#6b746f;background:#f6f2ea;}
.icon-email-internal{--icon-ink:#3a2d24;--icon-accent:#9a5d35;background:#f9f3eb;}
.icon-flag-states{--icon-ink:#332d29;--icon-accent:#8b6f5a;background:#f7f2eb;}
.icon-ship-monitoring{--icon-ink:#2b3433;--icon-accent:#6b8a86;background:#f5f2eb;}
.icon-data-platforms{--icon-ink:#372e22;--icon-accent:#9b7a3c;background:#f8f2e7;}
.icon-crew-labor{--icon-ink:#352b2a;--icon-accent:#8b5f61;background:#f8f1ec;}

.last-check{
    color:var(--faint);
    font-size:11px;
    white-space:nowrap;
}

.placeholder-badge{
    display:inline-flex;
    align-items:center;
    min-height:18px;
    padding:2px 7px;
    border:1px solid #f1d39c;
    border-radius:999px;
    background:#fff8eb;
    color:var(--warning);
    font-size:11px;
}

.section-toolbar{
    display:flex;
    justify-content:flex-end;
    gap:6px;
    flex-wrap:wrap;
}

.section-toolbar button,
.pwd-save-btn{
    min-height:28px;
    border:1px solid var(--line-strong);
    border-radius:6px;
    background:#fff;
    color:#3f3934;
    cursor:pointer;
    font-size:12px;
    line-height:1;
    white-space:nowrap;
    transition:background-color .15s,border-color .15s,color .15s;
}

.section-toolbar button{padding:6px 9px;}
.section-toolbar button:hover{
    border-color:#d0b8a9;
    background:var(--surface-subtle);
}

.section-toolbar .check-btn{
    border-color:#c9d7c7;
    color:var(--success);
    background:var(--success-soft);
}

.section-toolbar .check-btn:hover{
    border-color:var(--success);
    background:#e2f0e5;
}

.section-toolbar .check-btn:disabled{
    opacity:.6;
    cursor:not-allowed;
}

.section-toolbar .pwd-btn.active{
    border-color:#1a1a1a;
    background:#1a1a1a;
    color:#fff;
}

.links{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}

.link-wrap{
    min-width:0;
    min-height:38px;
    display:grid;
    grid-template-columns:16px minmax(0,1fr) auto;
    align-items:stretch;
    border:1px solid transparent;
    border-radius:7px;
    background:var(--surface-subtle);
    overflow:hidden;
    transition:background-color .15s,border-color .15s;
}

.link-wrap:hover{
    border-color:#d8cfc6;
    background:#f4efe9;
}

.link-wrap a{
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:8px 6px;
    color:#27231f;
    text-align:center;
    text-decoration:none;
    font-size:12px;
    line-height:1.35;
    word-break:break-word;
}

.link-wrap a:hover{color:var(--primary);}
.link-wrap a:focus-visible,
.copy-btn:focus-visible,
.section-toolbar button:focus-visible,
.pwd-save-btn:focus-visible{
    outline:2px solid rgba(204,120,92,.42);
    outline-offset:2px;
}

.link-wrap.unreachable{opacity:.58;}
.link-wrap.unreachable a{
    color:#7a8793;
    text-decoration:line-through;
}
.link-wrap.na{opacity:.5;}

.copy-btn{
    width:30px;
    border:0;
    border-left:1px solid rgba(203,213,225,.9);
    background:#eee8e1;
    color:#5d5249;
    cursor:pointer;
    font-size:13px;
    transition:background-color .15s,color .15s;
}

.copy-btn:hover{
    background:#eadad1;
    color:#3f2f28;
}

.copy-btn.has-pwd{
    background:#dff1e8;
    color:var(--success);
}

.copy-btn.has-pwd:hover{
    background:#c9e8d9;
}

.status-dot{
    width:8px;
    height:8px;
    min-width:8px;
    margin:auto 3px auto 5px;
    border-radius:50%;
    background:#b8c2cc;
    cursor:pointer;
    position:relative;
    transition:transform .15s,background-color .15s;
}

.status-dot:hover{transform:scale(1.35);}
.status-dot.unknown{background:#aab4bf;}
.status-dot.checking{background:#d99a22;}
.status-dot.reachable{background:var(--success);}
.status-dot.unreachable{background:var(--danger);}
.status-dot.na{background:#cbd3dc;cursor:default;}
.status-dot.na:hover{transform:none;}

.status-dot[title]:hover::after{
    content:attr(title);
    position:absolute;
    left:50%;
    bottom:150%;
    z-index:20;
    transform:translateX(-50%);
    padding:4px 7px;
    border-radius:5px;
    background:#1a1a1a;
    color:#fff;
    font-size:11px;
    font-weight:400;
    line-height:1;
    white-space:nowrap;
    pointer-events:none;
}

.pwd-panel{
    display:none;
    margin-bottom:10px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#faf7f3;
}

.pwd-panel.show{display:block;}
.pwd-panel h4{
    margin-bottom:8px;
    color:#6f6a64;
    font-size:12px;
    font-weight:600;
}

.pwd-row{
    display:grid;
    grid-template-columns:minmax(86px,.8fr) minmax(0,1fr) minmax(0,1fr) 28px;
    gap:6px;
    align-items:center;
    margin-bottom:6px;
}

.pwd-row label{
    min-width:0;
    color:#6f6a64;
    font-size:12px;
    overflow:hidden;
    text-align:right;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.pwd-row input{
    min-width:0;
    height:30px;
    padding:5px 7px;
    border:1px solid var(--line);
    border-radius:6px;
    background:#fff;
    color:var(--text);
    font-size:12px;
    outline:none;
}

.pwd-row input:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 2px rgba(204,120,92,.13);
}

.pwd-row button.toggle-vis{
    height:28px;
    border:1px solid transparent;
    border-radius:6px;
    background:transparent;
    cursor:pointer;
    font-size:14px;
}

.pwd-row button.toggle-vis:hover{background:#f1ece6;}

.pwd-save-btn{
    padding:7px 14px;
    border-color:var(--primary);
    background:var(--primary);
    color:#fff;
}

.pwd-save-btn:hover{background:#a95d43;}

.toast{
    position:fixed;
    top:18px;
    left:50%;
    z-index:999;
    max-width:min(620px,calc(100vw - 28px));
    padding:10px 18px;
    border-radius:7px;
    box-shadow:0 10px 28px rgba(16,24,40,.16);
    color:#fff;
    font-size:14px;
    opacity:0;
    pointer-events:none;
    transform:translateX(-50%);
    transition:opacity .2s;
}

.toast.show{opacity:1;}

.page-footer{
    flex-shrink:0;
    margin-top:16px;
    padding:18px 16px 16px;
    color:#8a96a3;
    font-size:11px;
    text-align:center;
}

.page-footer a{
    color:inherit;
    text-decoration:none;
}

.page-footer a:hover{
    color:var(--primary);
    text-decoration:underline;
}

.footer-sep{
    margin:0 6px;
    color:var(--faint);
}

@media (prefers-reduced-motion: reduce){
    *,*::before,*::after{
        animation-duration:.01ms!important;
        animation-iteration-count:1!important;
        scroll-behavior:auto!important;
        transition-duration:.01ms!important;
    }
}

@media (prefers-color-scheme: dark){
    :root{
        --bg:#101820;
        --bg-soft:#141f29;
        --surface:#172330;
        --surface-subtle:#1d2b38;
        --text:#e5edf5;
        --muted:#a6b2bf;
        --faint:#7f8b98;
        --line:#2a3a49;
        --line-strong:#3a4c5d;
        --primary:#7fb3d5;
        --primary-soft:#203849;
        --success:#66c596;
        --success-soft:#1c3429;
        --shadow:0 1px 2px rgba(0,0,0,.22);
    }
    body::before{background:linear-gradient(180deg,#182838 0%,rgba(24,40,56,0) 100%);}
    .page-header h1{color:#edf4fa;}
    .category{background:#172330;border-color:#293948;}
    .category-header h2{color:#ecf3f8;}
    .collapse-mark{color:#93a4b3;}
    .category-icon{border-color:rgba(255,255,255,.16);box-shadow:none;}
    .search-bar input,.search-bar .doubao-entry{background:#172330;border-color:#2b3b4a;color:var(--text);}
    .search-bar .doubao-entry:hover,.link-wrap:hover{background:#223442;}
    .link-wrap a{color:#edf4fa;}
    .copy-btn{background:#243746;color:#cbd8e3;}
    .pwd-panel{background:#14202b;}
    .pwd-row input{background:#101820;color:var(--text);}
    .placeholder-badge{background:#2d2514;border-color:#70531c;color:#f0c36a;}
}

@media (max-width:1180px){
    .sections-container{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
}

@media (max-width:760px){
    .page-header{padding:22px 12px 14px;}
    .page-header h1{font-size:22px;}
    .header-logo{height:28px;}
    .search-bar{
        grid-template-columns:1fr;
        padding:0 12px;
        margin-bottom:14px;
    }
    .sections-container{
        grid-template-columns:1fr;
        gap:12px;
        padding:0 12px 8px;
    }
    .category{padding:12px;}
    .category-header{
        grid-template-columns:1fr;
        gap:8px;
    }
    .section-toolbar{justify-content:flex-start;}
    .links{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
    .link-wrap a{font-size:11px;padding:7px 5px;}
    .category-icon{width:28px;height:28px;flex-basis:28px;}
    .category-icon svg{width:20px;height:20px;}
    .pwd-row{grid-template-columns:1fr;}
    .pwd-row label{text-align:left;}
    .pwd-row button.toggle-vis{width:36px;}
}

@media (max-width:430px){
    .links{grid-template-columns:1fr;}
    .page-header h1{font-size:20px;}
}
