* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #4a90d9;
    text-decoration: none;
}

a:hover {
    color: #357abd;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert.error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert.success {
    background: #efe;
    color: #0a0;
    border: 1px solid #cfc;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 12px;
}

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

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 20px;
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.data-table td {
    color: #333;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
    font-weight: 600;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.login-footer a {
    margin: 0 8px;
}

.front-page .main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.front-page .main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.front-page .logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.front-page .main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.front-page .main-nav a {
    color: #555;
    font-weight: 500;
}

.front-page .main-nav a:hover {
    color: #667eea;
}

.hero-section {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
}

.hero-content h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.hero-buttons .btn-outline {
    border-color: #fff;
    color: #fff;
}

.hero-buttons .btn-outline:hover {
    background: #fff;
    color: #667eea;
}

.features-section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 48px;
    color: #333;
}

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

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.feature-card p {
    color: #888;
    font-size: 14px;
}

.main-footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 24px 0;
}

.admin-body .admin-wrapper,
.user-body .user-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

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

.sidebar-nav > ul > li > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
}

.sidebar-nav > ul > li > a:hover,
.sidebar-nav > ul > li.active > a {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .icon {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-nav .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s;
}

.sidebar-nav .submenu {
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-nav .has-submenu.open .submenu {
    display: block;
}

.sidebar-nav .has-submenu.open .arrow {
    transform: rotate(180deg);
}

.sidebar-nav .submenu li a {
    display: block;
    padding: 10px 20px 10px 52px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.sidebar-nav .submenu li a:hover,
.sidebar-nav .submenu li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .logout-btn {
    display: block;
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    margin-top: 10px;
}

.sidebar-footer .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.main-content {
    flex: 1;
    margin-left: 240px;
    background: #f5f7fa;
}

.top-bar {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    font-size: 14px;
}

.user-info .balance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.content-area {
    padding: 24px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.stat-icon.users {
    background: rgba(102, 126, 234, 0.1);
}

.stat-icon.products {
    background: rgba(118, 75, 162, 0.1);
}

.stat-icon.proxies {
    background: rgba(40, 167, 69, 0.1);
}

.stat-icon.orders {
    background: rgba(255, 193, 7, 0.1);
}

.stat-icon.revenue {
    background: rgba(220, 53, 69, 0.1);
}

.stat-icon.balance {
    background: rgba(102, 126, 234, 0.1);
}

.stat-info h4 {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

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

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-4px);
}

.quick-action-btn .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.balance-display {
    text-align: center;
    padding: 32px;
}

.balance-label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.amount-option {
    display: block;
}

.amount-option input {
    display: none;
}

.amount-option span {
    display: block;
    padding: 16px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.amount-option input:checked + span {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.pay-options {
    display: flex;
    gap: 16px;
}

.pay-option {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.pay-option input {
    display: none;
}

.pay-option input:checked + .pay-icon + span {
    color: #667eea;
}

.pay-option:has(input:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.pay-icon {
    font-size: 24px;
    margin-right: 8px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.product-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.product-body {
    padding: 20px;
}

.product-desc {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.product-stock {
    color: #888;
    font-size: 14px;
}

.product-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.proxy-info {
    margin-bottom: 16px;
}

.proxy-info p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.proxy-code {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state p {
    margin-bottom: 16px;
}

.info-box {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.info-box p {
    margin-bottom: 8px;
    color: #666;
}

.info-box code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h3,
    .sidebar-nav span:not(.icon),
    .sidebar-footer .logout-btn {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
}

/* 代理购买页面样式已移至 proxy-buy.css */
