body {
    margin: 0;
    color: #172026;
    background: #f5f7f8;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: #0f3d4a;
}

.brand {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    color: #d9edf2;
    font-size: 14px;
}

.header-username {
    color: #d9edf2;
    font-weight: 700;
}

.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d9edf2;
    border-radius: 6px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
    text-decoration: none;
}

.header-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 24px auto;
}

.toolbar,
.auth-panel,
.job-list,
.article-item,
.detail {
    background: #fff;
    border: 1px solid #d9e1e5;
    border-radius: 8px;
    padding: 20px;
}

.auth-panel {
    width: min(420px, 100%);
    margin: 64px auto;
}

.auth-panel h1 {
    margin-top: 0;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form div {
    display: grid;
    gap: 6px;
}

.auth-form ul.errorlist {
    margin: 0;
    padding-left: 20px;
    color: #923232;
}

.settings-panel {
    display: grid;
    gap: 18px;
}

.setting-row {
    display: grid;
    gap: 8px;
}

.two-factor-setup {
    display: grid;
    gap: 14px;
}

.two-factor-qr {
    width: 220px;
    max-width: 100%;
    height: auto;
    border: 1px solid #c8d4d9;
    border-radius: 6px;
    background: #fff;
}

.manual-secret {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #c8d4d9;
    border-radius: 6px;
    background: #eef3f5;
    font-size: 14px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}

.search-form div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

input,
select,
button,
.button {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid #b9c6cc;
    font: inherit;
}

input,
select {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
    background: #fff;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #fff;
    background: #126d7f;
    border-color: #126d7f;
    text-decoration: none;
    cursor: pointer;
}

button:disabled,
button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.65;
}

.button-danger {
    background: #a23a3a;
    border-color: #a23a3a;
}

.article-list {
    margin-top: 24px;
}

.job-list {
    margin-top: 24px;
}

.job-list details {
    display: block;
}

.job-list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.job-list-summary::-webkit-details-marker {
    display: none;
}

.job-list-toggle {
    color: #126d7f;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
}

.job-list details[open] .job-list-toggle {
    font-size: 0;
}

.job-list details[open] .job-list-toggle::after {
    content: "非表示";
    font-size: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.section-heading h1 {
    margin: 0;
}

.button-secondary {
    color: #172026;
    background: #eef3f5;
    border-color: #c8d4d9;
}

.job-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
}

.job-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    border: 1px solid #c8d4d9;
}

.job-table th,
.job-table td {
    padding: 10px 8px;
    border: 1px solid #c8d4d9;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.job-table th {
    color: #53636b;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef3f5;
    color: #34444c;
}

.status-queued {
    background: #eef3f5;
    color: #34444c;
}

.status-processing {
    background: #e4f4fa;
    color: #0f6271;
}

.status-completed {
    background: #e7f5ee;
    color: #286344;
}

.status-failed {
    background: #fdeaea;
    color: #923232;
}

.job-error {
    color: #923232;
}

.article-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    margin-top: 12px;
}

.article-item h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.article-item p,
.detail dd {
    color: #53636b;
}

.original-title {
    font-size: 14px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: start;
}

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

.speech-panel {
    margin-top: 20px;
}

.speech-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.speech-settings label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.speech-status {
    color: #53636b;
}

.job-table audio {
    width: min(260px, 100%);
}

.message {
    padding: 10px 12px;
    border-radius: 6px;
    background: #e9f5f8;
}

.message.error {
    background: #fdeaea;
}

.detail {
    line-height: 1.7;
}

.detail dt {
    font-weight: 700;
}

@media (max-width: 760px) {
    .site-header {
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .article-item {
        grid-template-columns: 1fr;
    }
}
