* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 56px;
}

.hero-card,
.content-card,
.empty-card,
.article-card,
.login-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.hero-card,
.content-card,
.empty-card,
.login-card {
    padding: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    background: #e0ecff;
    color: #2558d9;
}

.hero-card h1,
.dashboard-header h1,
.article-detail h1 {
    margin: 12px 0;
    font-size: clamp(28px, 4vw, 40px);
}

.hero-desc,
.muted-text,
.detail-summary,
.article-summary {
    color: #6b7280;
    line-height: 1.7;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.article-card {
    overflow: hidden;
}

.article-cover {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.article-cover img,
.detail-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    padding: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #64748b;
}

.primary-link,
.text-link,
.back-link {
    color: #2558d9;
    font-weight: 600;
}

.pagination {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.pagination-summary {
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

.pagination-track {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.page-item {
    min-width: 40px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #d9e2f0;
}

.page-control {
    min-width: 84px;
}

.page-item.is-disabled {
    color: #9aa5b1;
    background: #f8fafc;
    border-color: #e5e7eb;
}

.page-gap {
    color: #94a3b8;
    font-size: 14px;
    padding: 0 2px;
}

.page-item.is-active {
    background: #2558d9;
    border-color: #2558d9;
    color: #ffffff;
}

.listing-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 4px 8px;
}

.listing-footer-text {
    color: #6b7280;
    font-size: 14px;
}

.listing-meta-link {
    color: #2558d9;
    font-size: 14px;
    font-weight: 600;
}

.admin-shell {
    width: min(1280px, calc(100% - 32px));
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
}

.admin-sidebar h2 {
    margin: 10px 0 0;
    font-size: 24px;
}

.admin-menu {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #d9e2f0;
    background: #f8fbff;
    color: #334155;
    font-weight: 600;
}

.admin-menu-item.is-active {
    border-color: #2558d9;
    background: #2558d9;
    color: #ffffff;
}

.admin-content {
    display: grid;
    gap: 20px;
}

.dashboard-header,
.section-title-row,
.dashboard-actions,
.inline-actions,
.upload-row,
.form-submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.dashboard-header {
    margin-bottom: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: #2558d9;
    color: #ffffff;
}

.btn-secondary {
    background: #eef3ff;
    color: #2558d9;
}

.btn-ghost {
    background: transparent;
    border-color: #d0d7e2;
    color: #334155;
}

.btn-block {
    width: 100%;
}

.stack-form,
.editor-form {
    display: grid;
    gap: 16px;
}

.admin-pagination {
    margin-top: 20px;
}

.stack-form label,
.form-grid label {
    display: grid;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-column-full {
    grid-column: 1 / -1;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    border: 1px solid #d6dde8;
    border-radius: 12px;
    padding: 12px 14px;
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 96px;
}

.message {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
}

.success-message {
    background: #e9f9ef;
    color: #136c32;
}

.error-message {
    background: #fff0f0;
    color: #b42318;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
}

.empty-cell {
    text-align: center;
    color: #6b7280;
}

.inline-actions form {
    margin: 0;
}

.danger-link {
    color: #b42318;
    background: none;
    border: 0;
    padding: 0;
}

.narrow-card {
    width: min(480px, 100%);
    margin: 48px auto;
}

.info-panel ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.auto-bridge-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.9;
    color: #475569;
}

.auto-embed-shell {
    padding: 16px;
}

.auto-embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.auto-embed-frame {
    display: block;
    width: 100%;
    min-height: 920px;
    border: 1px solid #d6dde8;
    border-radius: 16px;
    background: #f8fafc;
}

.rich-editor {
    display: grid;
    gap: 12px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid #d6dde8;
    border-radius: 14px;
    background: #f8fafc;
}

.editor-toolbar button,
.editor-toolbar select {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #d6dde8;
    background: #ffffff;
}

.editor-surface,
.editor-source {
    min-height: 460px;
    padding: 18px;
    border: 1px solid #d6dde8;
    border-radius: 14px;
    background: #ffffff;
    line-height: 1.8;
}

.editor-surface:focus,
textarea:focus,
input:focus,
select:focus,
.editor-source:focus {
    outline: 2px solid rgba(37, 88, 217, 0.18);
    border-color: #2558d9;
}

.editor-surface img,
.rich-content img {
    border-radius: 12px;
    margin: 12px 0;
}

.editor-surface pre,
.rich-content pre {
    padding: 14px;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
}

.editor-surface blockquote,
.rich-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #2558d9;
    background: #f8fbff;
}

.editor-source.is-hidden,
.is-hidden {
    display: none;
}

.cover-preview-wrap {
    min-height: 12px;
}

.cover-preview {
    width: min(320px, 100%);
    border-radius: 14px;
    border: 1px solid #d6dde8;
}

.article-shell {
    width: min(900px, calc(100% - 32px));
}

.article-detail {
    margin-top: 16px;
}

.detail-header {
    margin-bottom: 24px;
}

.rich-content {
    line-height: 1.9;
    word-break: break-word;
}

.rich-content h2,
.rich-content h3 {
    margin-top: 28px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-shell {
        width: min(100% - 24px, 1180px);
        margin-top: 20px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .hero-card,
    .content-card,
    .empty-card,
    .login-card {
        padding: 18px;
    }

    .editor-surface,
    .editor-source {
        min-height: 340px;
    }

    .pagination-track {
        gap: 8px;
    }

    .page-item {
        min-width: 36px;
        padding: 9px 12px;
    }

    .page-control {
        min-width: 72px;
    }

    .auto-embed-frame {
        min-height: 760px;
    }
}

.breadcrumb {
    margin-bottom: 16px;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #64748b;
    font-size: 14px;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: #94a3b8;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.hero-stat {
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #d8e5ff;
}

.hero-stat strong {
    display: block;
    font-size: 22px;
    color: #2558d9;
}

.hero-stat span {
    color: #64748b;
    font-size: 13px;
}

.article-listing {
    margin-top: 20px;
}

.article-title-link:hover,
.article-title-link:focus,
.primary-link:hover,
.text-link:hover,
.back-link:hover {
    color: #163fa8;
}

.content-nav {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}
