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

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

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #2c3e50;
    color: #ecf0f1;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    background: #1a252f;
    border-bottom: 1px solid #34495e;
}

.logo h2 {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    padding: 10px 0;
}

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

.nav-menu li {
    margin: 2px 0;
}

.nav-section {
    padding: 15px 20px 8px;
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-menu a {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: #34495e;
    padding-left: 25px;
}

.nav-menu a.active {
    background: #3498db;
    border-left: 4px solid #2980b9;
    padding-left: 21px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    background: #fff;
}

.content {
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #229954;
}

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

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

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

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

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

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

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

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

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

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

.table .actions {
    display: flex;
    gap: 10px;
}

.table .actions button {
    padding: 5px 12px;
    font-size: 12px;
}

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

.badge-primary {
    background: #3498db;
    color: #fff;
}

.badge-success {
    background: #27ae60;
    color: #fff;
}

.badge-warning {
    background: #f39c12;
    color: #fff;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #95a5a6;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.close-modal:hover {
    color: #2c3e50;
}

.test-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.test-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.success-message,
.error-message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.stat-card {
    background: transparent;
    color: #2c3e50;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #3498db;
    box-shadow: none;
}

.stat-card:nth-child(2) {
    background: transparent;
}

.stat-card:nth-child(3) {
    background: transparent;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
}

.filter-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.filter-group .form-group {
    flex: 1;
    margin-bottom: 0;
}

.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 999;
    border: none;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
}

.fab:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* 移动端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    width: 40px;
    height: 40px;
    background: #2c3e50;
    border: none;
    border-radius: 5px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #ecf0f1;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mobile-overlay.active {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content {
        padding: 60px 10px 15px 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 0;
        margin-bottom: 15px;
    }
    
    .page-header h1 {
        font-size: 22px;
        margin: 0;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 28px;
    }

    .site-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .dashboard-main {
        grid-template-columns: 1fr !important;
    }
}

/* 系统概览等高 */
.overview-grid-eq {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.overview-grid-eq a {
    text-decoration: none;
    display: block;
}

.overview-grid-eq a > div {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* 系统概览卡片 */
.overview-card {
    background: transparent;
    border: 1px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #2c3e50;
    transition: all 0.2s;
}

.overview-card:hover {
    background: #fffde7;
    border-color: #f9a825;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(249, 168, 37, 0.25);
}

/* 站点网格 */
.site-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

/* 站点卡片 */
.site-item {
    text-decoration: none;
    display: block;
}

.site-card {
    position: relative;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    background: transparent;
    text-align: center;
    min-height: 100px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    box-sizing: border-box;
}

.site-card:hover {
    background: #fffde7;
    border-color: #f9a825;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(249, 168, 37, 0.25);
}

.site-card .site-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #2c3e50;
}

.site-card:hover .site-name {
    color: #e65100;
}

.site-card .site-desc {
    font-size: 12px;
    color: #7f8c8d;
}

.app-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #4caf50;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.2;
}

/* 手机端站点网格适配 */
@media (max-width: 480px) {
    .site-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .site-card {
        padding: 12px;
        min-height: 90px;
    }
}
