* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #f4f7fb;
    color: #333;
}

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

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #2f4f72;
    color: #fff;
    padding: 0 0 30px;
}

.sidebar-brand {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #2c7dd4;
}

.sidebar-brand__logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 12px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 18px 0;
}

.sidebar-nav__link {
    padding: 13px 24px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-nav__link:hover,
.sidebar-nav__link.is-active {
    background: rgba(0, 0, 0, 0.12);
    border-left-color: #ff8f3d;
    color: #fff;
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: #2c7dd4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar__title {
    font-size: 18px;
    font-weight: 700;
}

.topbar__actions {
    display: flex;
    gap: 18px;
    font-size: 13px;
}

.content-panel {
    padding: 24px;
}

.card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e7edf5;
    box-shadow: 0 6px 14px rgba(36, 76, 126, 0.05);
}

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

.stat-card {
    padding: 18px 20px;
}

.stat-card__label {
    color: #7f8ea3;
    font-size: 13px;
    margin-bottom: 12px;
}

.stat-card__value {
    color: #2c7dd4;
    font-size: 28px;
    font-weight: 700;
}

.hero-card {
    padding: 24px;
}

.hero-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.hero-card__header h2 {
    margin: 0;
    font-size: 22px;
}

.hero-card__header span {
    color: #8a97a8;
    font-size: 13px;
}

.hero-card__body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.hero-card__intro p {
    margin: 0 0 18px;
    line-height: 1.8;
    color: #5b6778;
}

.hero-card__actions {
    display: flex;
    gap: 12px;
}

.hero-card__tips {
    border-left: 1px solid #edf2f8;
    padding-left: 20px;
}

.hero-card__tips h3 {
    margin-top: 0;
}

.hero-card__tips ul {
    margin: 0;
    padding-left: 18px;
    color: #6a7688;
    line-height: 1.9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 42px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 14px;
}

.btn--primary {
    background: #2c7dd4;
    color: #fff;
}

.btn--ghost {
    background: #eef5fc;
    color: #2c7dd4;
}

.empty-card {
    padding: 28px;
}

.notice {
    margin: 16px 24px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.notice--success {
    background: #ebf8ee;
    color: #1b7d3c;
}

.notice--error {
    background: #fff0f0;
    color: #b64040;
}

.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 0;
}

.guest-shell {
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}

.guest-notice {
    max-width: 760px;
    margin: 0 auto 16px;
}

.auth-card {
    width: 100%;
    max-width: 760px;
    padding: 28px;
}

.auth-card__header {
    margin-bottom: 24px;
}

.auth-card__header h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.auth-card__header p {
    margin: 0;
    color: #718093;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #516070;
    font-size: 14px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fff;
    font-size: 14px;
    color: #334155;
}

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

.form-field--grow {
    flex: 1;
}

.captcha-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.captcha-box {
    min-width: 180px;
    height: 78px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef5ff, #ddeaf9);
    border: 1px dashed #93b7df;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #2c7dd4;
}

.captcha-box span {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-card,
.table-card,
.section-card,
.step-card,
.wallet-grid,
.admin-grid,
.detail-card {
    margin-bottom: 20px;
}

.toolbar-card,
.table-card,
.section-card,
.step-card,
.detail-card {
    padding: 20px;
}

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

.toolbar-form .form-field,
.inline-form .form-field {
    min-width: 180px;
    flex: 1;
}

.inline-form input,
.inline-form select {
    min-width: 100px;
    min-height: 36px;
    border: 1px solid #d8e2ef;
    border-radius: 6px;
    padding: 6px 10px;
    background: #fff;
}

.inline-form .btn {
    min-width: 72px;
    height: 36px;
    padding: 0 12px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #edf2f8;
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: #6b7b8f;
    background: #fafcfe;
    font-weight: 600;
}

.status-tag {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #edf7ee;
    color: #2d8a43;
}

.status-tag--pending {
    background: #fff5e9;
    color: #c97a12;
}

.status-tag--closed {
    background: #eef2f7;
    color: #667387;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;
    border: 1px solid #d8e2ef;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #526273;
}

.pagination .is-current {
    background: #2c7dd4;
    color: #fff;
    border-color: #2c7dd4;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 22px;
}

.step-item {
    height: 72px;
    border-radius: 8px;
    background: #f5f7fa;
    border: 1px solid #e3e9f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b6;
    font-weight: 700;
}

.step-item.is-active {
    background: #f0f5ff;
    color: #2c7dd4;
    border-color: #98b8eb;
    box-shadow: inset 0 -3px 0 #2c7dd4;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.channel-card {
    min-height: 48px;
    border-radius: 8px;
    background: #f7f8fa;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f5f73;
    font-size: 13px;
    font-weight: 600;
}

.channel-card.is-active {
    background: #2c7dd4;
    border-color: #2c7dd4;
    color: #fff;
}

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

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

.qr-card {
    border: 1px dashed #b9cae0;
    border-radius: 10px;
    background: #f8fbff;
    padding: 16px;
}

.qr-placeholder {
    height: 220px;
    border-radius: 10px;
    background: repeating-linear-gradient(
        45deg,
        #e6edf7,
        #e6edf7 10px,
        #f8fbff 10px,
        #f8fbff 20px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e829a;
    font-size: 15px;
}

.qr-placeholder img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

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

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.summary-box {
    border-radius: 10px;
    background: #f8fbff;
    border: 1px solid #e2ebf5;
    padding: 16px;
}

.summary-box strong {
    display: block;
    font-size: 22px;
    color: #2c7dd4;
    margin-top: 8px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.page-header h2,
.section-card h3,
.detail-card h3 {
    margin: 0;
}

.muted {
    color: #7a8798;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .hero-card__body,
    .wallet-grid,
    .summary-grid,
    .steps,
    .channels-grid,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .captcha-row {
        flex-direction: column;
        align-items: stretch;
    }
}
