:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --success-dark: #3a86ff;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #7209b7;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 15px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.logo-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.logo i {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50%;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
}

.header-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.9;
    flex-wrap: wrap;
    gap: 10px;
}

.main-content {
    display: flex;
    margin-top: 15px;
    gap: 15px;
    flex-direction: column;
}

.sidebar {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    height: fit-content;
    overflow-x: auto;
    display: flex;
    flex-direction: row;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--transition);
    border-left: none;
    border-bottom: 4px solid transparent;
    color: var(--gray);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--gray-light);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.content-area {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    min-height: 500px;
    overflow-x: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-light);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-description {
    color: var(--gray);
    font-size: 14px;
}

.form-container {
    background: var(--light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-control:read-only {
    background: var(--gray-light);
    color: var(--gray);
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-dark);
    color: white;
}

.btn-success:hover {
    background: var(--success);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e76f51;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b5179e;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 10px 14px;
    font-size: 14px;
}

.account-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.account-card {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.account-card.success {
    border-top-color: var(--success-dark);
}

.card-icon {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--primary);
}

.account-card.success .card-icon {
    color: var(--success-dark);
}

.card-title {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.result-container {
    margin-top: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

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

.result-box {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-light);
}

.json-view {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.json-key {
    color: var(--primary);
}

.json-string {
    color: var(--success-dark);
}

.json-number {
    color: var(--warning);
}

.json-boolean {
    color: var(--danger);
}

.json-null {
    color: var(--gray);
}

.phone-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.phone-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.phone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.phone-number {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.phone-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.phone-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray);
}

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

.phone-actions .btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    color: var(--gray);
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: var(--gray);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 12px;
    overflow-x: auto;
}

.tab-button {
    padding: 10px 15px;
    background: var(--gray-light);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-button.active {
    background: var(--primary);
    color: white;
}

.response-time {
    font-size: 13px;
    color: var(--gray);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification {
    position: fixed;
    top: 15px;
    right: 15px;
    left: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateY(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    width: 100%;
    max-width: 450px;
}

.usage-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.usage-card {
    flex: 1;
    background: var(--light);
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
}

.usage-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.usage-label {
    font-size: 13px;
    color: var(--gray);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.log-table th, .log-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.log-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.log-table tr:hover {
    background: var(--light);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-success {
    background: rgba(60, 201, 240, 0.1);
    color: var(--success-dark);
}

.status-error {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.user-table th, .user-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.user-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.user-table tr:hover {
    background: var(--light);
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.role-admin {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger);
}

.role-user {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.role-reseller {
    background: rgba(76, 201, 240, 0.1);
    color: var(--success-dark);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--box-shadow);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
}

.copy-btn {
    position: absolute;
    right: 10px;
    top: 38px;
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary);
}

.message-result {
    margin-top: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--border-radius);
}

.message-content {
    margin-bottom: 12px;
}

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

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.text-muted {
    color: var(--gray);
}

/* 平板和桌面样式 */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .main-content {
        flex-direction: row;
    }
    
    .sidebar {
        width: 280px;
        flex-direction: column;
        overflow-x: visible;
    }
    
    .nav-item {
        border-left: 4px solid transparent;
        border-bottom: none;
    }
    
    .nav-item.active {
        border-left-color: var(--primary);
        border-bottom: none;
    }
    
    .form-row {
        flex-direction: row;
    }
    
    .account-cards {
        flex-direction: row;
    }
    
    .phone-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .usage-info {
        flex-direction: row;
    }
    
    .btn {
        width: auto;
    }
    
    .notification {
        left: auto;
        right: 20px;
        width: auto;
        max-width: 400px;
    }
}

@media (min-width: 992px) {
    .phone-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}