:root {
    --ink: #17211b;
    --muted: #6e756f;
    --paper: #f6f3ed;
    --card: #fffdf9;
    --line: #dcd8cf;
    --accent: #df573d;
    --green: #315b43;
    --soft-green: #dbe7db;
    --shadow: 0 16px 42px rgba(36, 43, 37, .08);
    color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 6%, rgba(223, 87, 61, .08), transparent 24rem),
        linear-gradient(180deg, #f8f5ef 0%, var(--paper) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; }
button, input { font: inherit; }

.shell {
    width: min(100% - 32px, 900px);
    margin: 0 auto;
    padding: 56px 0 32px;
}

.hero {
    position: relative;
    min-height: 320px;
    padding: 48px 48px 42px;
    overflow: hidden;
    color: #fff;
    background: var(--ink);
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 250px;
    height: 250px;
    top: -125px;
    right: -30px;
    background: var(--accent);
    opacity: .9;
}

.hero::after {
    width: 150px;
    height: 150px;
    right: 72px;
    bottom: -90px;
    border: 24px solid #7ca184;
    opacity: .75;
}

.brand-mark {
    display: flex;
    gap: 6px;
    margin-bottom: 44px;
}

.brand-mark span { display: block; width: 24px; height: 6px; border-radius: 99px; }
.brand-mark span:nth-child(1) { background: #fff; }
.brand-mark span:nth-child(2) { background: var(--accent); width: 12px; }
.brand-mark span:nth-child(3) { background: #7ca184; width: 6px; }

.eyebrow,
.section-kicker,
.admin-label {
    margin: 0 0 8px;
    color: #a7c1ad;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
}

.hero h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 560px;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: clamp(42px, 8vw, 72px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.hero-copy { position: relative; z-index: 1; margin: 18px 0 34px; color: #c7d0ca; font-size: 16px; }

.date-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    color: #f7f5ee;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.pulse-dot { width: 8px; height: 8px; background: #ff775f; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,119,95,.14); }

.content-section,
.archive-section { padding: 64px 8px 0; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading.compact { margin-bottom: 18px; }
.section-kicker { color: var(--accent); }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(26px, 5vw, 36px); line-height: 1.2; }
.text-link { color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }

.article-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.article-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 22px 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.article-card:hover { transform: translateY(-2px); border-color: #c3beb4; box-shadow: 0 12px 32px rgba(36,43,37,.07); }
.article-index { color: var(--accent); font-family: Georgia, serif; font-size: 20px; font-style: italic; }
.article-main { min-width: 0; }
.article-main h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.45; }
.article-meta { margin: 0; color: var(--muted); font-size: 13px; }
.open-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    color: #fff;
    background: var(--green);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.empty-state { padding: 60px 24px; text-align: center; background: rgba(255,255,255,.55); border: 1px dashed #c9c3b9; border-radius: 24px; }
.empty-icon { color: var(--accent); font-size: 34px; }
.empty-state h3 { margin: 10px 0 4px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 14px; }

.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.archive-link { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: transparent; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.archive-link span { font-weight: 750; }
.archive-link small { color: var(--muted); }
.archive-link.active { color: #fff; background: var(--green); border-color: var(--green); }
.archive-link.active small { color: #d8e6dc; }
.site-footer { padding: 72px 8px 12px; color: #8b908c; text-align: center; font-size: 12px; letter-spacing: .08em; }

/* Admin */
.admin-body { background: #edf0ec; }
.admin-header { display: flex; align-items: center; justify-content: space-between; width: min(100% - 40px, 1120px); margin: 0 auto; padding: 36px 0 22px; }
.admin-header h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; }
.admin-label { color: var(--accent); }
.admin-nav { display: flex; align-items: center; gap: 16px; }
.admin-nav a, .link-button { padding: 0; color: var(--green); background: none; border: 0; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.admin-shell { display: grid; gap: 22px; width: min(100% - 40px, 1120px); margin: 0 auto; padding-bottom: 64px; }
.panel { padding: 28px; background: #fff; border: 1px solid #dce1dc; border-radius: 22px; box-shadow: 0 12px 34px rgba(31,47,37,.05); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid #e8ebe7; }
.panel-heading > div { display: flex; align-items: center; gap: 12px; }
.panel-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step-number { display: grid; place-items: center; width: 36px; height: 36px; color: var(--accent); background: #f9e9e5; border-radius: 50%; font-size: 12px; font-weight: 800; }
.create-form { display: grid; grid-template-columns: 1fr 180px auto; align-items: end; gap: 14px; padding-top: 22px; }
.field { display: grid; gap: 7px; }
.field label, .stack-form label, .edit-form label { color: #49524c; font-size: 13px; font-weight: 750; }
input { width: 100%; min-height: 46px; padding: 0 13px; color: var(--ink); background: #fbfcfa; border: 1px solid #cfd6d0; border-radius: 10px; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,91,67,.1); }
.primary-button, .small-primary { min-height: 46px; padding: 0 20px; color: #fff; background: var(--green); border: 0; border-radius: 10px; font-weight: 750; cursor: pointer; }
.small-primary { min-height: 40px; }
.admin-date-group { padding-top: 28px; }
.admin-date-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.admin-date-heading h3 { margin: 0; font-size: 16px; }
.admin-date-heading span { color: var(--muted); font-size: 12px; }
.admin-records { display: grid; gap: 8px; }
.admin-record { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; background: #f8faf7; border: 1px solid #e2e7e2; border-radius: 14px; }
.record-order { color: var(--accent); font-family: Georgia, serif; font-size: 15px; }
.record-content { min-width: 0; }
.record-content h4 { margin: 0 0 4px; font-size: 15px; }
.record-content > a { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-status { margin-top: 5px; font-size: 11px; }
.record-status.success { color: #2c7547; }
.record-status.failed { color: #a24735; }
.record-controls { display: flex; align-items: center; gap: 7px; }
.inline-actions { display: flex; gap: 5px; }
.inline-actions button, .edit-details summary, .danger-button { min-height: 34px; padding: 0 10px; color: #455048; background: #fff; border: 1px solid #d5dbd6; border-radius: 8px; font-size: 12px; cursor: pointer; }
.edit-details { position: relative; }
.edit-details summary { display: flex; align-items: center; list-style: none; }
.edit-details[open] .edit-form { display: grid; }
.edit-form { position: absolute; z-index: 5; top: 42px; right: 0; display: none; gap: 12px; width: min(360px, 80vw); padding: 18px; background: #fff; border: 1px solid #ccd4cd; border-radius: 14px; box-shadow: var(--shadow); }
.edit-form label { display: grid; gap: 5px; }
.danger-button { color: #a43d2c; border-color: #edcbc4; }
.alert { padding: 13px 16px; border-radius: 10px; font-size: 14px; }
.alert.success { color: #245c38; background: #dcecdf; border: 1px solid #bfd8c5; }
.alert.error { color: #8e3527; background: #f8e3de; border: 1px solid #edc2b9; }
.admin-empty { padding: 48px 20px 24px; color: var(--muted); text-align: center; }

.login-body { display: grid; place-items: center; }
.login-shell { width: min(100% - 36px, 430px); }
.back-home { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.login-card { padding: 38px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.admin-badge { display: inline-block; margin-bottom: 26px; padding: 5px 9px; color: var(--accent); background: #f9e9e5; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.login-card h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; }
.login-card > p { margin: 8px 0 26px; color: var(--muted); font-size: 14px; }
.stack-form { display: grid; gap: 10px; }
.stack-form .primary-button { margin-top: 8px; }
.login-card .alert { margin-bottom: 16px; }

@media (max-width: 760px) {
    .shell { width: min(100% - 20px, 900px); padding-top: 10px; }
    .hero { min-height: 300px; padding: 32px 24px; border-radius: 24px; }
    .hero::before { width: 180px; height: 180px; top: -100px; right: -50px; }
    .hero::after { right: 22px; }
    .brand-mark { margin-bottom: 46px; }
    .hero h1 { font-size: 45px; }
    .content-section, .archive-section { padding: 48px 4px 0; }
    .section-heading { align-items: center; }
    .article-card { grid-template-columns: 34px 1fr; gap: 12px; padding: 18px 16px; }
    .open-button { grid-column: 2; width: fit-content; min-height: 40px; }
    .archive-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-header { width: min(100% - 24px, 1120px); padding-top: 24px; }
    .admin-header h1 { font-size: 26px; }
    .admin-shell { width: min(100% - 20px, 1120px); }
    .panel { padding: 20px 16px; border-radius: 18px; }
    .panel-heading { display: block; }
    .panel-heading p { margin-top: 12px; }
    .create-form { grid-template-columns: 1fr; }
    .admin-record { grid-template-columns: 36px 1fr; align-items: start; }
    .record-controls { grid-column: 2; flex-wrap: wrap; }
    .edit-form { position: fixed; top: 50%; right: 16px; left: 16px; width: auto; transform: translateY(-50%); }
    .admin-nav { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

