:root {
    --bg: #f4efe6;
    --bg-soft: #fffaf1;
    --panel: rgba(255, 250, 241, 0.88);
    --panel-strong: #fffdf8;
    --line: rgba(78, 59, 41, 0.12);
    --text: #2e241d;
    --muted: #746252;
    --accent: #bb5a3c;
    --accent-dark: #8e3b27;
    --success: #2f7d4b;
    --warning: #b67d19;
    --danger: #a0423c;
    --shadow: 0 24px 60px rgba(92, 61, 36, 0.14);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(187, 90, 60, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(47, 125, 75, 0.12), transparent 30%),
        linear-gradient(135deg, #f7f2e8 0%, #efe3d0 45%, #f4eee7 100%);
}

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

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

.page-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 18px 48px;
}

.narrow-shell {
    max-width: 560px;
    display: flex;
    align-items: center;
}

.hero-card,
.panel,
.flash {
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 28px;
    border-radius: 28px;
    background: rgba(54, 40, 30, 0.92);
    color: #fff9f0;
}

.compact-hero {
    align-items: center;
}

.hero-card h1,
.panel h1,
.panel h2 {
    margin: 8px 0 10px;
    line-height: 1.1;
}

.hero-card p,
.panel p,
label span,
.info-grid span,
.section-head span {
    color: var(--muted);
}

.hero-card p {
    color: rgba(255, 249, 240, 0.78);
    max-width: 640px;
}

.eyebrow {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffe5cb;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 24px;
}

.search-form {
    margin-bottom: 22px;
}

.search-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(72, 54, 39, 0.14);
    background: rgba(255, 253, 248, 0.95);
    color: var(--text);
}

button {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

button:hover {
    opacity: 0.94;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: inherit;
}

.result-card,
.auth-card {
    display: grid;
    gap: 18px;
}

.result-head,
.section-head,
.hero-actions,
.table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

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

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.badge-active {
    background: rgba(47, 125, 75, 0.12);
    color: var(--success);
}

.badge-paused,
.badge-expired {
    background: rgba(182, 125, 25, 0.14);
    color: var(--warning);
}

.badge-disabled {
    background: rgba(160, 66, 60, 0.14);
    color: var(--danger);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--panel-strong);
}

.flash-success {
    color: var(--success);
}

.flash-error {
    color: var(--danger);
}

.admin-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
}

.wide-panel,
.full-row {
    grid-column: span 1;
}

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

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

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

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(72, 54, 39, 0.1);
    text-align: left;
    vertical-align: top;
}

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

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    width: 78px;
}

.inline-form select {
    width: 88px;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(54, 40, 30, 0.08);
}

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

    .wide-panel,
    .full-row {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 20px 12px 32px;
    }

    .hero-card,
    .search-row,
    .result-head,
    .section-head,
    .table-actions,
    .inline-form,
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .ghost-link,
    button {
        width: 100%;
    }
}
