:root {
    --ink: #1d2939;
    --muted: #667085;
    --line: #dfe7e4;
    --surface: rgba(255, 255, 255, .92);
    --shadow: 0 24px 70px rgba(30, 73, 65, .12);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: #eaf6f2; }
a { color: inherit; }
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #eaf7f1 0%, #f8f2f5 50%, #eaf1fa 100%); }
.panel { position: relative; width: min(980px, 100%); padding: clamp(32px, 6vw, 66px); overflow: hidden; text-align: center; border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(12px); animation: panelIn .75s ease-out both; }
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, #4fc3f7, #ff6b9e, #81c784, #ba68c8, #4dd0e1); }
h1 { position: relative; margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; letter-spacing: 0; color: #d43e5d; }
.subtitle, .footer-note { margin: 0 auto; max-width: 680px; color: #44515c; line-height: 1.7; }
.subtitle { font-size: clamp(1rem, 2.5vw, 1.2rem); }
.footer-note { margin-top: 28px; font-size: .95rem; color: var(--muted); }
.button-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.nav-button { grid-column: span 2; min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 18px; border-radius: 18px; color: var(--button-text); background: var(--button-color); box-shadow: 0 9px 20px rgba(31, 41, 55, .11); text-decoration: none; font-weight: 700; line-height: 1.35; transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; animation: buttonIn .55s ease-out both, buttonPulse 3.4s ease-in-out infinite; }
.nav-button::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.42) 48%, transparent 74%); transform: translateX(-120%); transition: transform .65s ease; pointer-events: none; }
.nav-button { position: relative; overflow: hidden; }
.nav-button:hover::before { transform: translateX(120%); }
.nav-button:nth-child(1) { animation-delay: .08s, .9s; }
.nav-button:nth-child(2) { animation-delay: .16s, 1.1s; }
.nav-button:nth-child(3) { animation-delay: .24s, 1.3s; }
.nav-button:nth-child(4) { animation-delay: .32s, 1.5s; }
.nav-button:nth-child(5) { animation-delay: .40s, 1.7s; }
.nav-button:nth-child(4) { grid-column: 2 / span 2; }
.nav-button:nth-child(5) { grid-column: 4 / span 2; }
.nav-button:hover { transform: translateY(-4px); filter: saturate(1.08); box-shadow: 0 15px 28px rgba(31, 41, 55, .16); }
.nav-button:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #1769aa; outline-offset: 2px; }
.arrow { opacity: .65; font-size: 1.2em; }
.decor { position: absolute; pointer-events: none; opacity: .34; font-size: 2.2rem; }
.decor-star { top: 14%; right: 8%; color: #f0ad4e; animation: float 4.5s ease-in-out infinite; }
.decor-leaf { bottom: 12%; left: 7%; color: #51a36a; animation: leafSpin 8s linear infinite; }
.decor-heart { top: 17%; left: 8%; color: #e96b8d; animation: heartBeat 2.5s ease-in-out infinite; }
.empty-state { margin: 36px 0; color: var(--muted); }

@keyframes panelIn { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes buttonIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes buttonPulse { 0%, 100% { box-shadow: 0 9px 20px rgba(31, 41, 55, .11); } 50% { box-shadow: 0 13px 26px rgba(31, 41, 55, .17); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(5deg); } }
@keyframes leafSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.admin-body { min-height: 100vh; padding: 28px; background: #f4f7f6; }
.admin-wrap { width: min(1100px, 100%); margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 12px 0 22px; }
.admin-header h1, .login-card h1 { margin: 0; color: var(--ink); font-size: 2rem; }
.eyebrow { margin: 0 0 7px; color: #2b8a78; font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.muted, .hint, .section-heading p { color: var(--muted); line-height: 1.6; }
.header-actions { display: flex; gap: 14px; }
.header-actions a { color: #1769aa; font-weight: 700; text-decoration: none; }
.admin-card { border: 1px solid var(--line); border-radius: 16px; padding: 26px; background: #fff; box-shadow: 0 12px 40px rgba(28, 66, 59, .07); }
.login-card { width: min(460px, 100%); margin: 10vh auto 0; }
.stack-form, .form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #475467; font-size: .9rem; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #cfdad6; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; font-weight: 400; }
textarea { resize: vertical; }
input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
input[type="file"] { padding: 8px; }
.form-section + .form-section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.2rem; }
.section-heading p { margin: 4px 0 0; font-size: .88rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.button-editor { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(260px, 1.8fr) 95px 95px 80px 52px; align-items: end; gap: 12px; padding: 16px 0; border-top: 1px solid #edf1ef; }
.button-editor:first-child { border-top: 0; }
.check-label { display: flex; align-items: center; gap: 7px; height: 42px; white-space: nowrap; }
.check-label input { width: auto; }
button { border: 0; border-radius: 9px; padding: 11px 16px; font: inherit; font-weight: 800; cursor: pointer; }
.primary-button { color: #fff; background: #227d6d; }
.primary-button:hover { background: #176858; }
.secondary-button { color: #176858; background: #e4f2ee; }
.icon-button { color: #b42318; background: #fff0ef; }
.save-row { display: flex; justify-content: flex-end; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.stats-card { margin-top: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.stat-card { padding: 16px; border: 1px solid #e4ece9; border-radius: 12px; background: #f8fbfa; }
.stat-card span { display: block; color: var(--muted); font-size: .82rem; }
.stat-card strong { display: block; margin-top: 7px; color: #227d6d; font-size: 1.8rem; }
.stats-table-wrap { margin-top: 20px; overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stats-table th, .stats-table td { padding: 11px 10px; border-top: 1px solid #edf1ef; text-align: left; }
.stats-table th:last-child, .stats-table td:last-child { width: 130px; text-align: right; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 9px; }
.alert.success { color: #176858; background: #e4f2ee; }
.alert.error { color: #a21b12; background: #fff0ef; }
code { padding: 2px 5px; border-radius: 4px; background: #eef2f0; }

@media (max-width: 760px) {
    .page-shell, .admin-body { padding: 16px; }
    .panel { padding: 34px 18px; border-radius: 20px; }
    .button-grid { grid-template-columns: 1fr; gap: 12px; }
    .nav-button, .nav-button:nth-child(4), .nav-button:nth-child(5) { grid-column: auto; min-height: 62px; }
    .admin-header, .section-heading { align-items: flex-start; flex-direction: column; }
    .admin-card { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .wide { grid-column: auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .button-editor { grid-template-columns: 1fr 1fr; }
    .button-editor .url-field { grid-column: 1 / -1; }
    .button-editor .icon-button { justify-self: end; }
}
