:root {
    --primary: #1f5eff;
    --primary-dark: #153eb1;
    --bg: #f4f7fb;
    --sidebar-bg: #0f2858;
    --sidebar-muted: #a6b4d7;
    --text: #1c2736;
    --muted: #6a7686;
    --border: #dbe3ef;
    --card: #ffffff;
    --danger: #d63c3c;
    --success: #198754;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: #0b2c62;
    color: #fff;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.brand {
    color: #fff;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.nav a {
    color: #dbe7ff;
}

.page {
    padding: 24px 0 40px;
}

.page-admin {
    padding: 24px;
}

.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 24px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.site-footer .container {
    display: flex;
    justify-content: center;
}

.site-footer a {
    display: inline-flex;
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--primary);
}

.page-header {
    margin-bottom: 18px;
}

.muted {
    color: var(--muted);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: start;
}

.admin-sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg), #12203f);
    color: #fff;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: grid;
    gap: 4px;
    color: #fff;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-brand-title {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand-subtitle {
    font-size: 12px;
    color: var(--sidebar-muted);
}

.sidebar-user {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user span {
    color: var(--sidebar-muted);
    font-size: 13px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a,
.sidebar-footer a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #eef3ff;
    transition: background 0.2s ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-footer a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
    margin-top: auto;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 24px 24px 18px;
}

.admin-topbar-title {
    margin: 0;
    font-size: 28px;
}

.admin-topbar-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(15, 31, 54, 0.06);
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 24px 20px;
}

.stat-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-box {
    height: 320px;
}

.hero-banner {
    display: flex;
    align-items: center;
    min-height: 240px;
    padding: 32px;
    border-radius: 18px;
    color: #fff;
    background-size: cover;
    background-position: center;
    margin-bottom: 20px;
}

.hero-banner h1 {
    margin: 0 0 12px;
    font-size: 34px;
}

.hero-banner p {
    max-width: 760px;
    line-height: 1.7;
}

.showcase-banner {
    min-height: 330px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    margin-bottom: 34px;
}

.showcase-content {
    text-align: center;
    color: #fff;
    max-width: 880px;
}

.showcase-content h1 {
    margin: 0 0 16px;
    font-size: 56px;
    line-height: 1.2;
    font-weight: 800;
}

.showcase-content p {
    margin: 0 auto;
    max-width: 760px;
    font-size: 22px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.92);
}

.homepage-section {
    padding: 18px 0 10px;
}

.homepage-section-title {
    text-align: center;
    margin-bottom: 28px;
}

.homepage-section-title h2 {
    margin: 0 0 12px;
    font-size: 42px;
    font-weight: 800;
    color: #182537;
}

.homepage-section-title p {
    margin: 0;
    font-size: 20px;
    line-height: 1.8;
    color: #6a7686;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 26px;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 22px;
    text-align: center;
    color: var(--text);
    box-shadow: 0 10px 26px rgba(15, 31, 54, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 31, 54, 0.1);
}

.feature-card h3 {
    margin: 0 0 12px;
    font-size: 28px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 17px;
}

.feature-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
}

.feature-icon-blue {
    background: rgba(31, 94, 255, 0.1);
    color: #4b68ff;
}

.feature-icon-green {
    background: rgba(25, 135, 84, 0.12);
    color: #2a9a62;
}

.feature-icon-orange {
    background: rgba(245, 158, 11, 0.14);
    color: #d98707;
}

.feature-icon-purple {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-light {
    background: #eef4ff;
    color: var(--primary);
}

.btn-link {
    padding: 0;
    background: none;
    color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

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

.form-grid label,
.inline-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

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

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 10px 0 0;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.radio-group input {
    width: auto;
}

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

.upload-panel {
    display: grid !important;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfcff, #f6f8fd);
    cursor: pointer;
}

.upload-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2f4a;
}

.upload-panel-desc {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.upload-dropzone {
    min-height: 220px;
    border: 1px dashed #b8c8ea;
    border-radius: 14px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

.upload-dropzone-logo {
    min-height: 220px;
}

.upload-input {
    width: 100%;
    padding: 10px 0 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.upload-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.upload-preview-logo {
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
}

.upload-placeholder {
    display: grid;
    gap: 8px;
    text-align: center;
    color: var(--muted);
    line-height: 1.6;
}

.upload-placeholder strong {
    color: var(--primary);
    font-size: 16px;
}

.upload-tips {
    margin-top: -6px;
    color: var(--muted);
    font-size: 13px;
}

.field-config-layout {
    display: block;
}

.field-config-manage {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    padding: 20px;
}

.field-config-manage h3 {
    margin-top: 0;
}

.field-config-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.field-create-form {
    display: grid;
    gap: 14px;
}

.field-create-form label {
    display: grid;
    gap: 8px;
}

.field-create-checks {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.field-create-checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0 0 8px;
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #7d8796;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.field-type-cell {
    min-width: 150px;
}

.field-type-select {
    min-width: 140px;
}

.danger-link {
    color: #d14343;
}

.danger-link:hover {
    color: #b62f2f;
}

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

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

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

.detail-grid,
.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-list,
.reply-list,
.simple-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.8;
}

.detail-kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
}

.detail-kv dt {
    font-weight: 700;
}

.detail-kv dd {
    margin: 0;
}

.reply-list li {
    margin-bottom: 12px;
}

.reply-meta {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.content-box {
    padding: 12px;
    border-radius: 12px;
    background: #f7f9fd;
    border: 1px solid var(--border);
    min-height: 120px;
    white-space: pre-wrap;
    line-height: 1.7;
}

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

.flash {
    padding: 12px 14px;
    border-radius: 10px;
}

.flash-success {
    background: rgba(25, 135, 84, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(214, 60, 60, 0.12);
    color: var(--danger);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.auth-wrap {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.auth-card {
    width: min(460px, 100%);
}

.hint-block {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    background: #eef4ff;
    color: #35508a;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.media-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.media-item img,
.media-item video {
    width: 100%;
    display: block;
}

.mobile-report-shell {
    width: min(100%, 420px);
    margin: 0 auto;
}

.mobile-report-card {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.mobile-report-image {
    width: 100%;
    border-radius: 6px;
    display: block;
    margin-bottom: 10px;
    object-fit: cover;
    max-height: 220px;
}

.mobile-report-title {
    text-align: center;
    display: grid;
    gap: 6px;
    margin: 6px 0 18px;
    color: #3466b3;
}

.mobile-report-title > div:first-child {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.mobile-report-title > div:last-child {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
}

.mobile-report-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    white-space: pre-wrap;
}

.report-form {
    display: grid;
    gap: 10px;
}

.report-submit-hint {
    font-size: 13px;
    color: #c26a00;
    background: #fff7e6;
    border: 1px solid #f3d19c;
    border-radius: 8px;
    padding: 10px 12px;
}

.report-form label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.report-form .field-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
}

.report-form .field-box input,
.report-form .field-box textarea,
.report-form .field-box select {
    border: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.report-form .field-box textarea {
    min-height: 88px;
}

.report-record-card {
    text-align: center;
}

.report-record-card h3 {
    margin: 0 0 12px;
}

.reply-preview-card,
.reply-preview-empty {
    display: grid;
    gap: 10px;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.reply-preview-meta {
    color: var(--muted);
    font-size: 12px;
}

.reply-preview-content {
    color: #1f2f4a;
    line-height: 1.8;
    white-space: pre-wrap;
}

.reply-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reply-preview-empty-text {
    color: var(--muted);
    font-size: 14px;
}

.report-submit-btn.is-submitting,
.report-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.report-record-tabs {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.report-record-tabs .active {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 1024px) {
    .charts-grid,
    .detail-grid,
    .two-col,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

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

    .upload-panel-grid {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        padding: 16px;
    }
}

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

    .admin-sidebar {
        gap: 14px;
    }

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

@media (max-width: 768px) {
    .topbar-inner {
        display: grid;
    }

    .hero-banner {
        min-height: 200px;
        padding: 24px;
    }

    .hero-banner h1 {
        font-size: 26px;
    }

    .showcase-content h1 {
        font-size: 34px;
    }

    .showcase-content p {
        font-size: 16px;
    }

    .homepage-section-title h2 {
        font-size: 30px;
    }

    .homepage-section-title p,
    .feature-card p {
        font-size: 15px;
    }

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

    .page-admin,
    .admin-topbar {
        padding: 18px 16px;
    }

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

    .sidebar-nav {
        grid-template-columns: 1fr 1fr;
    }

    .detail-kv {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
