* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6f7;
    color: #303133;
}

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

button,
input,
select {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 10% 12%, rgba(45, 125, 228, 0.16), transparent 62%),
        radial-gradient(760px 520px at 92% 86%, rgba(103, 194, 58, 0.14), transparent 64%),
        linear-gradient(135deg, #f4f8ff 0%, #eef3fb 48%, #f6f9fc 100%);
}

.login-shell {
    max-width: 1120px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 56px;
    padding: 48px 40px;
}

.login-hero {
    flex: 1 1 auto;
    max-width: 520px;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #4c9bff 0%, #2d7de4 55%, #1b63c4 100%);
    box-shadow: 0 16px 32px rgba(45, 125, 228, 0.32);
    margin-bottom: 28px;
}

.login-hero h1 {
    margin: 0 0 16px;
    font-size: 38px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.login-hero > p {
    max-width: 480px;
    margin: 0 0 32px;
    font-size: 16px;
    line-height: 1.85;
    color: #5d6675;
}

.login-features {
    list-style: none;
    margin: 0 0 34px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-feature-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2d7de4;
    background: rgba(45, 125, 228, 0.1);
}

.login-feature-text strong {
    display: block;
    font-size: 15px;
    color: #2c3546;
    margin-bottom: 2px;
}

.login-feature-text span {
    font-size: 13px;
    color: #7a8496;
}

.login-stats {
    display: flex;
    gap: 36px;
    padding: 22px 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 46px rgba(31, 115, 216, 0.1);
}

.login-stats strong {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    color: #1f6fd8;
}

.login-stats span {
    font-size: 13px;
    color: #7a8496;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 32px;
    font-weight: 500;
    color: #1f6fd8;
    margin-bottom: 24px;
}

.brand-mark-small {
    font-size: 15px;
    margin-bottom: 0;
    color: #1867c8;
    letter-spacing: 0.2px;
}

.brand-logo-ring {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #1f6fd8;
    position: relative;
    display: inline-block;
}

.brand-logo-ring::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 7px;
    width: 2px;
    height: 6px;
    background: #1f6fd8;
    border-radius: 2px;
}

.login-panel {
    width: 400px;
    flex: 0 0 auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 40px 36px;
    border: 1px solid #e8edf3;
    box-shadow: 0 30px 70px rgba(27, 63, 116, 0.14);
}

.login-panel h2 {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: -0.4px;
}

.login-panel > p {
    margin: 0 0 26px;
    font-size: 14px;
    color: #697485;
}

.login-input {
    position: relative;
    display: block;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    display: inline-flex;
    color: #9aa4b2;
    pointer-events: none;
}

.login-form .login-input input {
    height: 46px;
    padding-left: 42px;
    border-radius: 10px;
    border-color: #e0e5ee;
    background: #fbfcfe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-form .login-input input:focus {
    outline: none;
    border-color: #2d7de4;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(45, 125, 228, 0.12);
}

.login-form .login-submit {
    height: 46px;
    min-width: 0;
    padding: 0;
    border-radius: 10px;
    font-size: 15px;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #4c9bff 0%, #2d7de4 100%);
    box-shadow: 0 14px 26px rgba(45, 125, 228, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-form .login-submit:hover {
    background: linear-gradient(135deg, #3d8ff5 0%, #236fce 100%);
    box-shadow: 0 18px 32px rgba(45, 125, 228, 0.34);
    transform: translateY(-1px);
}

.login-foot {
    margin: 22px 0 0;
    text-align: center;
    font-size: 12px;
    color: #a0a9b8;
}

@media (max-width: 900px) {
    .login-shell {
        flex-direction: column;
        justify-content: center;
        gap: 32px;
        padding: 32px 22px;
    }

    .login-hero {
        max-width: 100%;
    }

    .login-hero h1 {
        font-size: 30px;
    }

    .login-panel {
        width: 100%;
        max-width: 420px;
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form .login-field-label,
.field-group > span {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #41495a;
}

.login-form input,
.field-group input[type="date"],
.field-group input[type="text"],
.field-group input[type="password"],
.field-group select {
    width: 100%;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #dcdfe6;
    border-radius: 2px;
    background: #fff;
    color: #303133;
}

.btn {
    height: 38px;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    min-width: 80px;
    padding: 0 26px;
    background: #2d7de4;
    color: #fff;
}

.btn-primary:hover {
    background: #236fce;
}

.btn-light {
    min-width: 80px;
    padding: 0 20px;
    background: #ffffff;
    border-color: #dcdfe6;
    color: #606266;
}

.btn-export {
    border-style: dashed;
    color: #606266;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-error {
    background: #fff3f1;
    color: #d04a2f;
    border: 1px solid #ffd3cb;
}

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

.sidebar {
    width: 242px;
    background: #ffffff;
    border-right: 1px solid #eceff4;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 22px;
    border-bottom: 1px solid #edf1f6;
}

.sidebar-nav {
    padding-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 50px;
    padding: 0 24px;
    color: #4b5565;
    border-left: 2px solid transparent;
    font-size: 15px;
}

.sidebar-link.is-active {
    color: #176bd3;
    background: #edf5ff;
    border-left-color: #176bd3;
    font-weight: 600;
}

.sidebar-icon {
    display: inline-flex;
    width: 18px;
    justify-content: center;
    color: #748193;
}

.sidebar-link.is-active .sidebar-icon {
    color: #176bd3;
}

.main-content {
    flex: 1;
    padding: 0 17px 16px;
}

.topbar {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #909399;
    font-size: 12px;
}

.topbar-blank {
    justify-content: flex-end;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user a {
    color: #409eff;
}

.card {
    background: #fff;
    border-radius: 2px;
    margin-bottom: 12px;
    border: 1px solid #ebeef5;
    box-shadow: none;
}

.filter-card {
    padding: 20px 22px 18px;
}

.filter-grid {
    display: grid;
    gap: 24px;
    align-items: center;
}

.realtime-filter {
    grid-template-columns: 430px 220px 1fr 120px;
    grid-template-areas:
        "site date options actions";
}

.detail-filter {
    grid-template-columns: 310px 430px 1fr 120px;
}

.realtime-site-field {
    grid-area: site;
}

.realtime-date-group {
    grid-area: date;
    min-width: 0;
}

.realtime-options-field {
    grid-area: options;
    min-width: 0;
}

.realtime-actions-field {
    grid-area: actions;
    justify-content: flex-end;
}

.readonly-date {
    min-width: 118px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid #dcdfe6;
    border-radius: 2px;
    background: #f5f7fa;
    color: #606266;
    white-space: nowrap;
}

.field-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.field-group > span {
    margin-bottom: 0;
    white-space: nowrap;
    font-size: 14px;
    color: #303133;
    font-weight: 600;
}

.field-group select {
    min-width: 210px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-inputs input {
    width: 120px;
}

.date-sep {
    color: #6f7786;
}

.inline-options {
    gap: 14px;
    flex-wrap: wrap;
}

.realtime-options-field.inline-options {
    justify-content: flex-start;
}

.inline-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #606266;
    font-size: 14px;
}

.field-actions {
    display: flex;
    justify-content: flex-start;
}

.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 22px 10px;
    gap: 20px;
}

.toolbar-icons {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #606266;
    font-size: 18px;
    cursor: pointer;
}

.table-card {
    padding-bottom: 8px;
}

.table-wrap {
    padding: 0 22px 18px;
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
    table-layout: auto;
}

.report-table thead th {
    padding: 14px 12px;
    border-bottom: 1px solid #ebeef5;
    background: #fafafa;
    font-size: 13px;
    font-weight: 600;
    color: #303133;
    text-align: center;
    white-space: nowrap;
}

.report-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #ebeef5;
    font-size: 13px;
    color: #606266;
    text-align: center;
    white-space: nowrap;
}

.report-table tbody tr:hover {
    background: #fbfdff;
}

.sort-form {
    margin: 0;
}

.sort-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: #303133;
    font: inherit;
    cursor: pointer;
}

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    line-height: 0.8;
    color: #c0c4cc;
    font-size: 9px;
}

.sort-button.is-asc .sort-arrows i:first-child,
.sort-button.is-desc .sort-arrows i:last-child {
    color: #409eff;
}

.total-row td {
    background: #fafafa;
    font-size: 13px;
    color: #303133;
    font-weight: 500;
}

.chart-card {
    padding-bottom: 12px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #909399;
    font-size: 13px;
}

.chart-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: #909399;
    cursor: pointer;
}

.chart-toggle.is-active {
    color: #303133;
}

.chart-toggle:not(.is-active) .legend-dot {
    opacity: 0.35;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: middle;
}

.legend-gray {
    background: #c8ccd4;
}

.legend-green {
    background: #7bc86c;
}

.legend-orange {
    background: #f4b637;
}

.chart-wrap {
    padding: 6px 22px 16px;
}

.chart-wrap canvas {
    display: block;
    width: 100%;
    height: 240px;
    background: #fff;
}

.selection-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 22px 14px;
    padding: 8px 14px;
    border: 1px solid #b3d8ff;
    background: #ecf5ff;
    color: #4a7fb4;
    font-size: 13px;
}

.info-dot {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #3b94e8;
    color: #fff;
    font-size: 12px;
    font-style: normal;
}

.report-table-detail th:first-child,
.report-table-detail td:first-child {
    width: 40px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 22px 18px;
    flex-wrap: wrap;
}

.pagination-form {
    margin: 0;
}

.page-btn {
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    background: #ffffff;
    border-radius: 2px;
    color: #606266;
    cursor: pointer;
}

.page-btn.is-active {
    border-color: #409eff;
    background: #409eff;
    color: #ffffff;
}

.page-btn:disabled {
    color: #c0c4cc;
    cursor: not-allowed;
    background: #f5f7fa;
}

.report-table tbody td:nth-child(1),
.report-table tbody td:nth-child(2),
.report-table tbody td:nth-child(3),
.report-table thead th:nth-child(1),
.report-table thead th:nth-child(2),
.report-table thead th:nth-child(3) {
    text-align: left;
}

.report-table:not(.report-table-detail) tbody td:first-child,
.report-table:not(.report-table-detail) thead th:first-child {
    padding-left: 34px;
}

.report-table-detail tbody td:nth-child(2),
.report-table-detail thead th:nth-child(2) {
    text-align: center;
}

.report-table-detail tbody td:nth-child(3),
.report-table-detail thead th:nth-child(3),
.report-table-detail tbody td:nth-child(4),
.report-table-detail thead th:nth-child(4) {
    text-align: left;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: #2d7de4;
}

select,
input[type="date"],
input[type="text"],
input[type="password"] {
    outline: none;
}

select:focus,
input[type="date"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #8ab8f3;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

@media (max-width: 1280px) {
    .realtime-filter,
    .detail-filter {
        grid-template-columns: 1fr;
    }

    .field-actions {
        justify-content: flex-start;
    }

    .chart-legend {
        flex-wrap: wrap;
    }
}

.alert-success {
    background: #f0f9eb;
    color: #529b2e;
    border: 1px solid #d3ecd0;
}

.card-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #303133;
}

.card-hint {
    margin: 0;
    font-size: 12px;
    color: #909399;
}

.create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 0 22px 18px;
}

.create-form .field-group {
    display: block;
    width: 180px;
}

.create-form .field-group > span {
    margin-bottom: 6px;
    font-size: 13px;
}

.create-form .field-group input,
.create-form .field-group select {
    width: 100%;
    min-width: 0;
    height: 34px;
}

.users-table {
    min-width: 880px;
}

.users-table tbody td {
    text-align: left;
    vertical-align: middle;
}

.users-table input[type="text"],
.users-table input[type="password"],
.users-table input[type="number"],
.users-table select {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 2px;
    background: #fff;
    color: #303133;
}

.users-actions {
    white-space: nowrap;
}

.users-actions .btn {
    margin-right: 8px;
}

.discount-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.discount-input input {
    width: 96px;
}

.discount-input span {
    color: #606266;
}

.create-form .discount-input {
    display: flex;
    align-items: center;
    width: 100%;
}

.create-form .discount-input input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.btn-sm {
    height: 30px;
    min-width: 62px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-danger {
    min-width: 62px;
    padding: 0 14px;
    background: #fff;
    border-color: #f0b7ab;
    color: #d04a2f;
}

.btn-danger:hover {
    background: #fff3f1;
}

.text-muted {
    color: #c0c4cc;
    font-size: 13px;
}

.status-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.status-dot.is-on {
    background: #67c23a;
    box-shadow: 0 0 0 4px rgba(103, 194, 58, 0.18);
}

.status-dot.is-off {
    background: #f56c6c;
    box-shadow: 0 0 0 4px rgba(245, 108, 108, 0.18);
}

input[type="number"] {
    outline: none;
}

input[type="number"]:focus {
    border-color: #8ab8f3;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}
