:root {
    --bg: #eef3f1;
    --ink: #182029;
    --muted: #667384;
    --line: #d7e0e6;
    --paper: #fffdf9;
    --side: #16353a;
    --side-2: #1d444b;
    --accent: #e07a2f;
    --accent-ink: #fff;
    --ok: #1f7a4d;
    --err: #b42318;
    --shadow: 0 16px 40px rgba(22, 53, 58, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Noto Sans SC", "DM Sans", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(224, 122, 47, 0.12), transparent 55%),
        radial-gradient(800px 480px at -10% 20%, rgba(22, 53, 58, 0.08), transparent 50%),
        linear-gradient(160deg, #eef3f1, #e8eee9 50%, #f4efe8);
}

.shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: linear-gradient(180deg, var(--side), #10262b 90%);
    color: #edf4f3;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 8px;
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #f0a05a, var(--accent));
    box-shadow: 0 8px 18px rgba(224, 122, 47, 0.35);
}
.brand strong {
    display: block;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
    font-size: 16px;
    letter-spacing: -0.02em;
}
.brand span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: rgba(237, 244, 243, 0.62);
}

.nav {
    display: grid;
    gap: 6px;
}
.nav a,
.nav-form button {
    display: block;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: rgba(237, 244, 243, 0.78);
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav a:hover,
.nav-form button:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.on {
    background: rgba(224, 122, 47, 0.18);
    color: #ffd7b5;
}
.nav-form { margin: 0; }

.side-meta {
    margin-top: auto;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    font-size: 12px;
    line-height: 1.7;
    color: rgba(237, 244, 243, 0.62);
}

.main {
    padding: 28px clamp(18px, 3vw, 36px) 48px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}
.page-head h1 {
    margin: 0;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -0.03em;
}
.page-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; opacity: .92; }
.btn-brand {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 22px rgba(224, 122, 47, 0.28);
}
.btn-soft {
    background: #e8eef0;
    color: var(--ink);
}

.panel {
    background: var(--paper);
    border: 1px solid rgba(215, 224, 230, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.flash {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}
.flash.ok { background: #e8f6ee; color: var(--ok); }
.flash.err { background: #fdeceb; color: var(--err); }
.flash.warn { background: #fff4e5; color: #9a5b10; }
.flash-link { margin-top: 8px; font-size: 13px; word-break: break-all; }
.flash-link a { color: inherit; font-weight: 600; text-decoration: underline; }
.flash-link.muted { opacity: .75; font-weight: 400; }

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
}
.result-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 38, 43, 0.48);
    backdrop-filter: blur(4px);
}
.result-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: #eef3f1;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.result-modal__close:hover { background: #e4ebe8; color: var(--ink); }
.result-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    margin: 0;
    padding: 22px 22px 18px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,252,250,0.98)),
        var(--paper);
    border: 1px solid rgba(31, 122, 77, 0.18);
    box-shadow: 0 28px 60px rgba(16, 38, 43, 0.28);
    overflow: hidden;
    animation: modal-in .22s ease;
}
.result-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #3aa876, #1f7a4d);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.result-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(31, 122, 77, 0.1);
    color: var(--ok);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.result-card__badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f9d64;
    box-shadow: 0 0 0 4px rgba(47, 157, 100, 0.16);
}
.result-card__title {
    margin: 12px 0 6px;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.result-card__hint {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}
.result-card__urlbox {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f3f7f5;
    border: 1px dashed rgba(22, 53, 58, 0.14);
}
.result-card__label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}
.result-card__url {
    color: #1d5f68;
    font-family: "DM Sans", ui-monospace, monospace;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-all;
    text-decoration: none;
}
.result-card__url:hover { text-decoration: underline; }
.result-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.result-card__toast {
    position: absolute;
    right: 18px;
    top: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--side);
    color: #edf4f3;
    font-size: 12px;
    box-shadow: 0 10px 24px rgba(16, 38, 43, 0.28);
    animation: toast-in .22s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
body.modal-open { overflow: hidden; }
@media (max-width: 720px) {
    .result-card { padding: 16px; }
    .result-card__title { font-size: 18px; }
    .result-card__actions .btn { flex: 1 1 auto; }
}

.table-wrap { overflow: auto; }
table.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.list th,
table.list td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
table.list th {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    background: #f7faf9;
}
table.list tr:last-child td { border-bottom: 0; }
table.list a { color: #1d5f68; text-decoration: none; }
table.list a:hover { text-decoration: underline; }

.tag {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #e7f1ef;
    color: #1d5f68;
}
.tag.pub { background: #e7f5ec; color: var(--ok); }
.tag.draft { background: #eef1f4; color: #667384; }
.tag.review { background: #fff1e0; color: #9a5b10; }

.empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
}
.empty strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    margin-bottom: 8px;
}

.compose {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 320px;
    gap: 16px;
}
.compose-main,
.compose-meta {
    padding: 22px;
}
.compose-main {
    display: grid;
    gap: 16px;
}
.compose-meta {
    display: grid;
    gap: 10px;
    align-content: start;
}
.compose-meta .actions {
    margin-top: 4px;
}

.field {
    margin: 0;
}
.field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #3a4654;
    margin-bottom: 8px;
}
.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* 自定义圆角描边输入，去掉系统原生样式 */
.ctl,
input.ctl,
textarea.ctl,
select.ctl {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    margin: 0;
    border: 1px solid #d8dee6;
    outline: none;
    box-shadow: none;
    background: #fff;
    border-radius: 12px;
    padding: 11px 14px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
.ctl::placeholder {
    color: #a0aab6;
    opacity: 1;
}
.ctl:hover {
    border-color: #c5ced8;
}
.ctl:focus {
    border-color: #c9a078;
    box-shadow: 0 0 0 3px rgba(224, 122, 47, 0.14);
}
.ctl::-webkit-search-decoration,
.ctl::-webkit-search-cancel-button {
    -webkit-appearance: none;
}
.ctl::-webkit-outer-spin-button,
.ctl::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.title-input.ctl {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    padding: 6px 2px 14px;
    border: 0;
    border-bottom: 1px solid rgba(22, 53, 58, 0.12);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.title-input.ctl:hover {
    border-color: rgba(22, 53, 58, 0.2);
}
.title-input.ctl:focus {
    border-bottom-color: var(--accent);
    box-shadow: none;
}
.hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}
.pager form { margin: 0; }
.debug {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: #f3f6f5;
    color: #334;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 220px;
    overflow: auto;
}

.ke-container {
    border-radius: 12px !important;
    overflow: hidden;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(420px, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px 24px;
}
.login-brand {
    margin-bottom: 18px;
}
.login-brand strong {
    display: block;
    font-family: "DM Sans", "Noto Sans SC", sans-serif;
    font-size: 22px;
    letter-spacing: -0.02em;
}
.login-brand span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .side {
        padding-bottom: 12px;
        gap: 12px;
    }
    .nav { grid-template-columns: 1fr 1fr; }
    .side-meta { display: none; }
    .compose { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: start; }
    .title-input.ctl { font-size: 22px; }
}
