:root {
    color-scheme: light;
    --surface: #ffffff;
    --background: #f5f6f2;
    --ink: #20291f;
    --muted: #596356;
    --line: #dbe0d6;
    --accent: #1d6046;
    --accent-dark: #174a36;
    --focus: #0e7e59;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
h1, h2, p { margin-block: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.1rem); line-height: 1.2; }
h2 { font-size: 1.3rem; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead-content { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-size: 18px;
    font-weight: 700;
}
.brand strong { display: block; font-size: 16px; line-height: 1.2; }
.brand span:not(.brand-mark) { color: var(--muted); font-size: 12px; }
main { padding-block: 44px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.description { margin-top: 8px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

.login-panel { width: min(100%, 460px); margin: clamp(8px, 6vh, 56px) auto; padding: 30px; }
.login-panel form { display: grid; gap: 12px; margin-top: 24px; }
.login-panel label, .field label { font-weight: 650; }
.login-panel .button { justify-self: start; min-width: 88px; margin-top: 4px; }
.button {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 14px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 650;
    cursor: pointer;
}
.button-primary { background: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-quiet { border-color: var(--line); }
.button-quiet:hover:not(:disabled) { background: var(--background); }
.button:disabled { opacity: .53; cursor: default; }

input:not([type="checkbox"]), textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #bfc9bb;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--ink);
    background: var(--surface);
}
textarea { resize: vertical; }
.feedback { margin-bottom: 14px; padding: 9px 12px; border-radius: 8px; background: #e8f4eb; color: #194f36; }
.feedback.error { background: #f8ebe6; color: #842f1e; }
form .feedback, .dialog-content .feedback { margin-bottom: 0; }

.table-scroll { overflow-x: auto; border-radius: 14px; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 15px 22px; text-align: left; vertical-align: middle; }
thead th { padding-block: 12px; font-size: 13px; font-weight: 650; color: var(--muted); background: #f7f8f4; }
tbody th, tbody td { border-top: 1px solid var(--line); }
tbody th { width: 42%; }
td:last-child, thead th:last-child { text-align: right; }
.site-name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.site-url { display: block; font-size: 12px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.site-status { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.site-status.active { color: #185039; background: #dcf1e2; }
.site-status.pending { color: #664500; background: #f9edcb; }
.site-status.suspended { color: #872d25; background: #fae7e3; }
.site-status.disabled { color: #495347; background: #eaeee8; }
.index-count, time { white-space: nowrap; }
.index-count { font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 58px 20px; border-top: 1px solid var(--line); }
.empty-state strong { font-size: 16px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 14px 22px; color: var(--muted); }

dialog {
    width: min(540px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 90px #1b261d24;
}
dialog::backdrop { background: #1b261d70; }
.dialog-content { display: grid; gap: 16px; padding: 24px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dismiss { min-height: 34px; padding: 5px 10px; }
.site-details { display: grid; gap: 8px; margin: 0; padding: 12px; background: var(--background); border-radius: 8px; }
.site-details div { display: grid; grid-template-columns: 78px 1fr; gap: 6px; }
.site-details dt { color: var(--muted); }
.site-details dd { margin: 0; overflow-wrap: anywhere; }
.monospace { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.field { display: grid; gap: 6px; }
.field-help { display: block; font-size: 12px; color: var(--muted); }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkbox-field input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.credential-site { font-weight: 650; overflow-wrap: anywhere; }
#credential-dialog .description { margin-top: -9px; }
#site-token { overflow-wrap: anywhere; min-height: 90px; }

@media (max-width: 610px) {
    .shell { width: calc(100% - 28px); }
    main { padding-block: 28px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .login-panel { padding: 22px; }
    .dialog-content { padding: 18px; }
    th, td { padding-inline: 14px; }
    .pagination { padding-inline: 14px; }
}
