:root {
    --sidebar-width: 250px;
    --primary-color: #555;
    --primary-dark: #333;
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --sidebar-bg: #222;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.user-info {
    padding: 15px 20px;
    background: rgba(0,0,0,0.1);
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 15px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 4px solid #888;
    padding-left: 16px; 
}

.nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.logout-link {
    margin-top: auto;
    background: rgba(100, 100, 100, 0.5);
    text-align: center;
    font-weight: bold;
}

.logout-link:hover {
    background: rgba(100, 100, 100, 0.8);
    border-left: none;
    padding-left: 20px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
}

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

.page-header h1 {
    margin: 0;
    font-size: 24px;
    color: #e0e0e0;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #2a2a2a;
    border-color: #444;
    color: #999;
}

.alert-danger {
    background-color: #2a2a2a;
    border-color: #444;
    color: #999;
}

/* Card Styles */
.card {
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    padding: 25px;
    margin-bottom: 30px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    color: #e0e0e0;
    font-size: 18px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #333;
    padding: 25px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: #222;
    color: #e0e0e0;
}

.form-control:focus {
    border-color: #666;
    outline: none;
}

textarea.form-control {
    height: 80px;
    resize: vertical;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    display: inline-block;
}

.btn-primary {
    background: #444;
    color: white;
}

.btn-primary:hover {
    background: #555;
}

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

.btn-danger {
    background: #555;
    color: white;
}

/* Input Group with Copy Button */
.input-group {
    display: flex;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #444;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #222;
    font-family: monospace;
    color: #e0e0e0;
}

.input-group button {
    padding: 10px 15px;
    background: #333;
    border: 1px solid #444;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: #999;
}

.input-group button:hover {
    background: #444;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
}

th {
    background-color: #2a2a2a;
    color: #999;
    font-weight: 600;
}

tr:hover {
    background-color: #2a2a2a;
}

.status-success {
    color: #999;
    font-weight: bold;
}

.status-failure {
    color: #888;
    font-weight: bold;
}

/* Advanced Captcha Styles */
.captcha-slide-container {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 0 auto 20px;
    background: #333;
    border: 1px solid #444;
    overflow: hidden;
    user-select: none;
}

.captcha-slide-bg {
    width: 100%;
    height: 100%;
    display: block;
}

.captcha-slide-piece {
    position: absolute;
    left: 0;
    width: 50px;
    height: 50px;
    z-index: 10;
    cursor: grab;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.captcha-slide-piece:active {
    cursor: grabbing;
}

.captcha-slide-bar {
    width: 300px;
    height: 40px;
    background: #333;
    border: 1px solid #444;
    border-radius: 20px;
    margin: 0 auto 20px;
    position: relative;
}

.captcha-slide-knob {
    width: 50px;
    height: 38px;
    background: #444;
    border: 1px solid #555;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
    cursor: grab;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
}

.captcha-click-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    cursor: crosshair;
}

.captcha-click-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #555;
    border-radius: 50%;
    border: 2px solid #888;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 10;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); 
}

.modal-content {
    background-color: #2a2a2a;
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid #444;
    width: 80%; 
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.close {
    color: #888;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #ccc;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2, .user-info, .nav-link span {
        display: none;
    }
    .nav-link {
        text-align: center;
        padding: 15px 0;
    }
    .nav-link i {
        margin: 0;
        font-size: 20px;
    }
    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
        padding: 15px;
    }
}
