:root {
    --portal-bg: #f2f1ec;
    --portal-surface: #ffffff;
    --portal-text: #17211d;
    --portal-muted: #6f7974;
    --portal-line: #dfe2dc;
    --portal-accent: #176b52;
    --portal-accent-dark: #105641;
    --portal-accent-soft: #e5f1ec;
    --portal-danger: #b84747;
    --portal-danger-soft: #fff2f1;
    --portal-success: #237a58;
    --portal-success-soft: #edf8f2;
    --portal-shadow: 0 24px 70px rgba(31, 47, 40, .1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--portal-bg); }
body, button, input { font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.portal-page {
    min-height: 100vh;
    color: var(--portal-text);
    background:
        linear-gradient(90deg, rgba(25, 60, 48, .025) 1px, transparent 1px),
        linear-gradient(rgba(25, 60, 48, .025) 1px, transparent 1px),
        var(--portal-bg);
    background-size: 48px 48px;
}

.portal-shell {
    width: min(calc(100% - 48px), 1120px);
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.portal-header {
    min-height: 82px;
    border-bottom: 1px solid rgba(128, 142, 135, .25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.portal-brand { display: inline-flex; align-items: center; gap: 12px; }
.portal-logo {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    background: var(--portal-accent);
    box-shadow: 0 10px 24px rgba(23, 107, 82, .2);
}
.portal-logo::before {
    position: absolute;
    inset: 9px 11px 10px;
    border: 2px solid #fff;
    border-radius: 10px 10px 12px 12px;
    content: "";
    clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%);
}
.portal-logo i {
    position: absolute;
    top: 17px;
    left: 16px;
    width: 9px;
    height: 5px;
    border-bottom: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(-45deg);
}
.portal-brand-copy strong, .portal-brand-copy small { display: block; }
.portal-brand-copy strong { font-size: 15px; letter-spacing: .02em; }
.portal-brand-copy small {
    margin-top: 2px;
    color: #87918c;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.portal-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(128, 142, 135, .25);
    border-radius: 12px;
    background: rgba(255, 255, 255, .46);
}
.portal-nav a {
    padding: 8px 13px;
    border-radius: 8px;
    color: #69736e;
    font-size: 12px;
    font-weight: 650;
    transition: color .18s ease, background .18s ease;
}
.portal-nav a:hover { color: var(--portal-accent); }
.portal-nav a.active { color: #fff; background: var(--portal-accent); }

.portal-main { flex: 1; }
.authorization-main { padding: clamp(58px, 9vh, 96px) 0 54px; }
.authorization-layout {
    display: grid;
    grid-template-columns: minmax(0, .84fr) minmax(480px, 1.16fr);
    align-items: center;
    gap: clamp(48px, 8vw, 96px);
}

.portal-status, .portal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--portal-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}
.portal-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2d9470;
    box-shadow: 0 0 0 5px rgba(45, 148, 112, .11);
}
.authorization-intro h1 {
    margin: 21px 0 17px;
    font-size: clamp(40px, 5.2vw, 64px);
    line-height: 1.04;
    letter-spacing: -.06em;
}
.authorization-intro h1 span { color: var(--portal-accent); }
.authorization-intro > p:not(.portal-status) {
    max-width: 450px;
    margin: 0;
    color: var(--portal-muted);
    font-size: 15px;
    line-height: 1.8;
}
.authorization-meta {
    margin: 31px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.authorization-meta li {
    padding: 7px 10px;
    border: 1px solid rgba(107, 125, 116, .2);
    border-radius: 8px;
    color: #68736e;
    background: rgba(255, 255, 255, .4);
    font-size: 11px;
}

.portal-card {
    border: 1px solid rgba(134, 149, 141, .28);
    border-radius: 20px;
    background: rgba(255, 255, 255, .91);
    box-shadow: var(--portal-shadow);
}
.authorization-query-card { padding: 30px; }
.card-heading {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.card-heading small {
    display: block;
    color: var(--portal-accent);
    font: 700 10px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .12em;
}
.card-heading h2 { margin: 7px 0 6px; font-size: 22px; letter-spacing: -.025em; }
.card-heading p { margin: 0; color: #828c87; font-size: 12px; line-height: 1.6; }
.card-index { color: #d8dedb; font: 700 28px/1 "SFMono-Regular", Consolas, monospace; }

.lookup-form { display: grid; gap: 10px; }
.lookup-form > label, .field-block label { color: #47524d; font-size: 12px; font-weight: 700; }
.domain-input-row {
    min-height: 56px;
    padding: 5px 5px 5px 15px;
    border: 1px solid #cfd7d3;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.domain-input-row:focus-within {
    border-color: #66a08e;
    box-shadow: 0 0 0 4px rgba(23, 107, 82, .09);
}
.domain-icon {
    position: relative;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin-right: 10px;
    border: 1.6px solid #7f8b85;
    border-radius: 50%;
}
.domain-icon::before, .domain-icon::after { position: absolute; content: ""; }
.domain-icon::before {
    inset: 2px 5px;
    border-right: 1px solid #7f8b85;
    border-left: 1px solid #7f8b85;
    border-radius: 50%;
}
.domain-icon::after { top: 7px; left: 1px; right: 1px; border-top: 1px solid #7f8b85; }
.domain-input-row input {
    min-width: 0;
    flex: 1;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--portal-text);
    background: transparent;
    font-size: 15px;
}
.domain-input-row input::placeholder, .field::placeholder { color: #a2aaa6; }

.btn {
    min-height: 42px;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}
.btn.primary { color: #fff; background: var(--portal-accent); }
.btn.primary:hover { background: var(--portal-accent-dark); }
.btn.soft { color: var(--portal-accent); background: var(--portal-accent-soft); }
.form-helper { margin: 0 2px; color: #909995; font-size: 11px; line-height: 1.6; }

.authorization-links {
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid #eceeea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #8a938f;
    font-size: 11px;
}
.authorization-links a { color: var(--portal-accent); font-weight: 700; }

.notice {
    padding: 13px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
}
.notice.error { color: #913d3d; border-color: #efcbca; background: var(--portal-danger-soft); }
.notice.success { color: #276d50; border-color: #cbe5d7; background: var(--portal-success-soft); }
.authorization-notice { margin-top: 15px; }

.authorization-result { margin-top: 15px; padding: 17px; border: 1px solid; border-radius: 12px; }
.authorization-result.is-valid { border-color: #c8e3d4; background: var(--portal-success-soft); }
.authorization-result.is-invalid { border-color: #efcecc; background: var(--portal-danger-soft); }
.authorization-result-head { display: flex; align-items: center; gap: 12px; }
.authorization-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}
.is-valid .authorization-icon { background: var(--portal-success); }
.is-invalid .authorization-icon { background: var(--portal-danger); }
.authorization-result-copy { min-width: 0; flex: 1; }
.authorization-result h2 { margin: 0 0 3px; font-size: 15px; }
.authorization-domain {
    margin: 0;
    overflow-wrap: anywhere;
    color: #68736e;
    font: 12px/1.5 "SFMono-Regular", Consolas, monospace;
}
.authorization-download {
    min-height: 35px;
    padding: 7px 12px;
    color: #21644f;
    background: #d9eee5;
    font-size: 11px;
}
.authorization-product-list {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(83, 127, 107, .16);
}
.authorization-product-list > p { margin: 0 0 7px; color: #71807a; font-size: 10px; }
.authorization-product-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}
.authorization-product-list li {
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.authorization-product-list strong { font-size: 12px; }
.authorization-product-list span { color: #73817b; font-size: 11px; white-space: nowrap; }
.authorization-result-help {
    margin: 11px 0 0 51px;
    color: #7d8682;
    font-size: 11px;
    line-height: 1.6;
}

.portal-service-row {
    margin-top: clamp(48px, 8vh, 82px);
    padding: 18px 0;
    border-top: 1px solid rgba(128, 142, 135, .22);
    border-bottom: 1px solid rgba(128, 142, 135, .22);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.portal-service-row div { padding: 0 24px; border-right: 1px solid rgba(128, 142, 135, .22); }
.portal-service-row div:first-child { padding-left: 0; }
.portal-service-row div:last-child { padding-right: 0; border-right: 0; }
.portal-service-row strong, .portal-service-row span { display: block; }
.portal-service-row strong { font-size: 12px; }
.portal-service-row span { margin-top: 4px; color: #89928e; font-size: 10px; line-height: 1.55; }

.download-main { width: min(100%, 920px); margin: 0 auto; padding: 54px 0; }
.download-intro { text-align: center; }
.portal-kicker {
    color: #7b8781;
    font: 700 10px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .13em;
}
.download-intro h1 {
    margin: 16px 0 12px;
    font-size: clamp(34px, 5vw, 48px);
    letter-spacing: -.05em;
}
.download-intro > p:not(.portal-kicker) {
    max-width: 620px;
    margin: 0 auto;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.75;
}
.download-process {
    margin: 29px auto 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.download-process div {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #929b97;
    font-size: 11px;
}
.download-process b {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #7f8984;
    background: #e2e4df;
    font-size: 9px;
}
.download-process .active, .download-process .done { color: #4d5953; }
.download-process .active b, .download-process .done b { color: #fff; background: var(--portal-accent); }
.download-process i { width: 32px; height: 1px; background: #cdd2cf; }
.portal-notice { margin: 24px auto 0; }

.download-auth-card { margin-top: 28px; padding: 28px; }
.download-auth-head {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ece8;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.download-auth-head span {
    color: var(--portal-accent);
    font: 700 9px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .12em;
}
.download-auth-head h2 { margin: 7px 0 5px; font-size: 20px; }
.download-auth-head p { margin: 0; color: #858f8a; font-size: 12px; line-height: 1.55; }
.download-lock {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--portal-accent);
    background: var(--portal-accent-soft);
    font-weight: 800;
}
.stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.field-block { display: grid; gap: 7px; }
.field {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cfd7d3;
    border-radius: 10px;
    outline: 0;
    color: var(--portal-text);
    background: #fff;
}
.field:focus { border-color: #66a08e; box-shadow: 0 0 0 4px rgba(23, 107, 82, .09); }
.field[readonly] { color: #68736e; background: #f4f5f2; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.code-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.portal-submit { width: 100%; min-height: 48px; }

.package-section { padding-top: 48px; }
.portal-section-title {
    margin-bottom: 17px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}
.portal-section-title span {
    color: var(--portal-accent);
    font: 700 9px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .12em;
}
.portal-section-title h2 { margin: 6px 0 0; font-size: 22px; }
.portal-section-title > p {
    max-width: 380px;
    margin: 0;
    color: #858f8a;
    font-size: 11px;
    line-height: 1.6;
    text-align: right;
}
.package-groups { display: grid; gap: 16px; }
.package-group {
    overflow: hidden;
    border: 1px solid rgba(134, 149, 141, .28);
    border-radius: 16px;
    background: rgba(255, 255, 255, .88);
}
.package-group-head {
    padding: 18px 20px;
    border-bottom: 1px solid #e9ece8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.package-group-head span {
    color: var(--portal-accent);
    font: 700 9px/1.2 "SFMono-Regular", Consolas, monospace;
}
.package-group-head h3 { margin: 5px 0; font-size: 16px; }
.package-group-head p { margin: 0; color: #89928e; font-size: 10px; }
.package-group-head > b {
    padding: 5px 9px;
    border-radius: 999px;
    color: #2b6c52;
    background: #e2f1ea;
    font-size: 9px;
}
.download-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.download-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid #e2e6e1;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.package-file-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--portal-accent);
    background: var(--portal-accent-soft);
    font-size: 11px;
    font-weight: 800;
}
.package-file-copy { min-width: 0; flex: 1; }
.package-file-copy strong, .package-file-copy span { display: block; }
.package-file-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.package-file-copy span { margin-top: 4px; color: #8a938f; font-size: 10px; }
.download-card .btn { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.empty {
    grid-column: 1 / -1;
    padding: 28px;
    color: #89928e;
    text-align: center;
    font-size: 12px;
}
.download-security {
    margin-top: 46px;
    padding-top: 24px;
    border-top: 1px solid rgba(128, 142, 135, .22);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.download-security div { display: flex; align-items: flex-start; gap: 9px; }
.download-security b {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--portal-accent);
    background: var(--portal-accent-soft);
    font-size: 9px;
}
.download-security strong, .download-security small { display: block; }
.download-security strong { font-size: 11px; }
.download-security small { margin-top: 4px; color: #8a938f; font-size: 9px; line-height: 1.55; }

.portal-footer {
    min-height: 76px;
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(128, 142, 135, .25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #8a938f;
    font-size: 10px;
}
.portal-footer p { margin: 0; }
.portal-footer div { display: flex; align-items: center; gap: 18px; }
.portal-footer a { color: #52625a; }

@media (max-width: 860px) {
    .authorization-layout { grid-template-columns: 1fr; gap: 34px; }
    .authorization-intro { max-width: 650px; margin: 0 auto; text-align: center; }
    .authorization-intro > p:not(.portal-status) { margin-inline: auto; }
    .authorization-meta { justify-content: center; }
    .authorization-query-card { width: min(100%, 620px); margin: 0 auto; }
}

@media (max-width: 680px) {
    .portal-shell { width: min(calc(100% - 28px), 1120px); }
    .portal-header { min-height: 70px; }
    .portal-brand-copy small { display: none; }
    .portal-nav a { padding: 7px 10px; font-size: 11px; }
    .authorization-main { padding: 46px 0 38px; }
    .authorization-intro h1 { font-size: 42px; }
    .authorization-query-card, .download-auth-card { padding: 21px 18px; border-radius: 15px; }
    .portal-service-row, .download-security { grid-template-columns: 1fr; gap: 0; }
    .portal-service-row div {
        padding: 12px 0;
        border-right: 0;
        border-bottom: 1px solid rgba(128, 142, 135, .2);
    }
    .portal-service-row div:last-child { border-bottom: 0; }
    .download-main { padding: 42px 0 38px; }
    .download-intro h1 { font-size: 34px; }
    .form-grid, .download-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .download-security div { padding: 11px 0; }
    .portal-section-title { align-items: flex-start; flex-direction: column; gap: 7px; }
    .portal-section-title > p { text-align: left; }
}

@media (max-width: 480px) {
    .portal-logo { width: 36px; height: 36px; flex-basis: 36px; }
    .portal-logo::before { inset: 8px 10px 9px; }
    .portal-logo i { top: 15px; left: 14px; }
    .portal-brand-copy strong { font-size: 13px; }
    .portal-nav { gap: 1px; padding: 3px; }
    .portal-nav a { padding-inline: 8px; font-size: 10px; }
    .authorization-intro h1 { font-size: 36px; }
    .authorization-meta { margin-top: 23px; }
    .card-heading { margin-bottom: 20px; }
    .domain-input-row { padding: 10px; flex-wrap: wrap; gap: 10px; }
    .domain-icon { margin-right: 0; }
    .domain-input-row input { width: calc(100% - 30px); flex-basis: calc(100% - 30px); }
    .domain-input-row .btn { width: 100%; }
    .authorization-result-head { align-items: flex-start; flex-wrap: wrap; }
    .authorization-download { width: 100%; }
    .authorization-result-help { margin-left: 0; }
    .authorization-product-list li { align-items: flex-start; flex-direction: column; gap: 3px; }
    .authorization-links { align-items: flex-start; flex-direction: column; gap: 5px; }
    .download-process { gap: 5px; }
    .download-process i { width: 14px; }
    .download-process div { gap: 5px; font-size: 9px; }
    .code-actions { grid-template-columns: 1fr; }
    .package-group-head { align-items: flex-start; }
    .download-card { align-items: stretch; flex-direction: column; }
    .portal-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
    .portal-footer div { align-items: flex-start; flex-direction: column; gap: 5px; }
}
