/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #303133;
    font-size: 14px;
    line-height: 1.6;
}
a { color: #409eff; text-decoration: none; }
a:hover { color: #66b1ff; }

/* ===== 后台布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
.admin-sidebar .logo {
    height: 60px;
    line-height: 60px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #1f2d3d;
}
.admin-sidebar .nav { padding: 10px 0; }
.admin-sidebar .nav a {
    display: block;
    padding: 12px 24px;
    color: #c0c4cc;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.admin-sidebar .nav a:hover {
    background: #000c17;
    color: #fff;
}
.admin-sidebar .nav a.active {
    background: #000c17;
    color: #fff;
    border-left-color: #409eff;
}
.admin-sidebar .nav a i {
    display: inline-block;
    width: 20px;
    margin-right: 8px;
    text-align: center;
}
.admin-main {
    margin-left: 220px;
    flex: 1;
    min-height: 100vh;
}
.admin-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-header .page-title {
    font-size: 18px;
    font-weight: 500;
}
.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-header .user-info .username {
    color: #606266;
}
.admin-header .user-info .logout-btn {
    color: #f56c6c;
    cursor: pointer;
    font-size: 13px;
}
.admin-content {
    padding: 20px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebeef5;
}
.card-title {
    font-size: 16px;
    font-weight: 500;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #fff;
    color: #606266;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    line-height: 1.4;
}
.btn:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background: #ecf5ff;
}
.btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}
.btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
    color: #fff;
}
.btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}
.btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
    color: #fff;
}
.btn-danger {
    background: #f56c6c;
    border-color: #f56c6c;
    color: #fff;
}
.btn-danger:hover {
    background: #f78989;
    border-color: #f78989;
    color: #fff;
}
.btn-warning {
    background: #e6a23c;
    border-color: #e6a23c;
    color: #fff;
}
.btn-warning:hover {
    background: #ebb563;
    border-color: #ebb563;
    color: #fff;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.btn-mini {
    padding: 3px 8px;
    font-size: 12px;
}

/* ===== 表格 ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}
.table th {
    background: #fafafa;
    font-weight: 500;
    color: #606266;
}
.table tbody tr:hover {
    background: #f5f7fa;
}
.table .actions {
    display: flex;
    gap: 8px;
}
.table-empty {
    text-align: center;
    padding: 40px;
    color: #909399;
}

/* ===== 状态标签 ===== */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.status-success { background: #f0f9eb; color: #67c23a; }
.status-warning { background: #fdf6ec; color: #e6a23c; }
.status-danger { background: #fef0f0; color: #f56c6c; }
.status-pending { background: #f4f4f5; color: #909399; }
.status-processing { background: #ecf5ff; color: #409eff; }
.status-muted { background: #f4f4f5; color: #909399; }

/* ===== 弹窗遮罩 ===== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 8px;
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 16px;
    font-weight: 500;
}
.modal-close {
    cursor: pointer;
    color: #909399;
    font-size: 20px;
    line-height: 1;
}
.modal-close:hover { color: #f56c6c; }
.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #ebeef5;
    text-align: right;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ===== 表单 ===== */
.form-item {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    color: #606266;
    font-size: 14px;
}
.form-label .required { color: #f56c6c; margin-right: 4px; }
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #409eff;
}
.form-textarea {
    resize: vertical;
    min-height: 100px;
}
.form-tip {
    margin-top: 4px;
    font-size: 12px;
    color: #909399;
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-success { background: #67c23a; }
.toast-error { background: #f56c6c; }
.toast-warning { background: #e6a23c; }
.toast-info { background: #409eff; }
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
.toast.fade-out { animation: slideOutRight 0.3s ease forwards; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination .page-btn {
    padding: 5px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #fff;
    color: #606266;
    cursor: pointer;
    font-size: 13px;
}
.pagination .page-btn:hover {
    color: #409eff;
    border-color: #409eff;
}
.pagination .page-btn.active {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}
.pagination .page-btn.disabled {
    color: #c0c4cc;
    cursor: not-allowed;
}
.pagination .page-info {
    color: #606266;
    font-size: 13px;
    margin-left: 10px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    color: #909399;
    font-size: 13px;
}
.stat-card .stat-icon {
    float: right;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stat-icon.blue { background: #ecf5ff; color: #409eff; }
.stat-icon.green { background: #f0f9eb; color: #67c23a; }
.stat-icon.orange { background: #fdf6ec; color: #e6a23c; }
.stat-icon.red { background: #fef0f0; color: #f56c6c; }

/* ===== 搜索栏 ===== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.search-bar .form-input,
.search-bar .form-select {
    width: auto;
    min-width: 160px;
}

/* ===== 登录页 ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.login-box .login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #303133;
}
.login-box .btn {
    width: 100%;
    padding: 10px;
    font-size: 15px;
}

/* ===== 落地页模板 ===== */
.landing-page {
    min-height: 100vh;
    background: #fff;
}
.landing-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
}
.landing-hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    font-weight: 700;
}
.landing-hero p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}
.landing-hero .hero-btn {
    display: inline-block;
    padding: 14px 40px;
    background: #fff;
    color: #667eea;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s;
}
.landing-hero .hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.landing-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}
.landing-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 16px;
    color: #303133;
}
.landing-section .section-desc {
    text-align: center;
    color: #909399;
    margin-bottom: 40px;
    font-size: 16px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.feature-item {
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    background: #f5f7fa;
    transition: transform 0.2s;
}
.feature-item:hover {
    transform: translateY(-4px);
}
.feature-item .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ecf5ff;
    color: #409eff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.feature-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #303133;
}
.feature-item p {
    color: #606266;
    font-size: 14px;
    line-height: 1.7;
}
.landing-footer {
    background: #001529;
    color: #c0c4cc;
    text-align: center;
    padding: 30px 20px;
    font-size: 13px;
}

/* ===== 确认对话框 ===== */
.confirm-box .confirm-message {
    padding: 10px 0;
    color: #606266;
    line-height: 1.7;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .admin-sidebar { width: 60px; }
    .admin-sidebar .logo span,
    .admin-sidebar .nav a span { display: none; }
    .admin-main { margin-left: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: 1fr; }
}
