/* ============================================================
 * Site Custom Styles - Bootstrap 5 Rebuild
 * 统一的用户前台样式，基于 Bootstrap 5 原生组件
 * ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --site-primary: #667eea;
    --site-primary-dark: #5a6fd6;
    --site-secondary: #764ba2;
    --site-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --site-sidebar-bg: #1e293b;
    --site-sidebar-hover: rgba(255, 255, 255, 0.08);
    --site-sidebar-active: rgba(102, 126, 234, 0.2);
    --site-sidebar-width: 250px;
    --site-topbar-height: 60px;
    --site-body-bg: #f1f5f9;
    --site-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --site-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --site-radius: 0.5rem;
}

/* ---------- Base Layout ---------- */
body {
    background-color: var(--site-body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--site-sidebar-width);
    background: var(--site-sidebar-bg);
    color: #cbd5e1;
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: var(--site-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-nav .nav-item {
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    gap: 0.75rem;
}

.sidebar-nav .nav-link:hover {
    color: #e2e8f0;
    background: var(--site-sidebar-hover);
    border-left-color: var(--site-primary);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--site-sidebar-active);
    border-left-color: var(--site-primary);
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-nav .nav-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

/* ---------- Main Content ---------- */
.main-wrapper {
    margin-left: var(--site-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Top Navbar ---------- */
.top-navbar {
    height: var(--site-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.top-navbar .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.top-navbar .navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--site-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-detail {
    line-height: 1.3;
}

.user-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.user-status {
    font-size: 0.75rem;
    color: #64748b;
}

.user-status.verified {
    color: var(--bs-success);
}

/* ---------- Content Area ---------- */
.content-area {
    flex: 1;
    padding: 1.5rem;
}

/* ---------- Card Overrides ---------- */
.content-area .card {
    border: none;
    box-shadow: var(--site-card-shadow);
    border-radius: var(--site-radius);
    transition: box-shadow 0.2s ease;
}

.content-area .card:hover {
    box-shadow: var(--site-card-shadow-hover);
}

.content-area .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    border-radius: var(--site-radius) var(--site-radius) 0 0;
}

.content-area .card-header h4,
.content-area .card-header h5,
.content-area .card-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.content-area .card-body {
    padding: 1.25rem;
}

/* ---------- Dashboard Balance Card ---------- */
.balance-card {
    background: var(--site-gradient) !important;
    color: #fff !important;
    border-radius: var(--site-radius) !important;
    border: none !important;
}

.balance-card .balance-amount {
    font-size: 2rem;
    font-weight: 700;
}

.balance-card .balance-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.bg-primary-soft { background: rgba(102, 126, 234, 0.1); color: var(--site-primary); }
.stat-icon.bg-success-soft { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.stat-icon.bg-info-soft { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.bg-warning-soft { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* ---------- Quick Action Buttons ---------- */
.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* ---------- Badge Colors (BS5 compat) ---------- */
.badge-primary { background-color: var(--site-primary); color: #fff; }
.badge-success { background-color: #22c55e; color: #fff; }
.badge-warning { background-color: #f59e0b; color: #fff; }
.badge-danger { background-color: #ef4444; color: #fff; }
.badge-info { background-color: #3b82f6; color: #fff; }

/* ---------- Auth Pages (Login / Register / Forgot / Reset) ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--site-body-bg);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 2.5rem 2rem;
}

.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 0.75rem;
    background: var(--site-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1rem;
    margin-bottom: 1.75rem;
}

.auth-card .form-control {
    height: 44px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card .form-control:focus {
    border-color: var(--site-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-card .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

.btn-auth {
    width: 100%;
    height: 44px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: var(--site-gradient);
    border: none;
    color: #fff;
    transition: opacity 0.2s ease;
}

.btn-auth:hover {
    opacity: 0.9;
    color: #fff;
}

.auth-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

.auth-links a {
    color: var(--site-primary);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ---------- Language Switcher ---------- */
.lang-switcher .dropdown-menu {
    min-width: 120px;
}

.lang-switcher .dropdown-item.active {
    background-color: var(--site-primary);
    color: #fff;
}

.lang-switcher-auth {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

/* ---------- Verification Code Row ---------- */
.code-row {
    display: flex;
    gap: 0.5rem;
}

.code-row input {
    flex: 1;
}

.code-row .btn {
    white-space: nowrap;
    min-width: 110px;
}

/* ---------- Sidebar Toggle (Mobile) ---------- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #475569;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        transform: translateX(-100%);
    }

    .sidebar-wrapper.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 1rem;
    }

    .top-navbar {
        padding: 0 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .balance-card .balance-amount {
        font-size: 1.5rem;
    }
}

/* ---------- Table Style Overrides ---------- */
.content-area .table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}

.content-area .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #334155;
}

/* ---------- Pagination Override ---------- */
.content-area .pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 2px;
    font-size: 0.875rem;
}

/* ---------- Dispatch Jump Page ---------- */
.jump-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.jump-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
}

.jump-icon.success { background: var(--site-gradient); }
.jump-icon.error { background: linear-gradient(135deg, #ef4444, #dc2626); }

.jump-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.jump-detail {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.jump-countdown {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.jump-countdown b {
    color: var(--site-primary);
    font-size: 1.1rem;
}

.jump-progress {
    height: 3px;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.jump-progress .progress-bar {
    transition: width 1s linear;
}

.btn-jump-primary {
    background: var(--site-gradient);
    color: #fff;
    border: none;
}

.btn-jump-primary:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-jump-secondary {
    background: #f1f5f9;
    color: var(--site-primary);
    border: 1px solid #e2e8f0;
}

.btn-jump-secondary:hover {
    border-color: var(--site-primary);
}
