:root {
    color-scheme: light;
    --bg: #f6f7f8;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #64707d;
    --line: #d9dee4;
    --accent: #0b7285;
    --danger: #b42318;
    --ok: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--accent);
}

.topbar {
    background: #172026;
    color: #fff;
    padding: 18px 28px;
}

.topbar h1,
.preview h1 {
    margin: 0 0 6px;
    letter-spacing: 0;
}

.topbar p,
.article-card p,
.meta {
    color: var(--muted);
}

.layout {
    max-width: 1320px;
    margin: 0 auto;
    padding: 22px;
}

.toolbar,
.publish-panel,
.list-head,
.table-wrap,
.preview {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.toolbar {
    padding: 14px;
    margin-bottom: 14px;
}

.search {
    display: grid;
    grid-template-columns: 1fr 120px 90px 110px;
    gap: 10px;
}

.publish-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(160px, .8fr) minmax(160px, .8fr) minmax(130px, .7fr) minmax(130px, .7fr) 110px 180px;
    gap: 10px;
    padding: 14px;
    margin-bottom: 14px;
    align-items: end;
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

input,
select,
button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 8px 10px;
    font: inherit;
}

button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: pointer;
}

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

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.pagination {
    justify-content: center;
    padding: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

.articles-table th,
.articles-table td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.articles-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef2f5;
    color: #45525f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.articles-table tr:hover td {
    background: #f8fafb;
}

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

.col-check {
    width: 44px;
    text-align: center;
}

.col-id {
    width: 90px;
    white-space: nowrap;
}

.col-date {
    width: 104px;
    white-space: nowrap;
}

.col-author {
    width: 130px;
}

.col-media {
    width: 74px;
}

.col-actions {
    width: 86px;
}

.title-cell {
    width: 34%;
    font-weight: 700;
    line-height: 1.35;
}

.desc-cell {
    color: var(--muted);
    line-height: 1.35;
}

.title-cell,
.desc-cell,
.col-author {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice {
    margin-left: 10px;
    color: var(--muted);
    font-size: 13px;
}

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

.muted {
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.alert.ok {
    color: var(--ok);
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.alert.error {
    color: var(--danger);
    background: #fef3f2;
    border: 1px solid #fecdca;
}

.preview {
    max-width: 900px;
    margin: 22px auto;
    padding: 24px;
}

.preview .lead {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.content {
    line-height: 1.65;
}

.content img {
    max-width: 100%;
    height: auto;
}

.preview-main-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 16px 0;
}

.image-note {
    color: var(--muted);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-box {
    width: min(420px, calc(100vw - 32px));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 24px;
}

@media (max-width: 980px) {
    .publish-panel,
    .search {
        grid-template-columns: 1fr;
    }

    .layout {
        padding: 14px;
    }

    .articles-table {
        min-width: 980px;
    }
}
