/* ============================================
   璀错商贸企业站 - 后台管理样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
}
.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 24px;
    color: #333;
}
.login-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: rgba(255,255,255,0.65);
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo h2 { color: #fff; font-size: 18px; }
.sidebar-logo p { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 5px; }
.sidebar-menu { padding: 10px 0; }
.sidebar-menu .menu-title {
    padding: 10px 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.65);
    transition: all 0.2s;
    font-size: 14px;
}
.sidebar-menu a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-menu a.active { color: #fff; background: #1890ff; }
.sidebar-menu a .icon { margin-right: 10px; width: 18px; text-align: center; }

/* 主内容区 */
.main-content { flex: 1; margin-left: 220px; min-height: 100vh; }

/* 顶部栏 */
.topbar {
    background: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 4px rgba(0,21,41,0.08);
    position: sticky;
    top: 0;
    z-index: 99;
}
.topbar .breadcrumb { font-size: 14px; color: #666; }
.topbar .user-info { display: flex; align-items: center; gap: 15px; }
.topbar .user-info .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* 内容区 */
.content { padding: 24px; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.card-header h3 { font-size: 16px; font-weight: 600; }

/* 统计卡片 */
.stats-grid {
    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 2px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 15px;
}
.stat-card .stat-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.stat-card .stat-info .number { font-size: 24px; font-weight: 700; color: #333; }
.stat-card .stat-info .label { font-size: 13px; color: #999; margin-top: 3px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    background: #fafafa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
.table td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; color: #555; }
.table tr:hover { background: #fafafa; }
.table .actions { white-space: nowrap; }
.table .actions a { margin-right: 10px; font-size: 13px; }
.table .actions a.danger { color: #ff4d4f; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-primary:hover { background: #40a9ff; color: #fff; }
.btn-default { background: #fff; color: #333; border-color: #d9d9d9; }
.btn-default:hover { color: #1890ff; border-color: #1890ff; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff7875; color: #fff; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 16px; }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333; }
.form-group label .required { color: #ff4d4f; margin-left: 3px; }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }
.form-actions {
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
}
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tag-danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-default { background: #fafafa; color: #666; border: 1px solid #d9d9d9; }

/* 提示 */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; }
.alert-warning { background: #fffbe6; border: 1px solid #ffe58f; color: #faad14; }
.alert-info { background: #e6f7ff; border: 1px solid #91d5ff; color: #1890ff; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
}
.pagination a:hover { color: #1890ff; border-color: #1890ff; }
.pagination .current { background: #1890ff; color: #fff; border-color: #1890ff; }

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.search-bar input, .search-bar select {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}
.search-bar input:focus, .search-bar select:focus { outline: none; border-color: #1890ff; }

/* 响应式 */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { width: 60px; }
    .sidebar .sidebar-logo h2, .sidebar .sidebar-logo p, .sidebar-menu a span:not(.icon) { display: none; }
    .main-content { margin-left: 60px; }
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .content { padding: 15px; }
}
