/* ============================================================
   客户管理系统 - 简洁商务风格
   配色: 深蓝(#1a3a5c) / 灰白(#f7f9fc) / 强调(#0f4c81)
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

a { color: #0f4c81; text-decoration: none; transition: color .15s; }
a:hover { color: #0a3a64; text-decoration: underline; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}
.btn-primary { background: #0f4c81; color: #fff; border-color: #0f4c81; }
.btn-primary:hover { background: #0a3a64; border-color: #0a3a64; text-decoration: none; color: #fff; }
.btn-success { background: #1e7e34; color: #fff; border-color: #1e7e34; }
.btn-success:hover { background: #155724; border-color: #155724; text-decoration: none; color: #fff; }
.btn-outline { background: transparent; border: 1px solid #0f4c81; color: #0f4c81; }
.btn-outline:hover { background: #0f4c81; color: #fff; text-decoration: none; }
.btn-light { background: #fff; border: 1px solid #d0d7de; color: #2c3e50; }
.btn-light:hover { background: #f0f4f8; text-decoration: none; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #922b21; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #2c3e50; font-size: 13px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #2c3e50;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0f4c81;
    box-shadow: 0 0 0 3px rgba(15,76,129,.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.checkbox-group label { display: flex; align-items: flex-start; gap: 8px; font-weight: normal; cursor: pointer; font-size: 13px; color: #5a6c7d; }
.checkbox-group input[type="checkbox"] { width: auto; margin-top: 3px; }
.form-error { color: #c0392b; font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.form-hint { color: #8a9aaa; font-size: 12px; margin-top: 4px; }

/* ===== 登录注册页 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a5c 0%, #0f4c81 100%);
}
.auth-container { width: 100%; max-width: 400px; padding: 20px; }
.auth-card {
    background: #fff;
    border-radius: 8px;
    padding: 36px 32px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.auth-logo {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.auth-subtitle {
    text-align: center;
    font-size: 13px;
    color: #8a9aaa;
    margin-bottom: 28px;
}
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eef1f5;
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    color: #8a9aaa;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    font-size: 14px;
}
.auth-tab:hover { color: #0f4c81; text-decoration: none; }
.auth-tab.active { color: #0f4c81; border-bottom-color: #0f4c81; }
.auth-form .btn-block { margin-top: 8px; padding: 11px; font-size: 15px; }
.auth-error {
    background: #fdf2f2;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 3px solid #c0392b;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #8a9aaa;
}

/* ===== 用户端个人中心 ===== */
.user-header {
    background: #1a3a5c;
    color: #fff;
    padding: 22px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.user-header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.welcome-text { font-size: 19px; font-weight: 600; letter-spacing: .5px; }
.user-header-content .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.user-header-content .btn-outline:hover { background: rgba(255,255,255,.15); color: #fff; }

.user-container { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.info-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    text-align: center;
    border-top: 3px solid #0f4c81;
}
.info-card-label { color: #8a9aaa; font-size: 12px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.info-card-value { font-size: 22px; font-weight: 700; color: #1a3a5c; }

.section { background: #fff; border-radius: 6px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-list, .after-sale-list { display: flex; flex-direction: column; gap: 6px; }
.order-item, .after-sale-item {
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-left: 3px solid transparent;
}
.order-item:hover, .after-sale-item:hover { background: #eef5fb; border-left-color: #0f4c81; }
.order-name { font-weight: 600; color: #2c3e50; flex: 1; }
.order-date { color: #8a9aaa; font-size: 12px; }
.as-no { color: #5a6c7d; font-size: 12px; min-width: 160px; }
.as-name { flex: 1; font-weight: 600; color: #2c3e50; }

.empty-tip { text-align: center; color: #8a9aaa; padding: 32px; font-size: 14px; }

/* ===== 等级徽章 ===== */
.level-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.level-0 { background: #eef1f5; color: #5a6c7d; }
.level-1 { background: #fff4e6; color: #b8860b; border: 1px solid #ffd980; }
.level-2 { background: #ede7f6; color: #4527a0; border: 1px solid #b39ddb; }

/* ===== 状态徽章 ===== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}
.status-0 { background: #fff4e6; color: #b8860b; }
.status-1 { background: #e8f5e9; color: #1e7e34; }
.text-muted { color: #8a9aaa; font-size: 12px; }

/* ===== 弹窗 Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(26,58,92,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    color: #1a3a5c;
}
.modal-close { cursor: pointer; font-size: 24px; color: #8a9aaa; line-height: 1; }
.modal-close:hover { color: #1a3a5c; }
.modal-body { padding: 20px; }

.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid #f4f6f9; gap: 12px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #8a9aaa; min-width: 80px; flex-shrink: 0; font-size: 13px; }
.detail-row span:last-child { color: #2c3e50; word-break: break-all; font-weight: 500; }

/* ===== 后台管理 ===== */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    background: #1a3a5c;
    color: #b8c5d6;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
}
.admin-sidebar-logo {
    padding: 24px 20px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #2a4a6c;
    text-align: center;
    letter-spacing: 1px;
}
.admin-nav { flex: 1; padding: 12px 0; }
.admin-nav a {
    display: block;
    padding: 12px 24px;
    color: #b8c5d6;
    transition: all .15s;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-nav a:hover {
    background: rgba(255,255,255,.05);
    color: #fff;
    text-decoration: none;
}
.admin-nav a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-left-color: #4a90d9;
}
.admin-logout {
    padding: 12px 24px;
    color: #ff6b6b !important;
    border-top: 1px solid #2a4a6c;
    font-size: 14px;
}
.admin-logout:hover { background: rgba(255,255,255,.05); color: #ff8787 !important; text-decoration: none; }

.admin-main {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f6f9;
}
.admin-header {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border-bottom: 1px solid #eef1f5;
}
.admin-header h1 { font-size: 18px; font-weight: 600; color: #1a3a5c; }
.admin-content { padding: 24px; flex: 1; }

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.stat-card {
    border-radius: 6px;
    padding: 24px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
}
.stat-label { font-size: 13px; opacity: .9; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 700; }
.stat-blue { background: linear-gradient(135deg, #0f4c81, #1a3a5c); }
.stat-green { background: linear-gradient(135deg, #1e7e34, #155724); }
.stat-orange { background: linear-gradient(135deg, #d97706, #92400e); }
.stat-purple { background: linear-gradient(135deg, #6d28d9, #4c1d95); }

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef1f5;
}
.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #5a6c7d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tr:last-child td { border-bottom: none; }

/* 操作卡片网格 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.action-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.action-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f5;
}

/* 后台登录页额外样式 */
.admin-auth .auth-logo { color: #1a3a5c; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .admin-sidebar { width: 60px; }
    .admin-sidebar-logo { font-size: 11px; padding: 16px 4px; }
    .admin-nav a { padding: 12px 8px; text-align: center; font-size: 11px; border-left: none; }
    .admin-logout { padding: 12px 8px; text-align: center; font-size: 11px; }
    .admin-main { margin-left: 60px; }
    .info-cards { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: 1fr; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px; }
    .auth-card { padding: 28px 20px; }
    .welcome-text { font-size: 16px; }
}
