* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; background: #f1f5f9; color: #1e293b; font-size: 14px; display: flex; flex-direction: column; min-height: 100vh; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
body > .container { flex: 1 0 auto; width: 100%; padding-top: 24px; padding-bottom: 40px; }
/* 页脚贴底：容器内嵌页脚（云端 main 结构 / 后台 admin-main）同样贴底 */
main.container { display: flex; flex-direction: column; }
main.container > .site-foot { margin-top: auto; }
.admin-main { display: flex; flex-direction: column; }
.admin-main > .site-foot { margin-top: auto; }

/* 顶栏 */
.topbar { background: #0f172a; color: #fff; flex-shrink: 0; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; height: 56px; gap: 24px; }
.brand { font-size: 17px; font-weight: 700; color: #fff !important; letter-spacing: 1px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #cbd5e1; padding: 8px 14px; border-radius: 8px; position: relative; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.top-user { color: #cbd5e1; }
.top-user a { color: #fff; margin-left: 12px; }
main.container { padding-top: 24px; padding-bottom: 0; flex: 1 0 auto; }

/* 后台布局 */
.admin-top .topbar-in { max-width: none; }
.admin-wrap { display: flex; flex: 1 0 auto; min-height: calc(100vh - 56px); }
.sidebar { width: 210px; background: #1e293b; padding-top: 16px; flex-shrink: 0; }
.side-nav { display: flex; flex-direction: column; }
.side-nav a { color: #cbd5e1; padding: 12px 24px; border-left: 3px solid transparent; }
.side-nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.06); }
.side-nav a.on { color: #fff; border-left-color: #3b82f6; background: rgba(59,130,246,.15); }
.admin-main { flex: 1; padding: 24px 24px 0; max-width: 1500px; }

.dot { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; text-align: center; background: #ef4444; color: #fff; border-radius: 8px; font-size: 11px; font-style: normal; margin-left: 4px; padding: 0 4px; }

/* 卡片与表单 */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 18px 20px; margin-bottom: 18px; }
.card-title { font-size: 15px; margin-bottom: 14px; color: #0f172a; }
.addr-card { border: 1px solid #bfdbfe; background: linear-gradient(180deg, #eff6ff, #ffffff); }
.addr-card .card-title { color: #1d4ed8; }
.addr-line { margin: 4px 0; font-size: 14px; line-height: 1.7; }
.page-title { font-size: 20px; margin-bottom: 16px; }
.flex-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.muted { color: #64748b; font-size: 12.5px; }

label { display: block; margin-bottom: 12px; font-weight: 600; color: #334155; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; margin-top: 5px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; padding: 0; border: none; border-radius: 3px; accent-color: #2563eb; vertical-align: -3px; cursor: pointer; flex: none; }
input[type="checkbox"]:focus, input[type="radio"]:focus { outline: 2px solid #93c5fd; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #3b82f6; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.grid2-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.span2 { grid-column: 1 / -1; }
.op-cell { white-space: nowrap; }
.grid2-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2-cards .card { margin-bottom: 0; }

.btn { display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #1e293b; font-size: 14px; cursor: pointer; }
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.ok-text { color: #15803d; font-weight: 600; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.inline-form { display: inline; margin-right: 10px; }

/* 提示 */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.table th { background: #f8fafc; font-weight: 600; color: #475569; white-space: nowrap; }
.table tr:hover td { background: #f8fafc; }
.r { text-align: right !important; }

.auth-hero-single { max-width: 430px; min-height: 0; }
.auth-hero-single .auth-card { padding: 40px 38px; }
.auth-hero-single .auth-title { text-align: center; }
.auth-hero-single .auth-sub { text-align: center; }

.perm-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.perm-item { display: flex; gap: 14px; padding: 10px 14px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.perm-item b { flex: 0 0 92px; }
.perm-item span { color: #475569; line-height: 1.5; }
.perm-cell { color: #475569; font-size: 12.5px; max-width: 420px; }

/* 状态徽标 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-pending { background: #e2e8f0; color: #334155; }
.st-received { background: #dbeafe; color: #1d4ed8; }
.st-detecting { background: #fef3c7; color: #b45309; }
.st-quote { background: #ffedd5; color: #c2410c; }
.st-repairing { background: #e0e7ff; color: #4338ca; }
.st-qc { background: #ede9fe; color: #6d28d9; }
.st-repaired { background: #ccfbf1; color: #0f766e; }
.st-shipped { background: #cffafe; color: #0e7490; }
.st-signed { background: #dcfce7; color: #15803d; }
.st-terminated { background: #fee2e2; color: #b91c1c; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-ok { background: #dcfce7; color: #15803d; }
.tag-err { background: #fee2e2; color: #b91c1c; }

.tag-dealer { background: #e0f2fe; color: #0369a1; }
.tag-walkin { background: #f1f5f9; color: #475569; }
/* 统计卡片 */
.stat-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 130px; }
.stat-link { text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.stat-link:hover { box-shadow: 0 4px 12px rgba(0,0,0,.14); transform: translateY(-2px); text-decoration: none; }
.stat-num { font-size: 24px; }

/* 多角色选择 */
.role-checks { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.role-checks legend { font-size: 13px; color: #475569; padding: 0 6px; }
.role-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: #1e293b; cursor: pointer; }
.role-check input { accent-color: #2563eb; }
/* 我的待办 */
.todo-block { margin-bottom: 4px; }
.sec-divider { border: 0; border-top: 1px solid #e2e8f0; margin: 20px 0 10px; }
.todo-title { font-size: 14px; font-weight: 700; color: #1e293b; margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.todo-title::before { content: ""; width: 4px; height: 16px; background: #2563eb; border-radius: 2px; }
.stat-owner { font-size: 12px; color: #64748b; }
.stat-card.mine { border: 2px solid #2563eb; background: #eff6ff; }
/* 进度条 */
.stepper { display: flex; align-items: flex-start; background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.step { flex: 1; text-align: center; position: relative; min-width: 70px; }
.step-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: #cbd5e1; margin: 0 auto 8px; border: 3px solid #fff; box-shadow: 0 0 0 2px #cbd5e1; }
.step-label { font-size: 12.5px; color: #94a3b8; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 6px; left: 55%; width: 90%; height: 2px; background: #e2e8f0; }
.step.done .step-dot { background: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.step.done .step-label { color: #15803d; }
.step.cur .step-dot { background: #2563eb; box-shadow: 0 0 0 2px #2563eb; }
.step.cur .step-label { color: #1d4ed8; font-weight: 700; }

/* 键值 */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; }
.kv dt { color: #64748b; }
.kv dd { word-break: break-all; }

/* 时间轴 */
.timeline { padding-left: 6px; }
.tl-item { display: flex; gap: 14px; padding: 8px 0; border-left: 2px solid #e2e8f0; margin-left: 6px; padding-left: 16px; }
.tl-item:last-child { border-left-color: transparent; }
.tl-time { color: #94a3b8; white-space: nowrap; font-size: 12.5px; }
.tl-body { flex: 1; }

/* 图片 */
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-list img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }

/* 报价 */
.quote-table { max-width: 420px; }
.quote-table tr.total td { font-weight: 700; border-top: 2px solid #e2e8f0; }
.quote-card { border: 1px solid #fcd34d; background: #fffbeb; }

/* 操作区 */
.ops { display: flex; flex-wrap: wrap; gap: 14px; }
.op-block { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; flex: 1; min-width: 320px; }
.op-block b { display: block; margin-bottom: 10px; }
.op-danger { border-color: #fca5a5; background: #fef2f2; }
.op-danger b { color: #b91c1c; }

/* 筛选 */
.filter-form { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.filter-form select, .filter-form input { width: auto; margin: 0; }
.filter-form input { flex: 1; max-width: 360px; }
.export-form { flex-wrap: wrap; }
.export-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.log-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.log-head .filter-form { margin-bottom: 0; flex: 1 1 auto; }
.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 14px; }
.log-toolbar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: #1e293b; cursor: pointer; }
.log-toolbar .sel-count { color: #2563eb; font-weight: 700; }
.batch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 14px; border-bottom: 1px solid #e2e8f0; margin-bottom: 14px; }

/* 登录 */
.auth-wrap { min-height: 0; flex: 1 0 auto; display: flex; align-items: center; justify-content: center; background: #0f172a; padding: 24px; }
.auth-hero { display: flex; width: 100%; max-width: 880px; min-height: 520px; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); background: #fff; }
.auth-brand { flex: 1; background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 100%); color: #fff; padding: 40px 34px; display: flex; flex-direction: column; justify-content: center; }
.auth-brand .auth-title { color: #fff; text-align: left; font-size: 22px; margin-bottom: 8px; }
.auth-brand .auth-sub { color: #bfdbfe; text-align: left; margin: 0 0 26px; font-size: 13px; }
.auth-flow { display: flex; flex-direction: column; gap: 18px; }
.auth-flow-item { display: flex; gap: 12px; align-items: flex-start; }
.auth-flow-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-top: 1px; }
.auth-flow-txt b { display: block; font-size: 14px; margin-bottom: 3px; }
.auth-flow-txt span { font-size: 12px; color: #dbeafe; line-height: 1.5; display: block; }
.auth-flow-foot { margin-top: 26px; color: #93c5fd; font-size: 12px; }
.auth-card { flex: 1; background: #fff; padding: 40px 38px; display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { margin-bottom: 18px; font-size: 18px; }
.auth-title { font-size: 20px; text-align: center; }
.auth-sub { color: #64748b; text-align: center; margin: 8px 0 20px; }
.auth-card h2 { margin-bottom: 16px; font-size: 16px; }
.auth-link { margin-top: 14px; text-align: center; color: #64748b; }
.auth-link-alt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0; font-size: 13px; }

/* 消息 */
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-item { background: #fff; border-radius: 10px; padding: 14px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.msg-item.unread { border-left: 4px solid #2563eb; }
.msg-title { font-weight: 700; margin-bottom: 4px; }
.msg-content { color: #334155; margin-bottom: 6px; }
.msg-time { color: #94a3b8; font-size: 12.5px; }

/* 条形图 */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 70px; color: #475569; }
.bar-track { flex: 1; background: #e2e8f0; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 6px; }

@media (max-width: 760px) { .auth-hero { flex-direction: column; min-height: 0; } .auth-brand { padding: 28px 24px; } .auth-card { padding: 28px 24px; } }
@media (max-width: 800px) {
  .grid2, .grid3, .grid2-form, .grid2-cards { grid-template-columns: 1fr; }
  .sidebar { width: 160px; }
}
/* 下一步提示条 */
.next-step { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; padding: 10px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.next-cell { color: #1d4ed8; font-size: 12.5px; }

/* ===== 响应式适配（手机 / 不同分辨率电脑） ===== */
@media (max-width: 1024px) {
  .container { max-width: 100%; }
  .admin-main { padding: 16px 16px 0; }
}
@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding: 10px 12px 6px; gap: 6px 14px; }
  .topbar-in .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }
  .topbar-in .nav::-webkit-scrollbar { display: none; }
  .topbar-in .nav a { padding: 8px 12px; font-size: 13.5px; white-space: nowrap; }
  .topbar-in .top-user { margin-left: auto; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .filter-form { flex-wrap: wrap; }
  .filter-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; margin-bottom: 0; }
  .filter-form select, .filter-form input { width: auto; margin: 0; }
  .grid2, .grid3, .grid2-form, .grid2-cards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .op-block { min-width: 0; }
}
@media (max-width: 640px) {
  .admin-wrap { flex-direction: column; }
  .sidebar { width: 100%; padding: 8px 0 4px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 0 8px; }
  .side-nav a { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; font-size: 13px; }
  .side-nav a.on { border-bottom-color: #3b82f6; }
  .admin-main { padding: 12px 12px 0; }
  .stat-card { min-width: 44%; flex: 1 1 44%; }
  .brand { font-size: 15px; }
  .top-user { font-size: 12px; }
  .card { padding: 14px; }
  .auth-hero { min-height: 0; }
  .auth-brand { display: none; }
  .auth-card { padding: 28px 20px; }
  .stepper { padding: 12px; }
  .op-cell { white-space: normal; }
  .img-list img { width: 96px; height: 96px; }
  .filter-form label { width: 100%; }
  .filter-form select, .filter-form input { width: 100%; }
  main.container { padding-top: 16px; padding-bottom: 0; }
  /* 客户列表手机端卡片化 */
  .cus-table { display: block; overflow: visible; white-space: normal; box-shadow: none; background: transparent; }
  .cus-table thead { display: none; }
  .cus-table tbody { display: block; }
  .cus-table tr { display: block; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 4px 14px 12px; margin-bottom: 12px; }
  .cus-table td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: none; border-bottom: 1px dashed #eef2f7; padding: 9px 0; white-space: normal; }
  .cus-table td:last-child { border-bottom: none; justify-content: stretch; }
  .cus-table td:last-child .btn { flex: 1; text-align: center; margin-top: 2px; }
  .cus-table td::before { content: attr(data-label); color: #64748b; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
  .cus-table td:last-child::before { display: none; }
  /* 触控尺寸与细节 */
  .btn { min-height: 40px; padding: 8px 14px; }
  .btn-sm { min-height: 34px; padding: 5px 10px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { padding: 11px 12px; font-size: 15px; }
  .flex-head { flex-wrap: wrap; }
  .page-title { font-size: 18px; }
  .table th, .table td { padding: 8px 10px; font-size: 12.5px; }
}

.site-foot { border-top: 1px solid #e5e7eb; padding: 16px 12px; text-align: center; font-size: 12px; color: #9ca3af; background: #f9fafb; flex-shrink: 0; margin-top: 0; }
.site-foot a { color: #6b7280; text-decoration: none; }
.site-foot a:hover { color: #2563eb; }

/* 系统设置页 */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: #1e293b; cursor: pointer; margin: 6px 16px 6px 0; }
.chk input { accent-color: #2563eb; }
.form-actions { margin-top: 14px; }
.ok-num { color: #16a34a; font-weight: 600; }
.err-num { color: #dc2626; font-weight: 600; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.login-tab { flex: 1; padding: 9px 0; border: 1px solid #d5dbe3; background: #fff; color: #1e293b; border-radius: 8px; cursor: pointer; font-size: 14px; }
.login-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.form-hint { margin: -2px 0 12px; font-size: 12px; color: #64748b; line-height: 1.6; }
