:root {
    color-scheme: light;
    --canvas: #f4f6f5;
    --surface: #ffffff;
    --surface-muted: #eef1ef;
    --ink: #18211f;
    --ink-muted: #5f6b67;
    --line: #d9dfdc;
    --line-strong: #b7c1bd;
    --teal: #086f65;
    --teal-dark: #05574f;
    --teal-soft: #e4f2ef;
    --amber: #a55c00;
    --amber-soft: #fff2dc;
    --danger: #a52e35;
    --danger-soft: #fbeaec;
    --success: #1c7049;
    --success-soft: #e5f3eb;
    --focus: #1267b2;
    --shadow: 0 16px 40px rgba(25, 43, 38, 0.09);
    font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(18, 103, 178, 0.34);
    outline-offset: 2px;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background-color: #e9eeeb;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1fr);
    width: min(760px, 100%);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-brand {
    min-height: 390px;
    padding: 44px 40px;
    color: #f5fbf8;
    background: #173934;
    border-right: 6px solid #d99525;
}

.brand-mark,
.wordmark__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-family: Consolas, "Courier New", monospace;
    font-weight: 700;
    line-height: 1;
}

.brand-name {
    margin: 74px 0 4px;
    color: #acd0c8;
    font-weight: 700;
}

.auth-brand h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.25;
}

.auth-context {
    margin: 16px 0 0;
    color: #c8d9d5;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    min-width: 0;
    padding: 48px;
}

.form-stack,
.publication-form {
    display: grid;
    gap: 24px;
}

.field-group {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.field-group label,
.field-label-row label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.field-label-row > span {
    color: var(--ink-muted);
    font-size: 12px;
}

.text-input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.text-input:hover {
    border-color: #86948f;
}

.text-input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(18, 103, 178, 0.14);
    outline: none;
}

.text-input--numeric {
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
}

.text-input--invalid {
    border-color: var(--danger);
    background: #fffafb;
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 13px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button--primary {
    color: #ffffff;
    background: var(--teal);
    border-color: var(--teal);
}

.button--primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
}

.button--danger {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.button--danger:hover {
    background: #84252c;
    border-color: #84252c;
}

.button--secondary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}

.button--secondary:hover,
.button--quiet:hover {
    background: var(--surface-muted);
    border-color: #9da9a5;
}

.button--quiet {
    min-height: 38px;
    padding: 7px 13px;
    color: var(--ink-muted);
    background: transparent;
    border-color: var(--line);
}

.button--full {
    width: 100%;
}

.button[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.app-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(1040px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
}

.wordmark__mark {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-color: var(--teal);
    color: var(--teal);
    font-size: 13px;
}

.wordmark > span:last-child {
    display: grid;
    line-height: 1.2;
}

.wordmark strong {
    font-size: 16px;
}

.wordmark small {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 11px;
}

.page-main {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 56px 0 80px;
}

.page-main--narrow {
    width: min(720px, calc(100% - 40px));
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
}

.page-heading h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.25;
}

.environment-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink-muted);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
}

.environment-badge > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.notice {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 5px;
    font-size: 13px;
}

.notice > div,
.notice:not(.notice--wide) {
    flex-direction: column;
}

.notice strong {
    display: block;
    font-size: 14px;
}

.notice--success {
    color: #175f3f;
    background: var(--success-soft);
    border-color: #b5d9c6;
}

.notice--error {
    color: #84252c;
    background: var(--danger-soft);
    border-color: #e6b8bd;
}

.notice--wide {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(300px, 1.3fr);
    gap: 24px;
    margin-bottom: 18px;
    padding: 18px 20px;
}

.notice--error.notice--wide {
    grid-template-columns: 1fr;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.account-directory {
    margin-top: 28px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface);
}

.account-directory .workspace__intro {
    border-right: 0;
    border-bottom: 1px solid var(--line);
}

.directory-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.directory-search .text-input {
    min-height: 42px;
}

.account-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.account-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: fixed;
}

.account-table th,
.account-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.account-table th {
    color: var(--ink-muted);
    background: #f8faf9;
    font-size: 12px;
    font-weight: 800;
}

.account-table th:first-child {
    width: 34%;
}

.account-table th:nth-child(2) {
    width: 28%;
}

.account-table th:nth-child(3) {
    width: 16%;
}

.account-table th:last-child {
    width: 22%;
}

.account-table tbody tr:last-child td {
    border-bottom: 0;
}

.account-table td strong,
.account-table td small {
    display: block;
    overflow-wrap: anywhere;
}

.account-table td small {
    margin-top: 3px;
    color: var(--ink-muted);
    font-size: 12px;
}

.account-id {
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
}

.account-action {
    text-align: right !important;
}

.account-action form {
    display: inline-flex;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
}

.status-badge--visible {
    color: var(--success);
    background: var(--success-soft);
    border-color: #b5d9c6;
}

.status-badge--hidden {
    color: var(--ink-muted);
    background: var(--surface-muted);
    border-color: var(--line-strong);
}

.empty-state {
    margin: 0;
    padding: 34px 24px;
    color: var(--ink-muted);
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}

.pagination span {
    color: var(--ink-muted);
    font-size: 13px;
}

.result-summary div {
    min-width: 0;
}

.result-summary dt,
.confirmation-data dt {
    color: currentColor;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.72;
}

.result-summary dd,
.confirmation-data dd {
    overflow-wrap: anywhere;
    margin: 3px 0 0;
    font-weight: 700;
}

.result-summary div:first-child dd,
.confirmation-data div:first-child dd {
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
}

.workspace,
.confirmation {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(25, 43, 38, 0.06);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1.28fr);
    margin-top: 28px;
}

.workspace__intro {
    display: flex;
    gap: 16px;
    padding: 32px;
    border-right: 1px solid var(--line);
    background: #f8faf9;
}

.workspace__intro h2,
.confirmation h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.35;
}

.workspace__intro p,
.confirmation p {
    margin: 8px 0 0;
    color: var(--ink-muted);
    font-size: 13px;
}

.section-number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid #b9d7d1;
    border-radius: 4px;
    color: var(--teal);
    background: var(--teal-soft);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
}

.publication-form {
    padding: 32px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.confirmation {
    overflow: hidden;
}

.confirmation__header {
    display: flex;
    gap: 16px;
    padding: 28px 30px;
    border-bottom: 1px solid var(--line);
    background: var(--amber-soft);
}

.confirmation-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid #d8a24e;
    border-radius: 50%;
    color: var(--amber);
    font-family: Georgia, serif;
    font-weight: 800;
}

.confirmation-data {
    display: grid;
    margin: 0;
    padding: 6px 30px;
}

.confirmation-data > div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.confirmation-data > div:last-child {
    border-bottom: 0;
}

.confirmation-data dt {
    color: var(--ink-muted);
    opacity: 1;
}

.confirmation-data dd {
    margin: 0;
    font-size: 16px;
}

.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 22px 30px;
    border-top: 1px solid var(--line);
    background: #f8faf9;
}

.visibility-action {
    display: flex;
    justify-content: flex-end;
    padding: 18px 30px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

@media (max-width: 720px) {
    .auth-page {
        align-items: start;
        padding: 18px 14px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 0;
        padding: 24px;
        border-right: 0;
        border-bottom: 5px solid #d99525;
    }

    .brand-name {
        margin-top: 34px;
    }

    .auth-brand h1 {
        font-size: 27px;
    }

    .auth-panel {
        padding: 30px 24px 34px;
    }

    .app-header__inner,
    .page-main,
    .page-main--narrow {
        width: min(100% - 28px, 920px);
    }

    .page-main {
        padding: 38px 0 56px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .page-heading h1 {
        font-size: 26px;
    }

    .notice--wide,
    .workspace {
        grid-template-columns: 1fr;
    }

    .notice--wide {
        gap: 14px;
    }

    .result-summary {
        grid-template-columns: 1fr 1fr;
    }

    .workspace__intro {
        padding: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .publication-form {
        padding: 24px;
    }

    .directory-search {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .directory-search .button--quiet {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .confirmation__header,
    .confirmation-actions {
        padding: 22px;
    }

    .confirmation-data {
        padding: 4px 22px;
    }

    .confirmation-data > div {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 18px 0;
    }
}

@media (max-width: 440px) {
    .app-header__inner {
        min-height: 66px;
    }

    .wordmark small {
        display: none;
    }

    .page-heading {
        display: grid;
        gap: 14px;
    }

    .environment-badge {
        justify-self: start;
    }

    .result-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .confirmation-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .directory-search {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .directory-search .button,
    .visibility-action .button {
        width: 100%;
    }

    .pagination {
        justify-content: space-between;
        padding: 14px 18px;
    }

    .visibility-action {
        padding: 18px 22px;
    }

    .confirmation-actions .button,
    .form-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
