:root {
    --bg: #f3ede4;
    --bg-accent: #f8f4ee;
    --panel: rgba(255, 252, 246, 0.95);
    --panel-strong: #fff7ec;
    --text: #1f2328;
    --muted: #5e655f;
    --line: #d9cab6;
    --accent: #b6531a;
    --accent-dark: #8c3f14;
    --success: #1f7a53;
    --warning: #a86f15;
    --danger: #a33b2d;
    --shadow: 0 18px 48px rgba(63, 42, 22, 0.12);
    --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-display: "Source Han Serif SC", "Songti SC", "STSong", serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(255, 243, 220, 0.9), transparent 36%),
        linear-gradient(180deg, #f4eee7 0%, #eadfce 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(182, 83, 26, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(182, 83, 26, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

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

a {
    color: inherit;
}

.site-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(243, 237, 228, 0.88);
    border-bottom: 1px solid rgba(142, 89, 51, 0.12);
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 110px;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(63, 42, 22, 0.14);
    flex-shrink: 0;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-actions,
.hero-actions,
.inline-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-actions {
    margin-left: auto;
}

.text-link {
    color: var(--accent-dark);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.nav-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(182, 83, 26, 0.1);
    color: var(--accent-dark);
    font-size: 0.92rem;
}

.page-body {
    padding: 36px 0 72px;
}

.hero-panel,
.content-card,
.card-surface,
.info-panel,
.timeline-item,
.entry-card,
.summary-card,
.carousel-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
    gap: 20px;
    padding: 28px;
    align-items: start;
}

.hero-panel-wide {
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.85fr);
}

.hero-note {
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(182, 83, 26, 0.12), rgba(182, 83, 26, 0.03));
}

.hero-note code {
    display: inline-block;
    margin: 12px 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: #2e2a27;
    color: #fff7ee;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
}

h1,
h2,
h3 {
    margin-top: 0;
    font-family: var(--font-display);
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 4.4vw, 3.35rem);
    line-height: 1.2;
    margin-bottom: 12px;
}

h2,
h3 {
    margin-bottom: 10px;
}

p {
    line-height: 1.75;
}

.lead,
.section-head p,
.content-card p,
.summary-card p,
.muted-line,
.entry-meta,
small,
.muted-text,
.brand-subtitle,
.module-meta,
.page-status {
    color: var(--muted);
}

.section-head {
    margin-bottom: 18px;
}

.compact-head {
    margin-bottom: 14px;
}

.card-grid,
.two-column-grid,
.dual-carousel-grid,
.stats-grid,
.three-column-grid,
.news-layout {
    display: grid;
    gap: 18px;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.two-column-grid,
.news-layout,
.news-page-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: start;
}

.dual-carousel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: 24px;
}

.three-column-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr) minmax(280px, 0.9fr);
    align-items: start;
    margin-top: 24px;
}

.split-section,
.carousel-section {
    margin-top: 34px;
}

.content-card,
.card-surface,
.summary-card,
.info-panel,
.carousel-panel {
    padding: 22px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #dc7a30);
    color: white;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.button-ghost {
    background: rgba(255, 255, 255, 0.74);
    color: var(--accent-dark);
    border: 1px solid rgba(182, 83, 26, 0.2);
}

.stack-form,
.form-shell,
.timeline-list,
.entry-list,
.news-list,
.audit-list {
    display: grid;
    gap: 14px;
}

.narrow-shell {
    max-width: 620px;
    margin: 0 auto;
}

.field-block {
    display: grid;
    gap: 8px;
}

.field-block span {
    font-weight: 600;
}

.form-input,
textarea,
select,
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #ccb89f;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    font: inherit;
}

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

.field-errors {
    color: var(--danger);
    font-size: 0.92rem;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash-message {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.72);
}

.flash-message.success {
    border-color: rgba(31, 122, 83, 0.25);
    background: rgba(31, 122, 83, 0.12);
}

.flash-message.warning {
    border-color: rgba(168, 111, 21, 0.25);
    background: rgba(168, 111, 21, 0.12);
}

.flash-message.error {
    border-color: rgba(163, 59, 45, 0.25);
    background: rgba(163, 59, 45, 0.12);
}

.timeline-item,
.entry-card,
.news-feature,
.article-body {
    padding: 18px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.meta-row-wrap {
    flex-wrap: wrap;
}

.status-chip,
.role-chip,
.audit-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.status-chip {
    background: rgba(182, 83, 26, 0.1);
    color: var(--accent-dark);
}

.role-chip,
.audit-chip {
    background: rgba(31, 35, 40, 0.08);
    color: var(--text);
}

.empty-state {
    padding: 18px;
    border: 1px dashed rgba(94, 101, 95, 0.4);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.48);
}

.inline-form {
    display: inline;
}

.danger-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--danger);
    cursor: pointer;
    font: inherit;
}

.honeypot-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.carousel-shell {
    position: relative;
}

.carousel-track {
    position: relative;
    min-height: 320px;
}

.carousel-slide {
    display: none;
}

.carousel-slide.is-active {
    display: block;
}

.carousel-media {
    min-height: 320px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.carousel-media.is-placeholder {
    background:
        linear-gradient(145deg, rgba(182, 83, 26, 0.12), rgba(140, 63, 20, 0.08)),
        radial-gradient(circle at top right, rgba(182, 83, 26, 0.22), transparent 30%),
        linear-gradient(180deg, #fff6e8 0%, #f3e7d7 100%);
}

.carousel-overlay {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 28px;
    color: #fffdf8;
    background: linear-gradient(180deg, rgba(24, 24, 24, 0.08), rgba(24, 24, 24, 0.72));
}

.carousel-media.is-placeholder .carousel-overlay {
    color: var(--text);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 247, 236, 0.74));
}

.carousel-controls {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.carousel-dot,
.carousel-nav,
.page-link {
    border: 1px solid rgba(182, 83, 26, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: var(--accent-dark);
    cursor: pointer;
    text-decoration: none;
}

.carousel-dot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.carousel-dot.is-active,
.carousel-nav:hover,
.page-link:hover {
    background: rgba(182, 83, 26, 0.12);
}

.carousel-nav,
.page-link {
    padding: 10px 14px;
    border-radius: 999px;
}

.module-card {
    overflow: hidden;
}

.module-cover {
    height: 160px;
    margin: -22px -22px 18px;
    background-size: cover;
    background-position: center;
}

.module-meta {
    font-size: 0.92rem;
    margin: 12px 0 4px;
}

.news-page-grid,
.article-body,
.news-entry-card {
    min-width: 0;
}

.article-content {
    font-size: 1rem;
    line-height: 1.95;
}

.side-preview-image {
    margin-top: 14px;
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(182, 83, 26, 0.14);
}

.pagination-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.audit-list {
    margin-top: 18px;
}

.audit-entry {
    display: grid;
    gap: 6px;
}

.attachment-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.attachment-preview-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(182, 83, 26, 0.14);
    background: rgba(255, 255, 255, 0.6);
}

.attachment-preview-link {
    display: block;
    border-radius: 14px;
    overflow: hidden;
}

.attachment-preview-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: rgba(233, 223, 208, 0.8);
}

.attachment-preview-body {
    display: grid;
    gap: 6px;
}

@media (max-width: 1100px) {
    .three-column-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .dual-carousel-grid,
    .news-layout,
    .two-column-grid,
    .news-page-grid,
    .hero-panel,
    .hero-panel-wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .nav-row {
        flex-direction: column;
        justify-content: center;
        row-gap: 10px;
    }

    .brand-icon {
        width: 90px;
        height: 120px;
    }

    .nav-actions {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .nav-badge {
        display: none;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 20px, 1160px);
    }

    .hero-panel,
    .content-card,
    .card-surface,
    .info-panel,
    .summary-card,
    .carousel-panel {
        padding: 18px;
        border-radius: 20px;
    }

    .carousel-media,
    .carousel-overlay {
        min-height: 280px;
    }

    .carousel-controls,
    .pagination-row,
    .meta-row {
        flex-wrap: wrap;
    }

    h1 {
        font-size: 2rem;
    }
}
