* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f7fa; color: #2c3e50; line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: #2c3e50; color: white; padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-brand { font-weight: 600; font-size: 16px; }
.nav-menu { display: flex; gap: 20px; }
.nav-menu a, .nav-user a {
    color: #ecf0f1; text-decoration: none; font-size: 14px;
    padding: 4px 8px; border-radius: 4px; transition: background 0.2s;
}
.nav-menu a:hover, .nav-user a:hover { background: rgba(255,255,255,0.15); }
.nav-user { display: flex; gap: 12px; align-items: center; font-size: 13px; }

/* 容器 */
.container { max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.footer { text-align: center; padding: 20px; color: #95a5a6; font-size: 12px; }

/* Flash 消息 */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 登录页 */
.login-box {
    max-width: 400px; margin: 80px auto; background: white;
    padding: 40px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.login-box h2 { margin-bottom: 24px; text-align: center; color: #2c3e50; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.form-group label .required { color: #e74c3c; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #3498db;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group .help-text { font-size: 12px; color: #7f8c8d; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 按钮 */
.btn {
    display: inline-block; padding: 8px 18px; border: none; border-radius: 4px;
    font-size: 14px; cursor: pointer; text-decoration: none; font-family: inherit;
    transition: background 0.2s;
}
.btn-primary { background: #3498db; color: white; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #229954; }
.btn-danger { background: #e74c3c; color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 卡片 */
.card {
    background: white; border-radius: 8px; padding: 20px; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #2c3e50; }

/* 统计卡片网格 */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: white; padding: 20px; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card .label { font-size: 13px; color: #7f8c8d; margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: #2c3e50; }
.stat-card .sub { font-size: 12px; color: #95a5a6; margin-top: 4px; }

/* 表格 */
.table { width: 100%; background: white; border-radius: 8px; overflow: hidden;
         box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; }
.table th { background: #ecf0f1; color: #555; font-weight: 600; border-bottom: 1px solid #ddd; }
.table td { border-bottom: 1px solid #f0f0f0; }
.table tr:hover td { background: #f8f9fa; }
.table .overdue { background: #fff3f3; }

/* 状态徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.badge-new_inquiry { background: #e3f2fd; color: #1976d2; }
.badge-following { background: #fff3e0; color: #f57c00; }
.badge-quoted { background: #f3e5f5; color: #7b1fa2; }
.badge-sample { background: #e0f7fa; color: #0097a7; }
.badge-negotiating { background: #fff9c4; color: #f9a825; }
.badge-won { background: #c8e6c9; color: #2e7d32; }
.badge-lost { background: #ffcdd2; color: #c62828; }

.badge-pending { background: #fff3e0; color: #f57c00; }
.badge-deposit_paid { background: #e3f2fd; color: #1976d2; }
.badge-in_production { background: #f3e5f5; color: #7b1fa2; }
.badge-ready_to_ship { background: #fff9c4; color: #f9a825; }
.badge-shipped { background: #e0f7fa; color: #0097a7; }
.badge-completed { background: #c8e6c9; color: #2e7d32; }

.badge-A { background: #ffcdd2; color: #c62828; }
.badge-B { background: #fff9c4; color: #f9a825; }
.badge-C { background: #e1f5fe; color: #0288d1; }
.badge-pending { background: #eceff1; color: #546e7a; }

/* 过滤器 */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input {
    padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px;
}

/* 漏斗图（文字版） */
.funnel { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.funnel-item { display: flex; align-items: center; margin-bottom: 10px; }
.funnel-item .label { width: 120px; font-size: 13px; color: #555; }
.funnel-item .bar {
    flex: 1; height: 28px; background: #ecf0f1; border-radius: 4px;
    position: relative; overflow: hidden;
}
.funnel-item .fill {
    height: 100%; background: linear-gradient(to right, #3498db, #5dade2);
    display: flex; align-items: center; padding-left: 10px; color: white; font-size: 12px;
    min-width: 30px;
}

/* 详情页 */
.detail-header {
    background: white; padding: 20px; border-radius: 8px; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.detail-header h2 { margin-bottom: 8px; }
.detail-meta { display: flex; gap: 20px; font-size: 13px; color: #7f8c8d; flex-wrap: wrap; }
.detail-meta span strong { color: #2c3e50; }

.timeline-item {
    padding: 12px; border-left: 3px solid #3498db; margin-bottom: 12px;
    background: #f8f9fa; border-radius: 0 6px 6px 0;
}
.timeline-meta { font-size: 12px; color: #7f8c8d; margin-bottom: 6px; }
.timeline-content { font-size: 14px; color: #2c3e50; }

.page-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.page-header h2 { font-size: 20px; color: #2c3e50; }
