/* ============================================
   任务计划管理系统 - 全局样式
   支持响应式: PC / 平板 / 手机
   ============================================ */

:root {
    --primary: #1E9FFF;
    --success: #009688;
    --warning: #FFB800;
    --danger: #FF5722;
    --info: #999;
    --bg: #f2f2f2;
    --sidebar-width: 220px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: #333;
    min-height: 100vh;
}

/* ===== 后台布局 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: #20222A;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.admin-sidebar .logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .menu-list {
    list-style: none;
    padding: 10px 0;
}

.admin-sidebar .menu-list li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    min-height: 44px;
}

.admin-sidebar .menu-list li a:hover,
.admin-sidebar .menu-list li a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-sidebar .menu-list li a i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.admin-header {
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
}

.admin-header .hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.admin-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-content {
    flex: 1;
    padding: 20px;
}

/* ===== 遮罩层 ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ===== 统计卡片 ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-card .stat-num {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

/* ===== 响应式 ===== */

/* 平板 <= 1024px */
@media (max-width: 1024px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机 <= 768px */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header .hamburger {
        display: flex;
    }

    .admin-content {
        padding: 15px 10px;
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-card .stat-num {
        font-size: 1.5rem;
    }

    .card {
        padding: 15px;
    }

    /* 表格转卡片 */
    .table-card-mode thead {
        display: none;
    }

    .table-card-mode tbody tr {
        display: block;
        background: #fff;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .table-card-mode tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .table-card-mode tbody td:last-child {
        border-bottom: none;
    }

    .table-card-mode tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        flex-shrink: 0;
        margin-right: 10px;
    }
}

/* 小手机 <= 375px */
@media (max-width: 375px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    html {
        font-size: 13px;
    }
}

/* ===== 分页样式 ===== */
ul.pagination {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0 10px;
    padding: 15px 0;
    list-style: none !important;
}

ul.pagination li {
    list-style: none !important;
    display: inline-block;
    margin: 0;
}

ul.pagination li a,
ul.pagination li span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
    line-height: 1;
}

ul.pagination li a:hover {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background: #f0f9ff !important;
}

ul.pagination li.active span,
ul.pagination li.active a {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    font-weight: 600;
}

ul.pagination li.disabled span,
ul.pagination li.disabled a {
    color: #ccc !important;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    border-color: #e6e6e6 !important;
}

ul.pagination li.disabled a:hover {
    color: #ccc !important;
    border-color: #e6e6e6 !important;
    background: #f5f5f5 !important;
}

/* 省略号（无边框） */
ul.pagination li.disabled span:not(:only-child),
ul.pagination li:has(span):not(:has(a)) span {
    border-color: transparent !important;
    background: transparent !important;
    min-width: 20px;
}

/* 上一页/下一页按钮 */
ul.pagination li:first-child a,
ul.pagination li:last-child a {
    padding: 0 16px;
    font-weight: 500;
}

/* 响应式分页 */
@media (max-width: 768px) {
    ul.pagination {
        gap: 3px;
        margin-top: 15px;
    }
    
    ul.pagination li a,
    ul.pagination li span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E9FFF 0%, #009688 100%);
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box .login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* ===== 表单响应式 ===== */
@media (max-width: 768px) {
    .layui-form-item .layui-inline {
        display: block;
        margin-right: 0;
    }

    .layui-form-label {
        width: auto !important;
        text-align: left;
        padding: 9px 0;
    }

    .layui-input-block {
        margin-left: 0 !important;
    }

    .layui-form-select dl {
        max-height: 200px;
    }

    /* 按钮全宽 */
    .btn-mobile-full {
        width: 100% !important;
    }
}
