:root {
    --brand: #2196f3;
    --brand-dark: #1769aa;
    --text: #222222;
    --muted: #6b7280;
    --line: #e3e8ef;
    --soft: #ffffff;
    --bg: #ffffff;
    --danger: #dc2626;
    --success: #047857;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
}

.account-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html.account-preparing .account-shell {
    visibility: hidden;
}

.account-loading {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: #ffffff;
}

.account-loading[hidden] {
    display: none;
}

.account-loading-card {
    min-width: 140px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.account-topbar {
    height: 70px;
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.brand-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.brand-link img {
    width: 26px;
    height: 26px;
    border-radius: 5px;
}

.account-topbar h1 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    text-align: center;
}

.back-link {
    justify-self: end;
    min-width: 92px;
    height: 36px;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--brand);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand);
    font-size: 14px;
}

.account-layout {
    width: min(1180px, 100%);
    flex: 1;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    margin: 0 auto;
    padding: 22px 18px;
}

.account-nav,
.account-content,
.panel {
    min-width: 0;
}

.account-nav {
    align-self: start;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.nav-item {
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: transparent;
    color: #344054;
    text-align: left;
}

.nav-item.active,
.nav-item:hover {
    background: var(--soft);
    color: var(--brand-dark);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}

html[data-initial-view="password"] .nav-item.active,
html[data-initial-view="payments"] .nav-item.active,
html[data-initial-view="logins"] .nav-item.active,
html[data-initial-view="shares"] .nav-item.active {
    background: transparent;
    color: #344054;
    font-weight: 400;
    box-shadow: none;
}

html[data-initial-view="password"] .nav-item[data-view="password"],
html[data-initial-view="payments"] .nav-item[data-view="payments"],
html[data-initial-view="logins"] .nav-item[data-view="logins"],
html[data-initial-view="shares"] .nav-item[data-view="shares"] {
    background: var(--soft);
    color: var(--brand-dark);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}

.account-content {
    position: relative;
}

.notice {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d6e7f7;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 14px;
}

.notice.error {
    background: #fff1f2;
    color: var(--danger);
}

.notice.success {
    background: #ecfdf5;
    color: var(--success);
}

.panel {
    display: none;
    min-height: 560px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.panel.active {
    display: block;
}

html[data-initial-view="password"] .panel.active,
html[data-initial-view="payments"] .panel.active,
html[data-initial-view="logins"] .panel.active,
html[data-initial-view="shares"] .panel.active {
    display: none;
}

html[data-initial-view="password"] .panel[data-panel="password"],
html[data-initial-view="payments"] .panel[data-panel="payments"],
html[data-initial-view="logins"] .panel[data-panel="logins"],
html[data-initial-view="shares"] .panel[data-panel="shares"] {
    display: block;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.profile-name {
    color: #111827;
    font-size: 20px;
    font-weight: 700;
}

.profile-email {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.info-grid .info-card {
    position: relative;
    min-height: 80px;
    padding: 14px;
    padding-right: 130px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.info-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.info-grid strong {
    display: block;
    margin-top: 8px;
    color: #111827;
    font-size: 18px;
}

.info-action {
    position: absolute;
    right: 14px;
    top: 50%;
    min-width: 96px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--brand);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.info-action.is-renew {
    background: linear-gradient(135deg, #f9df92 0%, #e0b34f 55%, #c48a1e 100%);
    color: #5b3a00;
}

.form-card {
    display: grid;
    gap: 14px;
    max-width: 560px;
}

.form-card label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.form-card input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 0 12px;
    outline: none;
    background: #ffffff;
    color: var(--text);
}

.form-card input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(29, 155, 240, .12);
}

.form-card input:disabled {
    background: #f8fafc;
    color: var(--muted);
}

.form-card > button,
.inline-field button,
.ghost-button,
.record-actions button,
.record-actions a,
.pager button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    text-decoration: none;
}

.form-card > button,
.inline-field button {
    background: var(--brand);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(33, 150, 243, .18);
}

.form-card > button {
    width: 140px;
}

.inline-field {
    display: grid;
    grid-template-columns: 1fr 112px;
    gap: 8px;
}

.inline-field button:disabled,
.form-card > button:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.table-head h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
}

.table-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ghost-button,
.pager button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--brand);
    padding: 0 16px;
    min-width: 72px;
}

.refresh-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
    color: var(--brand);
}

.refresh-button svg {
    width: 19px;
    height: 19px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.record-list {
    display: grid;
    gap: 10px;
}

.record-card {
    display: grid;
    gap: 9px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.record-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.record-title {
    color: #111827;
    font-weight: 700;
}

.record-meta,
.record-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.status {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid #d6e7f7;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 600;
}

.status.paid {
    background: #ecfdf5;
    color: var(--success);
}

.status.failed {
    background: #fff1f2;
    color: var(--danger);
}

.record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.record-actions button,
.record-actions a {
    min-width: 78px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 13px;
}

.record-actions .danger {
    color: var(--danger);
}

.empty {
    padding: 42px 12px;
    color: var(--muted);
    text-align: center;
}

.pay-modal[hidden] {
    display: none !important;
}

.pay-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .38);
}

.pay-card {
    width: min(520px, 100%);
    max-height: min(680px, 90vh);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 52px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.pay-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
}

.pay-head strong {
    display: block;
    color: #111827;
    font-size: 18px;
}

.pay-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.pay-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: transparent;
    color: #374151;
    font-size: 22px;
    line-height: 1;
}

.pay-body {
    padding: 16px 18px;
    overflow: auto;
}

.pay-section-title {
    margin: 0 0 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.fee-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.fee-card {
    position: relative;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    text-align: left;
}

.fee-card.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.fee-card.recommended::after {
    content: "推荐";
    position: absolute;
    top: -8px;
    right: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ff3b65;
    color: #ffffff;
    font-size: 11px;
}

.fee-name {
    font-weight: 600;
}

.fee-price {
    color: var(--brand-dark);
    font-size: 22px;
    font-weight: 700;
}

.fee-price span {
    font-size: 12px;
    font-weight: 500;
}

.fee-save {
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
}

.fee-save s {
    margin-right: 5px;
}

.pay-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pay-method {
    width: auto;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: #374151;
}

.pay-method.active {
    border-color: var(--brand);
    background: #ffffff;
    color: var(--brand-dark);
}

.pay-method img {
    height: 30px;
    max-width: 132px;
    object-fit: contain;
}

.pay-message {
    min-height: 22px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.pay-message.error {
    color: var(--danger);
}

.pay-message.success {
    color: var(--success);
}

.pay-foot {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
}

.pay-submit {
    width: 100%;
    height: 44px;
    border-radius: 18px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 600;
}

.pay-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.pay-loading {
    grid-column: 1 / -1;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.pager button {
    min-width: 86px;
}

.pager button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .account-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        height: auto;
        gap: 10px;
        padding: 12px 14px;
    }

    .account-topbar h1 {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
    }

    .account-layout {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .account-nav {
        grid-template-columns: repeat(5, max-content);
        overflow-x: auto;
        padding: 8px;
    }

    .nav-item {
        white-space: nowrap;
    }

    .panel {
        min-height: 0;
        padding: 14px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-grid .info-card {
        padding-right: 118px;
    }

    .pay-card {
        width: min(100%, 520px);
    }

    .fee-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .record-main,
    .table-head {
        display: grid;
    }

    .profile-head {
        align-items: flex-start;
    }

    .profile-name,
    .profile-email,
    .record-title,
    .record-meta,
    .record-sub {
        overflow-wrap: anywhere;
    }

    .form-card {
        max-width: none;
    }

    input,
    button {
        font-size: 16px;
    }

    .form-card > button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .account-topbar {
        grid-template-columns: 1fr;
    }

    .back-link {
        justify-self: start;
    }

    .inline-field {
        grid-template-columns: 1fr;
    }

    .pay-modal {
        padding: 10px;
    }

    .pay-head,
    .pay-body,
    .pay-foot {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pay-methods {
        grid-template-columns: 1fr;
    }

    .pager {
        justify-content: space-between;
    }

    .pager button {
        min-width: 78px;
    }
}
