:root {
    --paper: #f7f4ed;
    --paper-soft: #fcfaf5;
    --ink: #1f2321;
    --muted: #6d716d;
    --line: #d9d7cf;
    --green: #214e43;
    --green-dark: #173a32;
    --green-soft: #e7eee8;
    --red: #a13c36;
    --red-soft: #f8ebe8;
    --white: #fff;
    --shadow: 0 20px 60px rgba(39, 42, 38, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

button,
input {
    font: inherit;
}

button,
input[type="checkbox"],
input[type="file"] {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.site-shell,
.article-page,
.admin-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header,
.reader-header,
.admin-header {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    color: var(--paper-soft);
    background: var(--green);
    border-radius: 50% 50% 50% 12%;
    font-size: 17px;
}

.header-nav,
.admin-actions {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--muted);
    font-size: 14px;
}

.header-nav a:hover,
.back-link:hover,
.link-button:hover,
.read-more:hover,
.text-button:hover {
    color: var(--green);
}

.admin-link {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
    gap: 84px;
    align-items: end;
    padding: 94px 0 88px;
}

.eyebrow {
    margin: 0 0 20px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.hero h1,
.article-detail h1,
.admin-intro h1,
.auth-card h1 {
    margin: 0;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-weight: 500;
    letter-spacing: -0.035em;
}

.hero h1 {
    max-width: 720px;
    font-size: clamp(48px, 6.7vw, 86px);
    line-height: 1.08;
}

.hero-copy {
    max-width: 570px;
    margin: 28px 0 0;
    color: var(--muted);
    font-family: Georgia, "Songti SC", serif;
    font-size: 18px;
    line-height: 1.9;
}

.search-box {
    padding: 26px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.search-box label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.search-box div {
    display: flex;
    border-bottom: 1px solid var(--ink);
}

.search-box input {
    min-width: 0;
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: 0;
    outline: 0;
}

.search-box button {
    padding: 0 0 0 18px;
    color: var(--green);
    background: transparent;
    border: 0;
    font-weight: 700;
}

.article-section {
    border-top: 1px solid var(--ink);
    padding: 38px 0 100px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 28px;
}

.section-heading .eyebrow {
    margin-bottom: 10px;
}

.section-heading h2,
.panel-title h2 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-weight: 500;
}

.section-heading h2 {
    font-size: 32px;
}

.section-heading > span {
    color: var(--muted);
    font-size: 13px;
}

.article-grid {
    border-top: 1px solid var(--line);
}

.article-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 24px;
    padding: 40px 0;
    border-bottom: 1px solid var(--line);
}

.article-number {
    padding-top: 6px;
    color: #a2a39d;
    font-family: Georgia, serif;
    font-size: 14px;
}

.article-card-body time {
    color: var(--muted);
    font-size: 12px;
}

.article-card-body h3 {
    max-width: 820px;
    margin: 12px 0 15px;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(24px, 3vw, 35px);
    font-weight: 500;
    line-height: 1.3;
}

.article-card-body h3 a:hover {
    color: var(--green);
}

.article-card-body p {
    max-width: 760px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.read-more,
.text-button {
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
}

.read-more span {
    margin-left: 7px;
}

.empty-state {
    padding: 92px 24px;
    text-align: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.25);
}

.empty-state > span {
    display: block;
    color: var(--green);
    font-size: 44px;
}

.empty-state h3 {
    margin: 12px 0 8px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 25px;
    font-weight: 500;
}

.empty-state p {
    color: var(--muted);
}

.empty-state a {
    display: inline-block;
    margin-top: 14px;
    padding-bottom: 4px;
    color: var(--green);
    border-bottom: 1px solid var(--green);
    font-weight: 700;
}

.site-footer,
.reader-footer {
    display: flex;
    justify-content: space-between;
    padding: 28px 0 44px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.article-page {
    width: min(920px, calc(100% - 48px));
}

.back-link,
.link-button {
    color: var(--muted);
    font-size: 13px;
}

.article-detail {
    padding: 92px 0 110px;
}

.article-detail-head {
    padding-bottom: 54px;
    border-bottom: 1px solid var(--line);
}

.article-detail h1 {
    max-width: 820px;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.18;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    color: var(--muted);
    font-size: 13px;
}

.article-lead {
    margin: 36px 0 0;
    color: #4f5551;
    font-family: Georgia, "Songti SC", serif;
    font-size: 21px;
    line-height: 1.85;
}

.article-content {
    max-width: 730px;
    margin: 58px auto 0;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: 19px;
    line-height: 2.05;
}

.article-content p {
    margin: 0 0 1.65em;
}

.reader-footer {
    justify-content: flex-end;
}

.reader-footer a {
    color: var(--green);
    font-weight: 700;
}

/* Admin */
.admin-body {
    background: #f2f3ef;
}

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

.admin-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-badge {
    padding: 5px 9px;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}

.admin-actions form {
    margin: 0;
}

.link-button {
    padding: 0;
    background: transparent;
    border: 0;
}

.auth-card {
    width: min(500px, 100%);
    margin: 90px auto;
    padding: 46px;
    background: var(--white);
    border: 1px solid #e2e2dc;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 42px;
}

.auth-card > p:not(.eyebrow) {
    margin: 14px 0 26px;
    color: var(--muted);
    line-height: 1.7;
}

.auth-form,
.filters {
    display: grid;
    gap: 16px;
}

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

.auth-form label span,
.filters label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-form input,
.filters input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    color: var(--ink);
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: 3px;
    outline: 0;
}

.auth-form input:focus,
.filters input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(33, 78, 67, 0.1);
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0 18px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 750;
}

.primary-button {
    color: white;
    background: var(--green);
    border: 1px solid var(--green);
}

.primary-button:hover {
    background: var(--green-dark);
}

.secondary-button {
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
}

.clear-button {
    padding-top: 1px;
}

.danger-button {
    color: white;
    background: var(--red);
    border: 1px solid var(--red);
}

.ghost-danger {
    color: var(--red);
    background: transparent;
}

.notice {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.6;
}

.notice-success {
    color: var(--green-dark);
    background: var(--green-soft);
    border: 1px solid #cbdace;
}

.notice-error {
    color: #772923;
    background: var(--red-soft);
    border: 1px solid #eccbc7;
}

.admin-content {
    padding: 58px 0 100px;
}

.admin-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 36px;
}

.admin-intro .eyebrow {
    margin-bottom: 12px;
}

.admin-intro h1 {
    font-size: 52px;
}

.admin-intro p:last-child {
    margin: 12px 0 0;
    color: var(--muted);
}

.stats-card {
    min-width: 150px;
    padding: 22px 28px;
    text-align: right;
    background: var(--green);
    color: white;
}

.stats-card strong,
.stats-card span {
    display: block;
}

.stats-card strong {
    font-family: Georgia, serif;
    font-size: 34px;
}

.stats-card span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
}

.admin-panel {
    margin-top: 22px;
    padding: 30px;
    background: var(--white);
    border: 1px solid #e0e1dc;
}

.panel-title,
.panel-title > div {
    display: flex;
    align-items: center;
}

.panel-title {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.panel-title > div {
    gap: 16px;
}

.panel-title h2 {
    font-size: 24px;
}

.panel-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.step-number {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 12px;
}

.upload-dropzone {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 28px;
    text-align: center;
    background: #fbfbf8;
    border: 1px dashed #b9bcb5;
    transition: border-color 0.2s, background 0.2s;
}

.upload-options {
    display: flex;
    align-items: end;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: #f7f7f3;
    border: 1px solid #ebebe6;
}

.upload-options label {
    display: grid;
    gap: 7px;
}

.upload-options label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.upload-options input {
    height: 42px;
    padding: 0 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.upload-options p {
    margin: 0 0 11px;
    color: var(--muted);
    font-size: 12px;
}

.upload-dropzone:hover,
.upload-dropzone.has-file {
    background: var(--green-soft);
    border-color: var(--green);
}

.upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    color: white;
    background: var(--green);
    border-radius: 50%;
    font-size: 19px;
}

.upload-dropzone strong {
    font-size: 15px;
}

.upload-dropzone small {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.import-button {
    margin-top: 16px;
}

.filters {
    grid-template-columns: minmax(200px, 1fr) 170px 170px auto auto;
    align-items: end;
    padding: 20px;
    background: #f7f7f3;
    border: 1px solid #ebebe6;
}

.bulk-bar,
.table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bulk-bar {
    margin: 24px 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.bulk-bar form {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    padding: 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e6e6e1;
}

th {
    color: var(--muted);
    background: #f7f7f3;
    font-size: 11px;
    letter-spacing: 0.06em;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fbfcf9;
}

td a {
    color: var(--green);
    font-weight: 700;
}

td small {
    max-width: 590px;
    display: block;
    overflow: hidden;
    margin-top: 5px;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check-cell {
    width: 46px;
    text-align: center;
}

.check-cell input {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
}

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

.table-actions {
    margin-top: 15px;
}

.table-actions span {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 70px 0;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .filters label:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .site-shell,
    .article-page,
    .admin-shell {
        width: min(100% - 28px, 1180px);
    }

    .site-header,
    .reader-header,
    .admin-header {
        min-height: 74px;
    }

    .header-nav {
        gap: 12px;
    }

    .header-nav > a:first-child,
    .admin-badge,
    .admin-actions .back-link {
        display: none;
    }

    .hero {
        padding: 56px 0;
    }

    .hero h1 {
        font-size: 47px;
    }

    .article-card {
        grid-template-columns: 36px 1fr;
        gap: 10px;
        padding: 30px 0;
    }

    .article-card-body h3 {
        font-size: 25px;
    }

    .site-footer {
        gap: 14px;
        flex-direction: column;
    }

    .article-detail {
        padding: 60px 0 75px;
    }

    .article-detail h1 {
        font-size: 40px;
    }

    .article-content {
        font-size: 17px;
    }

    .auth-card {
        margin: 50px auto;
        padding: 30px 22px;
    }

    .auth-card h1 {
        font-size: 36px;
    }

    .admin-content {
        padding: 38px 0 70px;
    }

    .admin-intro,
    .panel-title,
    .bulk-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-intro h1 {
        font-size: 42px;
    }

    .stats-card {
        width: 100%;
        text-align: left;
    }

    .admin-panel {
        padding: 20px 14px;
    }

    .upload-options {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-options p {
        margin: 0;
        line-height: 1.6;
    }

    .panel-title > div {
        align-items: flex-start;
    }

    .filters {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .filters label:first-child {
        grid-column: auto;
    }

    .bulk-bar form,
    .bulk-bar button {
        width: 100%;
    }
}
