/* 全局重置（极简） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
}

/* 轻量变量：浅蓝/浅紫/浅粉低饱和色调 */
:root {
    /* 主色调：浅蓝（低饱和） */
    --primary: rgba(148, 187, 233, 0.9);
    --primary-solid: #94a3b8;
    --primary-hover: rgba(125, 169, 217, 0.95);
    /* 辅助色：浅紫+浅粉（半透明） */
    --secondary: rgba(196, 181, 253, 0.85);
    --secondary-hover: rgba(180, 160, 245, 0.9);
    --pink: rgba(251, 207, 232, 0.85);
    /* 功能色：轻量 */
    --danger: rgba(248, 113, 113, 0.85);
    --success: rgba(74, 222, 128, 0.85);
    /* 背景：半透明+浅色调 */
    --bg-main: rgba(248, 250, 252, 0.95);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: rgba(255, 255, 255, 0.9);
    /* 文本+边框：低对比，轻量 */
    --text-main: #475569;
    --text-light: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    /* 圆角+阴影：轻量，减少渲染开销 */
    --radius: 8px;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 前台背景图：轻量在线资源，固定全屏，凸显半透明卡片 */
.front-body {
    background: url('https://t.alcy.cc/ycy') no-repeat center center fixed;
    background-size: cover;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

/* 按钮：轻量+半透明，无冗余动画 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary);
    color: var(--text-main);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

/* 表单：半透明边框+浅背景 */
.form-item {
    margin-bottom: 18px;
}

.form-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-item input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-card);
    transition: border-color 0.15s ease;
}

.form-item input:focus {
    outline: none;
    border-color: var(--primary-solid);
}

/* 前台样式：响应式+半透明卡片（背景图下效果明显） */
.front-container {
    width: 90%;
    max-width: 450px;
    margin: 60px auto;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* 提升半透明层次感 */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.front-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--text-main);
    text-shadow: 0 0 8px var(--pink);
}

/* 后台布局：基础样式 */
.admin-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏：半透明背景+浅蓝标题 */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: 18px;
    background: var(--primary);
    color: var(--text-main);
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    margin-top: 8px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 18px;
    color: var(--text-main);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease;
}

.sidebar-menu a:hover {
    background-color: var(--pink);
}

.sidebar-menu a.active {
    background-color: var(--primary);
    border-left-color: var(--primary-solid);
}

/* 后台主内容：基础布局 */
.main-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.content-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

/* 卡片：半透明+轻阴影 */
.table-card, .form-card, .dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

/* 登录页：响应式+半透明 */
.login-wrap {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, var(--pink), var(--secondary));
}

.login-container {
    width: 90%;
    max-width: 400px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header h1 {
    color: var(--text-main);
    font-size: 22px;
    margin-bottom: 6px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
}

/* 表格：响应式（手机端横向滚动） */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* 手机端顺滑滚动 */
}

.table {
    min-width: 600px; /* 保证表格最小宽度，手机端滚动 */
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background-color: var(--primary);
    font-weight: 500;
}

.table tr:hover {
    background-color: var(--pink);
}

/* 搜索框：响应式 */
.search-box {
    margin-bottom: 20px;
    width: 100%;
}

/* 分页：轻量样式 */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.pagination a:hover {
    background-color: var(--primary);
}

.pagination a.active {
    background-color: var(--primary-solid);
    color: white;
    border-color: var(--primary-solid);
}

/* 弹窗：响应式+半透明 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-title {
    font-size: 18px;
    margin-bottom: 18px;
    text-align: center;
    color: var(--text-main);
}

.modal-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* 提示弹窗：响应式+半透明 */
.toast-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius);
    z-index: 99999;
    min-width: 260px;
    max-width: 90%;
    text-align: center;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: var(--primary);
    color: var(--text-main);
}

/* 提示文本：半透明背景 */
.alert-text {
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-weight: 500;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid var(--border);
}

.alert-success {
    color: #065f46;
    background: rgba(236, 253, 245, 0.9);
}

.alert-error {
    color: #991b1b;
    background: rgba(254, 242, 242, 0.9);
}

/* ========== 响应式媒体查询（手机端适配） ========== */
@media (max-width: 768px) {
    /* 后台布局：手机端纵向排列 */
    .admin-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* 侧边栏：手机端全屏宽度，高度自适应 */
    .sidebar {
        width: 100%;
        height: auto;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 0;
    }

    .sidebar-menu li {
        flex: 0 0 auto;
    }

    .sidebar-menu a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .sidebar-menu a.active {
        border-left: none;
        border-bottom-color: var(--primary-solid);
    }

    /* 后台主内容：手机端减少内边距 */
    .main-content {
        padding: 15px;
        height: calc(100vh - 120px);
    }

    /* 前台：手机端减少外边距 */
    .front-container {
        margin: 40px auto;
        padding: 20px;
    }

    /* 按钮/输入框：手机端适配 */
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }

    .form-item input {
        padding: 12px 15px;
        font-size: 15px;
    }
}