* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
    background: #f6f7f9;
    color: #1f2937;
}
a { color: #2463eb; text-decoration: none; }
button {
    border: 0;
    border-radius: 6px;
    background: #1f2937;
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
}
.small-button {
    padding: 6px 9px;
    font-size: 13px;
}
button:disabled {
    cursor: default;
    opacity: .55;
}
.button-link {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    background: #1f2937;
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
}
.mini-link {
    display: inline-block;
    border-radius: 6px;
    background: #eef4ff;
    color: #1d4ed8;
    padding: 6px 9px;
    white-space: nowrap;
}
input {
    border: 1px solid #d6d9df;
    border-radius: 6px;
    padding: 9px 10px;
    min-height: 38px;
}
textarea {
    border: 1px solid #d6d9df;
    border-radius: 6px;
    padding: 9px 10px;
    min-height: 38px;
    resize: vertical;
    font-family: inherit;
}
select {
    border: 1px solid #d6d9df;
    border-radius: 6px;
    padding: 9px 10px;
    min-height: 38px;
    background: #fff;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}
th { color: #667085; font-weight: 600; background: #fafafa; }
.muted { color: #667085; }
.long-text {
    max-width: 360px;
    word-break: break-word;
}
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 208px;
    background: #111827;
    padding: 22px 16px;
}
.brand {
    color: #fff;
    font-weight: 700;
    margin-bottom: 22px;
}
.sidebar a, .link-button {
    display: block;
    width: 100%;
    color: #d1d5db;
    background: transparent;
    text-align: left;
    padding: 10px 8px;
    border-radius: 6px;
}
.sidebar a:hover, .link-button:hover { background: #1f2937; }
.content {
    margin-left: 208px;
    padding: 28px;
}
.public-page {
    background: #f6f7f9;
}
.public-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}
.news-content {
    max-width: 980px;
}
.news-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.news-header h1 {
    margin: 4px 0 8px;
    font-size: 32px;
    line-height: 1.2;
}
.eyebrow {
    margin: 0;
    color: #475467;
    font-size: 14px;
}
.news-list {
    display: grid;
    gap: 14px;
}
.news-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}
.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 13px;
}
.news-meta span {
    border-radius: 999px;
    background: #f2f4f7;
    padding: 4px 8px;
}
.news-meta .score-badge {
    background: #1f2937;
    color: #fff;
    font-weight: 700;
}
.news-card h2 {
    margin: 12px 0 10px;
    font-size: 20px;
    line-height: 1.35;
}
.news-card h2 a {
    color: #111827;
}
.news-summary {
    margin: 0;
    color: #344054;
    line-height: 1.7;
}
.news-detail {
    margin-top: 12px;
    color: #344054;
}
.news-detail summary {
    cursor: pointer;
    color: #1d4ed8;
    font-weight: 600;
}
.news-detail dl {
    margin: 12px 0 0;
    display: grid;
    gap: 10px;
}
.news-detail div {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
}
.news-detail dt {
    color: #667085;
}
.news-detail dd {
    margin: 0;
    word-break: break-word;
}
.news-actions {
    min-width: 86px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}
.news-actions form {
    margin: 0;
}
.news-actions .mini-link,
.news-actions .small-button {
    width: 100%;
    text-align: center;
}
.interest-button {
    background: #2563eb;
}
.empty-state {
    background: #fff;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
    padding: 28px;
    text-align: center;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.actions { display: flex; gap: 10px; }
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.row-actions form { margin: 0; }
.muted { color: #667085; font-size: 13px; margin-top: 6px; }
.status-badge {
    display: inline-block;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}
.muted-button { background: #667085; }
.danger-button { background: #b42318; }
.cms-form {
    display: grid;
    gap: 14px;
}
.cms-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 600;
}
.cms-form input,
.cms-form select,
.cms-form textarea {
    width: 100%;
    font-weight: 400;
}
.form-grid {
    display: grid;
    gap: 14px;
}
.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.panel > span { color: #667085; display: block; margin-bottom: 8px; }
.panel strong { font-size: 24px; }
.wide { overflow-x: auto; }
.notice {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
}
.form-table label {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr) 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.form-table small { color: #667085; }
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.check {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.markdown pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    line-height: 1.6;
}
.muted { color: #667085; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}
.login-box {
    width: 360px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 28px;
}
.login-box label {
    display: block;
    margin-bottom: 12px;
}
.login-box input {
    width: 100%;
    margin-top: 6px;
}
.login-box button { width: 100%; }
.error { color: #b42318; margin-top: 12px; }
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.table-actions form { margin: 0; }
.summary-cell {
    max-width: 360px;
}

.cms-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}
.cms-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cms-filter-field b {
    color: #667085;
    font-weight: 700;
    font-size: 14px;
}
.cms-filter-form input,
.cms-filter-form select {
    width: 180px;
    color: #1f2937;
    font-weight: 500;
}
.cms-filter-form input {
    width: 260px;
}
.cms-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
}

.cms-simple-form {
    max-width: 1180px;
    padding: 22px;
}
.cms-section {
    border-bottom: 1px solid #edf0f4;
    padding-bottom: 22px;
}
.cms-section h2,
.cms-advanced summary {
    margin: 0 0 16px;
    font-size: 20px;
    color: #1f2937;
}
.cms-form .field-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
    width: auto;
}
.cms-form .field-title em {
    color: #d92d20;
    font-style: normal;
}
.cms-form .help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    padding: 0 !important;
    margin: 0 0 0 2px;
    border: 1.5px solid #1f2937;
    border-radius: 50%;
    background: transparent !important;
    color: #1f2937 !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    box-shadow: none;
    vertical-align: middle;
}
.cms-form .help-button:hover {
    background: #f2f4f7 !important;
}
.cms-form .ai-generate-button {
    width: auto;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    box-shadow: none;
}
.cms-form .ai-generate-button:hover {
    background: #dbeafe;
}
.auto-path-preview {
    align-self: end;
    border: 1px dashed #d0d5dd;
    border-radius: 8px;
    padding: 11px 12px;
    background: #f8fafc;
}
.auto-path-preview code {
    display: block;
    color: #1d4ed8;
    font-size: 14px;
    word-break: break-all;
    margin: 4px 0;
}
.auto-path-preview small {
    color: #667085;
    font-weight: 400;
}
.cms-advanced {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #fbfcfe;
}
.cms-advanced summary {
    cursor: pointer;
    font-weight: 800;
}
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,.94);
    border-top: 1px solid #e5e7eb;
    padding: 14px 0 0;
}
.help-modal[hidden] {
    display: none;
}
.help-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.help-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
}
.help-modal-card {
    position: relative;
    width: min(560px, calc(100vw - 40px));
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .24);
    padding: 24px;
}
.help-modal-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}
.help-modal-card p {
    margin: 0 0 16px;
    color: #475467;
    line-height: 1.8;
}
.help-modal-close {
    position: absolute;
    right: 14px;
    top: 12px;
    background: transparent;
    color: #667085;
    font-size: 24px;
    padding: 0 6px;
}
.help-example {
    border-radius: 8px;
    background: #f6f7f9;
    border: 1px solid #e5e7eb;
    padding: 12px;
}
.help-example strong {
    display: block;
    margin-bottom: 8px;
}
.help-example pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #344054;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.news-admin {
    max-width: 1400px;
}
.breadcrumb {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5f6673;
    font-weight: 700;
    font-size: 16px;
}
.breadcrumb span {
    color: #a0a7b3;
}
.filter-panel,
.table-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    border: 1px solid #e6eaf0;
}
.filter-panel {
    padding: 22px 26px;
    margin: 12px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.filter-title h1 {
    margin: 0 0 6px;
    font-size: 24px;
}
.filter-title p {
    margin: 0;
    color: #7a8494;
}
.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}
.filter-form label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5f6673;
    font-weight: 700;
}
.filter-form select {
    min-width: 220px;
    min-height: 42px;
}
.query-button {
    min-width: 82px;
    min-height: 42px;
    background: #409eff;
    font-weight: 700;
}
.table-panel {
    padding: 20px 24px;
    overflow-x: auto;
}
.news-table {
    min-width: 1120px;
    border: 1px solid #e6eaf0;
}
.news-table th,
.news-table td {
    border: 1px solid #e6eaf0;
    padding: 14px 16px;
}
.news-table th {
    background: #fbfcfe;
    color: #8a92a0;
    font-size: 15px;
}
.news-table tbody tr:nth-child(odd) {
    background: #fafbfe;
}
.news-table tbody tr:hover {
    background: #f3f8ff;
}
.id-cell {
    width: 76px;
    color: #626a78;
    font-weight: 700;
}
.title-cell {
    min-width: 420px;
    max-width: 620px;
}
.news-title-link {
    display: inline-block;
    color: #303846;
    font-weight: 700;
    line-height: 1.45;
}
.news-title-link:hover {
    color: #2463eb;
}
.line-summary {
    margin: 8px 0 0;
    color: #667085;
    line-height: 1.6;
}
.row-detail {
    margin-top: 8px;
}
.row-detail summary {
    cursor: pointer;
    color: #409eff;
    font-weight: 700;
}
.detail-box {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fafc;
    color: #475467;
}
.detail-box p {
    margin: 6px 0;
    line-height: 1.6;
}
.score-cell {
    width: 72px;
    font-weight: 800;
    color: #1f2937;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 28px;
    border-radius: 6px;
    background: #eef9e8;
    color: #5aba35;
    border: 1px solid #d9f1cd;
    font-weight: 700;
    white-space: nowrap;
}
.ops-cell {
    width: 220px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ops-cell form {
    margin: 0;
}
.outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 6px;
    border: 1px solid #d8dde6;
    background: #fff;
    color: #4b5563;
    padding: 6px 12px;
    font-weight: 700;
}
.outline-button:hover {
    border-color: #409eff;
    color: #2463eb;
}

@media (max-width: 720px) {
    .public-content {
        padding: 18px;
    }
    .news-header,
    .news-card {
        display: block;
    }
    .news-header .inline-form {
        margin-top: 14px;
    }
    .news-actions {
        margin-top: 14px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .news-actions .mini-link,
    .news-actions .small-button {
        width: auto;
    }
    .news-detail div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .filter-panel,
    .filter-form {
        display: block;
    }
    .filter-form label {
        margin: 14px 0 10px;
    }
    .filter-form select,
    .query-button {
        width: 100%;
    }
    .table-panel {
        padding: 12px;
    }
}
