/* ============================================
   客资管理系统 - 统一样式（壹仟墨品牌风）
   红 #c0392b / 深墨 #1a1a2e / 米白 #f8f7f5
   ============================================ */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    background:#f8f7f5; color:#1a1a2e; font-size:14px; line-height:1.6;
}

/* ---- 顶部导航 ---- */
.topnav { background:#1a1a2e; color:#fff; position:sticky; top:0; z-index:100; box-shadow:0 2px 12px rgba(0,0,0,.15); }
.nav-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; padding:0 20px; height:56px; gap:24px; }
.brand { font-size:17px; font-weight:700; color:#fff; white-space:nowrap; }
.brand em { font-style:normal; color:#c0392b; }
.brand::before { content:"●"; color:#c0392b; margin-right:6px; font-size:12px; vertical-align:middle; }
.nav-links { display:flex; gap:4px; flex:1; overflow-x:auto; }
.nav-links a { color:#cfd2e0; text-decoration:none; padding:7px 14px; border-radius:6px; font-size:14px; white-space:nowrap; transition:.15s; }
.nav-links a:hover { color:#fff; background:rgba(255,255,255,.08); }
.nav-links a.on { color:#fff; background:#c0392b; }
.nav-user { color:#cfd2e0; font-size:13px; white-space:nowrap; display:flex; align-items:center; gap:10px; }
.nav-user .btn-mini { color:#fff; background:rgba(255,255,255,.12); padding:4px 10px; border-radius:4px; text-decoration:none; font-size:12px; }
.nav-user .btn-mini:hover { background:rgba(255,255,255,.22); }

/* ---- 布局 ---- */
.container { max-width:1200px; margin:0 auto; padding:24px 20px 60px; }
.page-title { font-size:22px; font-weight:700; margin-bottom:6px; }
.page-sub { color:#888; font-size:13px; margin-bottom:20px; }

/* ---- 卡片 ---- */
.card { background:#fff; border-radius:12px; box-shadow:0 2px 14px rgba(26,26,46,.06); padding:20px; margin-bottom:20px; }
.card h3 { font-size:16px; margin-bottom:14px; border-left:4px solid #c0392b; padding-left:10px; }

/* ---- 数据统计 ---- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:16px; margin-bottom:20px; }
.stat { background:#fff; border-radius:12px; box-shadow:0 2px 14px rgba(26,26,46,.06); padding:18px; }
.stat .num { font-size:30px; font-weight:800; color:#c0392b; }
.stat .label { color:#888; font-size:13px; margin-top:4px; }

/* ---- 表格 ---- */
table { width:100%; border-collapse:collapse; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 2px 14px rgba(26,26,46,.06); }
th, td { padding:12px 14px; text-align:left; border-bottom:1px solid #f0efec; font-size:14px; }
th { background:#faf9f7; color:#666; font-weight:600; white-space:nowrap; }
tr:hover td { background:#fdf9f8; }
td .tag { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; }
.tag-green  { background:#e8f7ee; color:#1e8e4e; }
.tag-orange { background:#fdf0e2; color:#d97706; }
.tag-red    { background:#fdeaea; color:#c0392b; }
.tag-gray   { background:#f0f0f0; color:#666; }
.tag-blue   { background:#e8f0fd; color:#2563eb; }

/* ---- 按钮 ---- */
.btn { display:inline-block; background:#c0392b; color:#fff; border:none; padding:9px 20px; border-radius:6px; cursor:pointer; font-size:14px; text-decoration:none; transition:.15s; }
.btn:hover { background:#a93226; }
.btn-outline { background:#fff; color:#c0392b; border:1px solid #c0392b; }
.btn-outline:hover { background:#fdf1f0; }
.btn-sm { padding:5px 12px; font-size:13px; }
.btn-gray { background:#e8e8e8; color:#555; }
.btn-gray:hover { background:#dcdcdc; }

/* ---- 表单 ---- */
.form-row { margin-bottom:16px; }
.form-row label { display:block; font-size:13px; color:#555; margin-bottom:6px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=tel],
.form-row input[type=datetime-local], .form-row textarea, .form-row select {
    width:100%; padding:10px 12px; border:1px solid #ddd; border-radius:6px; font-size:14px; font-family:inherit;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline:none; border-color:#c0392b; box-shadow:0 0 0 3px rgba(192,57,43,.12); }
.form-row textarea { min-height:80px; resize:vertical; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
.check-group { display:flex; flex-wrap:wrap; gap:10px 18px; }
.check-group label { display:flex; align-items:center; gap:6px; font-size:14px; color:#333; cursor:pointer; }

/* ---- 提示条 ---- */
.flash { background:#e8f7ee; color:#1e8e4e; padding:10px 16px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.flash.err { background:#fdeaea; color:#c0392b; }
.flash.warn { background:#fdf0e2; color:#d97706; }

/* ---- 登录页 ---- */
.login-body { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(160deg,#1a1a2e 0%,#2d2d4a 100%); }
.login-page-brand { font-size:56px; font-weight:800; color:#fff; letter-spacing:8px; margin-bottom:36px; text-align:center; text-shadow:0 4px 24px rgba(0,0,0,.4); }
.login-page-brand em { font-style:normal; color:#c0392b; }
.login-box { background:#fff; border-radius:16px; padding:44px 40px; width:380px; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.login-box h1 { font-size:24px; text-align:center; color:#1a1a2e; }
.login-box h1::before { content:"●"; color:#c0392b; margin-right:8px; font-size:14px; }
.login-sub { text-align:center; color:#999; font-size:13px; margin:8px 0 26px; }
.login-ent { text-align:center; color:#c0392b; font-size:15px; font-weight:700; margin:10px 0 20px; }
.login-tip { text-align:center; color:#aaa; font-size:12px; margin-top:16px; }
.login-brand { text-align:center; color:#c0392b; font-size:13px; margin-top:22px; padding-top:16px; border-top:1px solid #f0efec; }
.login-box input { width:100%; padding:12px 14px; border:1px solid #ddd; border-radius:8px; margin-bottom:14px; font-size:15px; }
.login-box input:focus { outline:none; border-color:#c0392b; box-shadow:0 0 0 3px rgba(192,57,43,.12); }
.login-box button { width:100%; padding:12px; background:#c0392b; color:#fff; border:none; border-radius:8px; font-size:16px; cursor:pointer; margin-top:4px; }
.login-box button:hover { background:#a93226; }

/* ---- 时间线（进度历史）---- */
.timeline { position:relative; padding-left:22px; }
.timeline::before { content:""; position:absolute; left:6px; top:4px; bottom:4px; width:2px; background:#e5e4e0; }
.tl-item { position:relative; margin-bottom:18px; }
.tl-item::before { content:""; position:absolute; left:-22px; top:6px; width:10px; height:10px; border-radius:50%; background:#c0392b; }
.tl-item .tl-time { font-size:12px; color:#999; }
.tl-item .tl-body { font-size:14px; margin-top:2px; }
.tl-item .tl-body b { color:#c0392b; }

/* ---- 客资详情 ---- */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 24px; }
.detail-item .k { font-size:12px; color:#999; }
.detail-item .v { font-size:15px; margin-top:2px; font-weight:600; }

/* ---- 空状态 ---- */
.empty { text-align:center; color:#aaa; padding:50px 0; font-size:14px; }

/* ---- 企业专属入口链接 ---- */
.ent-links { background:#fdf6f5; border:1px solid #f0d9d6; border-radius:10px; padding:14px 18px; margin-bottom:16px; }
.ent-links-title { font-size:14px; font-weight:700; color:#c0392b; margin-bottom:10px; }
.ent-link-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.ent-link-label { width:150px; font-size:13px; color:#666; flex-shrink:0; }
.ent-link-input { flex:1; min-width:260px; padding:7px 10px; border:1px solid #e0c8c4; border-radius:6px; font-size:12px; color:#444; background:#fff; }
.ent-link-row .btn { flex-shrink:0; }

/* ---- 二维码绑定卡片 ---- */
.card-qr { display:flex; gap:24px; align-items:center; }

/* ---- 内页版权footer ---- */
.site-footer { text-align:center; color:#aaa; font-size:12px; padding:24px 0 40px; }

/* ============================================
   手机端全面适配（响应式）
   覆盖：768px 平板 / 480px 小屏手机
   ============================================ */
html { -webkit-text-size-adjust:100%; }

@media (max-width:768px){
    /* ---- 触屏友好：16px 防 iOS 聚焦自动缩放 ---- */
    input, select, textarea { font-size:16px !important; }

    /* ---- 表格：横向滚动，不再撑爆屏幕 ---- */
    table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    th, td { padding:10px 10px; }

    /* ---- 布局收紧 ---- */
    .container { padding:16px 12px 40px; }
    .card { padding:14px; }
    .page-title { font-size:18px; }
    .page-sub { font-size:12px; }

    /* ---- 顶部导航 ---- */
    .nav-inner { height:50px; gap:8px; padding:0 10px; }
    .brand { font-size:15px; }
    .nav-links a { padding:6px 10px; font-size:13px; }
    .nav-user { font-size:12px; gap:6px; }

    /* ---- 按钮：加大触控区域 ---- */
    .btn { padding:11px 18px; }
    .btn-sm { padding:8px 14px; min-height:34px; }

    /* ---- 表单控件加大 ---- */
    .form-row input[type=text], .form-row input[type=password], .form-row input[type=tel],
    .form-row input[type=datetime-local], .form-row textarea, .form-row select { padding:12px; }
    .check-group label { padding:4px 0; }

    /* ---- 登录页 ---- */
    .login-page-brand { font-size:34px; letter-spacing:4px; margin-bottom:24px; }
    .login-box { width:92%; max-width:380px; padding:32px 24px; }

    /* ---- 统计卡片：手机上 2×2 排列 ---- */
    .stat-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
    .stat { padding:12px; }
    .stat .num { font-size:24px; }
    .stat .label { font-size:12px; }

    /* ---- 企业专属入口链接：堆叠成竖排 ---- */
    .ent-link-row { flex-direction:column; align-items:stretch; }
    .ent-link-label { width:auto; }
    .ent-link-input { min-width:0; width:100%; }

    /* ---- 详情/时间线 ---- */
    .detail-item .v { font-size:14px; }

    /* ---- 二维码卡片：手机上竖排居中 ---- */
    .card-qr { flex-direction:column; text-align:center; }
    .card-qr .btn, .card-qr button { align-self:center; }
}

@media (max-width:480px){
    .brand { font-size:14px; }
    .brand::before { display:none; }
    .nav-user .btn-mini { padding:4px 8px; font-size:11px; }
    .nav-links a { padding:5px 8px; font-size:12px; }
    .login-page-brand { font-size:28px; letter-spacing:3px; }
    .login-box h1 { font-size:21px; }
    .page-title { font-size:17px; }
    .card h3 { font-size:15px; }
    .stat .num { font-size:22px; }
    .empty { padding:30px 0; }
}
