/* =============================================
   虚拟货币行情监测系统 - 样式表 (适配手机端)
   ============================================= */

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    color: #2980b9;
}

/* ========== 登录页 ========== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: #999;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

/* ========== 后台管理布局 ========== */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    color: #555;
}

.site-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user {
    font-size: 14px;
    color: #666;
}

.btn-logout {
    font-size: 13px;
    color: #e74c3c;
    padding: 6px 14px;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e74c3c;
    color: #fff;
}

/* 侧边栏 */
.admin-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 200px;
    background: #fff;
    border-right: 1px solid #eee;
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f7fa;
    color: #3498db;
}

.nav-item.active {
    background: #ebf5ff;
    color: #3498db;
    border-left-color: #3498db;
    font-weight: 500;
}

.nav-icon {
    font-size: 16px;
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 899;
}

/* 主内容区 */
.admin-main {
    margin-left: 200px;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    padding: 24px;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s;
    background: #fff;
    color: #333;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 表格 ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

table tr:hover {
    background: #fafbfc;
}

/* ========== 状态标签 ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #fbe9e7;
    color: #c62828;
}

.badge-warning {
    background: #fff8e1;
    color: #f57f17;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ========== 提示 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #b6d4fe;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    background: #fff;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.page-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: #fff;
}

.page-info {
    font-size: 13px;
    color: #999;
    margin-left: 8px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
}

/* ========== 控制台统计 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-align: center;
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

/* ========== 币种监测设置开关 ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #3498db;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ========== 搜索/操作栏 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-box .form-control {
    width: 200px;
}

/* ========== 复选框组(监测类型) ========== */
.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        padding: 16px;
    }

    .site-title {
        font-size: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-box .form-control {
        width: 100%;
    }

    .table-responsive table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 10px 10px;
    }

    .header-right .admin-user {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 30px 20px;
    }
}