/* ===== CSS Variables ===== */
:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
    --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== Auth Page ===== */
.auth-container {
    display: flex;
    min-height: 100vh;
}
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: float 20s infinite linear;
}
@keyframes float {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.auth-brand { text-align: center; position: relative; z-index: 1; }
.brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
}
.auth-brand h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-brand p { opacity: 0.85; font-size: 1.1rem; }
.auth-features {
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 1rem;
    opacity: 0.9;
}
.feature-item i { font-size: 1.2rem; width: 24px; text-align: center; }

.auth-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}
.auth-form { width: 100%; max-width: 360px; display: none; }
.auth-form.active { display: block; }
.auth-form h2 { font-size: 1.75rem; color: var(--gray-900); margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--gray-500); margin-bottom: 2rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; color: var(--gray-500); }
.auth-switch a { font-weight: 500; }

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}
.form-group label i { color: var(--gray-400); margin-right: 0.25rem; width: 16px; }
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea,
.form-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--gray-800);
}
.form-group input:focus,
.form-select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-select { cursor: pointer; }
.required { color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.code-input { display: flex; gap: 0.75rem; }
.code-input input { flex: 1; }
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    cursor: pointer;
}
.link { color: var(--primary); font-size: 0.9rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-outline { background: white; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}
.btn-icon:hover { background: var(--gray-100); color: var(--primary); }

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: var(--transition);
}
.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon-sm {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.brand-text { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: 0.95rem;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.user-detail { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 500; }
.user-phone { font-size: 0.75rem; color: var(--gray-500); }
.logout-btn { color: var(--gray-500); transition: var(--transition); }
.logout-btn:hover { color: var(--danger); }

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
}
.topbar-title { font-weight: 600; font-size: 1.1rem; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.balance-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}
.balance-badge:hover { background: var(--primary); color: white; }
.balance-badge i { font-size: 0.85rem; }

/* ===== Content Pages ===== */
.content-page { display: none; padding: 1.5rem; }
.content-page.active { display: block; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-balance::before { background: var(--primary); }
.stat-orders::before { background: var(--success); }
.stat-month::before { background: var(--info); }
.stat-spent::before { background: var(--warning); }
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.stat-balance .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-orders .stat-icon { background: #d1fae5; color: var(--success); }
.stat-month .stat-icon { background: #dbeafe; color: var(--info); }
.stat-spent .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-label { font-size: 0.85rem; color: var(--gray-500); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.stat-action {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: auto;
}
.stat-action:hover { color: var(--primary); }

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-header h3 i { color: var(--primary); }
.card-body { padding: 1.25rem; }
.card-actions { display: flex; align-items: center; gap: 0.75rem; }
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.25rem;
}

/* ===== Quick Actions ===== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--gray-700);
}
.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.action-btn i { font-size: 1.5rem; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1rem; }

/* ===== Order Form ===== */
.order-form { max-width: 800px; }
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-section h4 i { color: var(--primary); }
.address-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.75rem;
}

/* Express Options */
.express-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.express-option {
    display: block;
    cursor: pointer;
}
.express-option input { display: none; }
.option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.express-option input:checked + .option-content {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.express-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}
.express-logo.sf { background: #1a1a1a; }
.express-logo.zt { background: #ff6600; }
.express-logo.yd { background: #cc0000; }
.express-logo.yt { background: #7b2d8b; }
.option-info { flex: 1; }
.option-name { display: block; font-weight: 500; font-size: 0.9rem; }
.option-desc { display: block; font-size: 0.75rem; color: var(--gray-500); }
.option-price { font-weight: 600; color: var(--danger); font-size: 0.9rem; }

/* Cost Estimate */
.cost-estimate {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 1.25rem !important;
    border: 1px dashed var(--gray-300) !important;
}
.estimate-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}
.estimate-price { font-size: 1.5rem; font-weight: 700; color: var(--danger); }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
}

/* ===== Data Table ===== */
.table-container { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
}
.data-table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    white-space: nowrap;
}
.data-table td { color: var(--gray-700); }
.data-table tbody tr:hover { background: var(--gray-50); }
.empty-row td { border: none !important; }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-transit { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}
.search-box i { color: var(--gray-400); font-size: 0.85rem; }
.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    width: 160px;
}
.form-select-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}
.page-info { font-size: 0.85rem; color: var(--gray-500); }

/* ===== Balance Page ===== */
.balance-header { margin-bottom: 1.5rem; }
.balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.balance-label { font-size: 1rem; opacity: 0.85; display: block; margin-bottom: 0.5rem; }
.balance-amount { font-size: 2.5rem; font-weight: 700; }

/* ===== API Page ===== */
.api-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.api-info-item label {
    display: block;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.api-value-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
}
.api-value-box code {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    word-break: break-all;
}
.btn-copy { color: var(--gray-400); }
.btn-copy:hover { color: var(--primary); }

.api-section { margin-bottom: 2rem; }
.api-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.api-section h4 i { color: var(--primary); }
.api-list { display: flex; flex-direction: column; gap: 0.5rem; }
.api-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.api-item:hover { border-color: var(--primary); background: var(--primary-bg); }
.api-method {
    background: var(--success);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}
.api-detail { flex: 1; }
.api-name { display: block; font-weight: 500; font-size: 0.9rem; }
.api-desc { display: block; font-size: 0.8rem; color: var(--gray-500); }
.api-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}
.status-active { background: #d1fae5; color: #065f46; }
.text-muted { color: var(--gray-500); margin-bottom: 0.75rem; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.modal-header h3 i { color: var(--primary); }
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-400);
    cursor: pointer;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

/* Recharge */
.recharge-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.recharge-option {
    padding: 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-700);
}
.recharge-option:hover { border-color: var(--primary); color: var(--primary); }
.recharge-option.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.recharge-custom { grid-column: span 3; }
.recharge-custom input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}
.recharge-info { color: var(--gray-500); font-size: 0.85rem; }
.recharge-info p { margin-bottom: 0.4rem; }
.recharge-info i { color: var(--success); margin-right: 0.3rem; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .api-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .auth-left { display: none; }
    .auth-right { width: 100%; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .express-options { grid-template-columns: 1fr; }
    .address-row { grid-template-columns: 1fr; }
    .balance-card { flex-direction: column; text-align: center; gap: 1.5rem; }
    .card-actions { flex-direction: column; align-items: flex-end; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-page { padding: 1rem; }
    .recharge-amounts { grid-template-columns: repeat(2, 1fr); }
    .recharge-custom { grid-column: span 2; }
}

/* ===== 3列统计 ===== */
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== 订单列表项（控制台） ===== */
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.order-item:last-child { border-bottom: none; }
.order-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.order-item-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--gray-500); }
.order-no { font-family: 'SF Mono', monospace; font-size: 0.8rem; color: var(--gray-600); }
.order-price { font-weight: 600; color: var(--gray-800); }

/* ===== 文档页 ===== */
.doc-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--gray-100); }
.doc-section:last-child { border-bottom: none; margin-bottom: 0; }
.doc-section h4 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.doc-section h4 i { color: var(--primary); }
.doc-section h5 { font-size: 0.9rem; font-weight: 600; color: var(--gray-700); margin: 1rem 0 0.5rem; }
.doc-section p { color: var(--gray-600); line-height: 1.7; }
.doc-table-wrap { margin-top: 1rem; }
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.doc-table th, .doc-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--gray-200);
    text-align: left;
}
.doc-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-600); }
.doc-table code { background: var(--primary-bg); color: var(--primary); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.8rem; }
.code-block {
    background: var(--gray-900);
    color: #a5f3fc;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
}

/* ===== 订单详情弹窗 ===== */
.modal-lg { max-width: 600px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-section h5 { font-size: 0.9rem; font-weight: 600; color: var(--primary); margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--gray-100); }
.detail-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 0.9rem; }
.detail-row span:first-child { color: var(--gray-500); }
.detail-row span:last-child { color: var(--gray-800); font-weight: 500; }

/* ===== 文本颜色 ===== */
.text-success { color: var(--success) !important; }
.text-danger, .text-danger code { color: var(--danger) !important; }

/* ===== 管理员页面响应式 ===== */
@media (max-width: 1024px) {
    .stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .stats-grid-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

/* ===== API Key 预览 ===== */
.api-key-preview { font-family: 'SF Mono', monospace; font-size: 0.85rem !important; letter-spacing: -0.5px; }

/* ===== 密钥页面 ===== */
.keys-notice {
    display: flex; align-items: center; gap: 0.75rem;
    background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius-sm);
    padding: 0.9rem 1.25rem; margin-bottom: 1.5rem; font-size: 0.9rem; color: #92400e;
}
.keys-notice i { font-size: 1.2rem; color: #d97706; }
.secret-blur { filter: blur(5px); transition: filter 0.2s; cursor: default; user-select: none; }
.auth-methods { border-top: 1px solid var(--gray-100); padding-top: 1.5rem; }
.auth-methods h4 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.auth-methods h4 i { color: var(--primary); }
.auth-method-item {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--gray-50);
    font-size: 0.9rem;
}
.auth-method-item small { color: var(--gray-500); }
.auth-method-item code { background: var(--gray-100); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.8rem; }

/* ===== 卡密管理 ===== */
.card-generate-box { background: linear-gradient(135deg, var(--primary-light), #e8e0ff); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-generate-box h3 { margin-bottom: 1rem; color: var(--primary); }
.card-generate-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.card-generate-row .form-group { flex: 1; min-width: 150px; margin-bottom: 0; }
.card-cost-info { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.5rem; }
.card-cost-info strong { color: var(--primary); }
.card-secret { font-family: 'Courier New', monospace; font-size: 0.85rem; background: var(--gray-100); padding: 0.15rem 0.4rem; border-radius: 3px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--gray-500); padding: 0.2rem; font-size: 0.8rem; }
.btn-icon:hover { color: var(--primary); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* ===== 个人设置 ===== */
.settings-section { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.settings-section h3 { font-size: 1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--gray-100); }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .settings-row { grid-template-columns: 1fr; } }

/* ===== 管理员子标签 ===== */
.admin-sub-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-sub-tab { padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; background: var(--gray-100); color: var(--gray-600); border: none; transition: all 0.2s; }
.admin-sub-tab.active { background: var(--primary); color: white; }
.admin-sub-tab:hover { background: var(--primary-light); }
.admin-sub-page { display: none; }
.admin-sub-page.active { display: block; }

/* ===== 管理员用户详情 ===== */
.user-detail-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.user-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.user-detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.user-stat-item { text-align: center; padding: 0.75rem; background: var(--gray-50); border-radius: var(--radius); }
.user-stat-item .stat-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.user-stat-item .stat-label { font-size: 0.75rem; color: var(--gray-500); }
.method-badge {
    background: var(--primary-bg); color: var(--primary); font-weight: 600; font-size: 0.75rem;
    padding: 0.2rem 0.6rem; border-radius: 4px; white-space: nowrap; min-width: 50px; text-align: center;
}

/* ===== API 文档交互 ===== */
.api-base-url { font-size: 0.85rem; color: var(--gray-500); display: flex; align-items: center; gap: 0.5rem; }
.api-base-url code { background: var(--gray-100); padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8rem; color: var(--primary); }
.doc-list { padding-left: 1.5rem; margin-bottom: 1rem; }
.doc-list li { margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--gray-600); }
.doc-list code { background: var(--gray-100); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.8rem; }

.doc-api-list { display: flex; flex-direction: column; gap: 0.5rem; }
.doc-api-item {
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    overflow: hidden; cursor: pointer; transition: var(--transition);
}
.doc-api-item:hover { border-color: var(--primary-light); }
.doc-api-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; background: white;
}
.doc-api-path { font-size: 0.85rem; color: var(--gray-700); flex: 1; }
.doc-api-title { font-size: 0.85rem; color: var(--gray-500); }
.doc-api-arrow { color: var(--gray-400); transition: transform 0.2s; font-size: 0.8rem; }
.doc-api-detail {
    padding: 1rem 1.25rem; background: var(--gray-50);
    border-top: 1px solid var(--gray-100); font-size: 0.9rem;
}
.doc-api-detail p { color: var(--gray-600); margin-bottom: 0.75rem; }
.doc-sub { margin-bottom: 0.75rem; }
.doc-sub strong { display: block; font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.4rem; }

/* Method badges */
.method-get { background: var(--success); }
.method-post { background: var(--info); }
.method-info { background: var(--gray-500); }
.auth-tag { color: var(--gray-400); font-size: 0.75rem; }

/* Doc group title */
.doc-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    padding: 0.75rem 0 0.4rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid var(--primary-bg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.doc-group-title:first-child { margin-top: 0; }

/* ===== Provider 卡片 ===== */
.provider-card {
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    padding: 1rem; margin-bottom: 0.75rem;
}
.provider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.provider-detail .detail-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.85rem; }
.provider-detail .detail-row span:first-child { color: var(--gray-500); }
.provider-detail code { font-size: 0.8rem; color: var(--primary); }

/* ===== Loading States ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Fade In Animation ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeIn 0.3s ease-out; }

/* ===== Toast Improvements ===== */
.toast {
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Card Hover Effects ===== */
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* ===== Better Focus States ===== */
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.empty-state-hint {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* ===== Badge Improvements ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-card { height: 100px; }

/* ===== Mobile Menu Overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    .sidebar.open ~ .sidebar-overlay { display: block; }
}

/* ===== Share Link Box ===== */
.share-link-desc {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.share-link-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.share-link-input-wrap {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0 14px;
    transition: var(--transition);
}
.share-link-input-wrap:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
.share-link-icon {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-right: 10px;
    flex-shrink: 0;
}
.share-link-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--gray-700);
    outline: none;
    min-width: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: text;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: -0.02em;
}
.share-link-input::placeholder {
    color: var(--gray-400);
    font-family: inherit;
    letter-spacing: normal;
}
.share-link-actions {
    display: flex;
    gap: 8px;
}
.share-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 42px;
}
.share-link-btn-copy {
    background: var(--primary);
    color: #fff;
    flex: 1;
}
.share-link-btn-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.share-link-btn-copy:active {
    transform: translateY(0);
}
.share-link-btn-open {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
}
.share-link-btn-open:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Mobile: stack buttons */
@media (max-width: 480px) {
    .share-link-actions {
        flex-direction: column;
    }
    .share-link-btn {
        width: 100%;
        min-height: 46px;
        font-size: 0.9rem;
    }
}


/* ===== 运费查询结果样式 ===== */
.shipping-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.shipping-result-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.2s;
}

.shipping-result-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.shipping-result-item .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.shipping-result-item .carrier-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 1rem;
}

.shipping-result-item .result-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.shipping-result-item .result-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.shipping-result-item .original-price {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.shipping-result-item .discount-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.shipping-result-item .result-info {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.shipping-result-item .result-info span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 充值模态框样式 */
.recharge-quick-amounts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 16px 0;
}
.recharge-quick-amounts button {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.recharge-quick-amounts button:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}
#qrcode-container {
    display: inline-block;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
#qrcode-container img {
    max-width: 250px;
    height: auto;
}
