:root {
    --bg: #f2f7f3;
    --bg-soft: #fbfdf8;
    --card: rgba(255, 255, 255, 0.88);
    --line: rgba(15, 63, 43, 0.12);
    --line-strong: rgba(15, 63, 43, 0.22);
    --text: #183126;
    --muted: #5e7469;
    --brand: #1f7a4a;
    --brand-deep: #125033;
    --accent: #d97a28;
    --danger: #b5473c;
    --shadow: 0 22px 48px rgba(23, 55, 40, 0.1);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(57, 161, 103, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(217, 122, 40, 0.16), transparent 28%),
        linear-gradient(180deg, #edf5ef 0%, #f7f9f3 42%, #eef3f0 100%);
    min-height: 100vh;
}

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

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

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

.site-header,
.site-footer,
.panel,
.hero-card,
.feature-card,
.stat-card,
.item-card,
.table-card,
.empty-state,
.auth-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.site-header,
.site-footer {
    border-radius: var(--radius-lg);
}

.site-header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 16px;
    z-index: 10;
}

.brand-mark {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--brand-deep);
}

.brand-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.main-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.2s ease;
}

.main-nav a:hover {
    background: rgba(31, 122, 74, 0.08);
    color: var(--brand-deep);
}

.main-content {
    padding: 24px 0;
}

.flash {
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
}

.flash-success {
    background: rgba(27, 125, 87, 0.1);
    border-color: rgba(27, 125, 87, 0.18);
}

.flash-error {
    background: rgba(181, 71, 60, 0.1);
    border-color: rgba(181, 71, 60, 0.2);
}

.flash-info {
    background: rgba(31, 122, 74, 0.08);
    border-color: rgba(31, 122, 74, 0.14);
}

.hero-grid,
.stats-grid,
.feature-grid,
.content-grid,
.cards-grid,
.dashboard-grid,
.form-grid,
.auth-grid {
    display: grid;
    gap: 18px;
}

.hero-grid {
    grid-template-columns: 1.45fr 1fr;
    margin-bottom: 24px;
}

.hero-card {
    padding: 34px;
    border-radius: var(--radius-lg);
}

.hero-card h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.08;
    margin: 0 0 18px;
}

.hero-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-actions,
.pill-row,
.inline-actions,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(31, 122, 74, 0.08);
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 0.92rem;
}

.button,
button,
input[type="submit"] {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, #2a8d59 100%);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 22px rgba(31, 122, 74, 0.18);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
}

.button-secondary {
    background: #fff;
    color: var(--brand-deep);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.button-danger {
    background: linear-gradient(135deg, #a94a3c 0%, #d36b54 100%);
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stat-card,
.feature-card,
.panel,
.table-card,
.item-card,
.auth-card,
.empty-state {
    padding: 22px;
    border-radius: var(--radius-md);
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    color: var(--brand-deep);
    margin-bottom: 8px;
}

.stat-card h3,
.feature-card h3,
.panel h2,
.table-card h2,
.auth-card h2 {
    margin: 0 0 10px;
}

.stat-card p,
.feature-card p,
.panel p,
.table-card p,
.item-card p,
.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.content-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
    margin-bottom: 24px;
}

.cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: 1.35fr 0.95fr;
}

.auth-grid {
    grid-template-columns: 0.95fr 1.05fr;
}

.panel-header,
.item-title-row,
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.section-title {
    margin: 0 0 8px;
    font-size: 1.55rem;
}

.section-lead,
.muted {
    color: var(--muted);
}

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

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

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

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font: inherit;
}

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

.hint {
    font-size: 0.9rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(31, 122, 74, 0.08);
    color: var(--brand-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

.badge-warn {
    background: rgba(217, 122, 40, 0.12);
    color: #995006;
}

.badge-danger {
    background: rgba(181, 71, 60, 0.12);
    color: #8b2b21;
}

.badge-neutral {
    background: rgba(94, 116, 105, 0.12);
    color: #42544b;
}

.item-card {
    display: grid;
    gap: 14px;
}

.item-image {
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(31, 122, 74, 0.12), rgba(217, 122, 40, 0.08));
}

.key-value {
    display: grid;
    gap: 10px;
}

.key-value div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

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

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

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 700;
}

.table-actions {
    display: grid;
    gap: 10px;
    min-width: 210px;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
}

.site-footer {
    padding: 24px;
    margin-top: 16px;
}

.site-footer p {
    margin: 8px 0 0;
    color: var(--muted);
}

.footer-note {
    max-width: 420px;
}

.preview-image {
    display: none;
    width: 100%;
    max-width: 280px;
    border-radius: 16px;
    margin-top: 10px;
    border: 1px solid var(--line);
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    margin: 22px 0;
}

button:disabled,
input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

@media (max-width: 1080px) {
    .hero-grid,
    .content-grid,
    .dashboard-grid,
    .auth-grid,
    .stats-grid,
    .feature-grid,
    .cards-grid,
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .site-shell {
        width: min(100% - 18px, 100%);
        padding-top: 14px;
    }

    .site-header,
    .site-footer,
    .hero-grid,
    .content-grid,
    .dashboard-grid,
    .auth-grid,
    .stats-grid,
    .feature-grid,
    .cards-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .site-header,
    .site-footer,
    .panel-header,
    .item-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-card {
        padding: 24px;
    }
}
