* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f3f5f8; color: #26303b; font-size: 14px; }
header.top { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #e60012, #a80009); color: #fff; padding: 0 16px; height: 52px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand img { height: 30px; width: 30px; object-fit: cover; border-radius: 7px; border: 2px solid rgba(255,255,255,.7); }
.brand .ver { font-size: 11px; opacity: .75; font-weight: 400; margin-left: 2px; }
header nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
header nav a { color: #ffd9dc; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
header nav a:hover, header nav a.on { background: rgba(255,255,255,.18); color: #fff; }
header .who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
header .who a { color: #ffd; }
.pwdbox summary { cursor: pointer; color: #ffd9dc; font-size: 12px; }
.pwdbox[open] { position: relative; }
.pwdbox form { position: absolute; right: 60px; top: 46px; background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.pwdbox input { display: block; width: 160px; margin: 4px 0; color: #000; }
main { max-width: 1280px; margin: 16px auto; padding: 0 14px 60px; }
h1.page { font-size: 20px; margin: 6px 0 14px; }
h2.sec { font-size: 16px; margin: 22px 0 8px; border-left: 4px solid #e60012; padding-left: 8px; }
h3 { font-size: 14px; }
/* —— 批次H：可折叠区块（报价/材料费用）与增项定位高亮 —— */
details.secbox > summary.sec { list-style: none; cursor: pointer; user-select: none; }
details.secbox > summary.sec::-webkit-details-marker { display: none; }
details.secbox > summary.sec::before { content: "▸"; display: inline-block; margin-right: 6px; color: #e60012; transition: transform .15s; }
details.secbox[open] > summary.sec::before { transform: rotate(90deg); }
summary.sec { font-size: 16px; margin: 22px 0 8px; border-left: 4px solid #e60012; padding-left: 8px; }
summary.sec .secsum { font-size: 12px; font-weight: normal; color: #6b7a8d; margin-left: 8px; }
details.secbox:not([open]) { border-bottom: 1px dashed #e3e8ef; }
tr.pendrow td { background: #f7f8fa; color: #8a94a3; }
tr.pendrow td .tag { filter: none; }
@keyframes hlflash { 0% { background: #fff3c4; } 70% { background: #fff9e0; } 100% { background: transparent; } }
tr.hlrow td { animation: hlflash 2.6s ease-out; }
.flash { padding: 9px 12px; border-radius: 8px; margin: 6px 0; }
.flash.ok { background: #e2f5e6; color: #1c7332; }
.flash.err { background: #fde7e7; color: #b21f1f; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.card { background: #fff; border-radius: 10px; padding: 14px 18px; min-width: 170px; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.card b { font-size: 21px; display: block; }
.card span { color: #6b7a8d; font-size: 12px; }
.card.warn { border: 1px solid #f0b425; }
.card.warn b { color: #b07a00; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 4px rgba(20,40,70,.08); border-radius: 8px; overflow: hidden; }
.tbl th { background: #eef2f7; text-align: left; font-size: 12px; color: #51617a; }
.tbl th, .tbl td { padding: 7px 9px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
.tbl tr:hover td { background: #f7fafd; }
.tbl .total td { background: #eef2f7; font-weight: 700; }
.tbl .hl td { background: #fff8e1; }
.tbl .subrow td { background: #fbfbfb; color: #8a97a8; font-size: 12px; }
.tbl input, .tbl select { font-size: 13px; }
.empty { text-align: center; color: #98a5b5; padding: 18px !important; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #e6ebf2; color: #46586e; margin-left: 4px; }
.tag.ok { background: #dcf3e1; color: #1c7332; }
.tag.warn { background: #fdf0d5; color: #a26a00; }
.tag.old { background: #ede2f7; color: #6b3fa0; }
.st-施工中 { background: #dbeafe; color: #1d4ed8; }
.st-待开工 { background: #e5e7eb; color: #374151; }
.st-已交付, .st-竣工验收 { background: #dcf3e1; color: #1c7332; }
.st-停工, .st-已退单 { background: #fde7e7; color: #b21f1f; }
.st-售后 { background: #fdf0d5; color: #a26a00; }
.mini { color: #8a97a8; font-size: 12px; }
.note { background: #eef4fb; border-left: 3px solid #7aa5d8; padding: 8px 12px; color: #3d556f; font-size: 13px; border-radius: 0 6px 6px 0; }
.form label { display: block; margin: 6px 0; font-size: 13px; color: #4c5c6e; }
.form input, .form select { display: block; width: 100%; padding: 7px 9px; border: 1px solid #cfd8e3; border-radius: 6px; margin-top: 3px; background: #fff; }
.form label.ck { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.form label.ck input { width: auto; margin: 0; }
.form .full { grid-column: 1 / -1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; max-width: 900px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
button, .btn { background: #cf0a18; color: #fff; border: 0; padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 13px; display: inline-block; }
button:hover, .btn:hover { background: #e60012; }
button.big { padding: 10px 22px; font-size: 14px; }
button.sm, a.sm { padding: 3px 8px; font-size: 12px; }
.warnbtn { background: #b07a00; }
.right { float: right; }
.filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.filter input, .filter select, .filter button { padding: 6px 9px; border: 1px solid #cfd8e3; border-radius: 6px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input, .inline select { padding: 5px 7px; border: 1px solid #cfd8e3; border-radius: 6px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 950px) { .cols { grid-template-columns: 1fr; } }
.neg { color: #c02626; }
.nowrap { white-space: nowrap; }
/* ===== 登录页 ===== */
.authpage { min-height: 100vh; }
.auth-bg { position: fixed; inset: 0; background: radial-gradient(1100px 550px at 15% -10%, #ff4d57 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ff2b4e 0%, transparent 55%), linear-gradient(160deg, #e60012, #7c0007); }
.auth-card { position: relative; max-width: 400px; margin: 8vh auto; background: #fff; border-radius: 18px; padding: 26px 34px 22px; box-shadow: 0 22px 60px rgba(80,0,6,.5); }
.auth-logo { width: 230px; max-width: 100%; display: block; margin: 0 auto 4px; border-radius: 12px; }
.auth-card h1 { text-align: center; margin: 8px 0 0; font-size: 22px; letter-spacing: 8px; text-indent: 8px; color: #26303b; }
.auth-sub { text-align: center; color: #8a97a8; font-size: 12px; margin: 6px 0 16px; }
.auth-form label { display: block; font-size: 12px; color: #6b7a8d; margin-top: 12px; }
.auth-form input { display: block; width: 100%; padding: 12px; margin-top: 4px; border: 1.5px solid #dde4ec; border-radius: 10px; font-size: 16px; }
.auth-form input:focus { outline: none; border-color: #e60012; box-shadow: 0 0 0 3px rgba(230,0,18,.12); }
.auth-btn { width: 100%; margin-top: 20px; padding: 13px; font-size: 16px; letter-spacing: 10px; text-indent: 10px; background: linear-gradient(90deg, #e60012, #ff4b4b); border-radius: 10px; }
.auth-hint { text-align: center; color: #98a5b5; font-size: 12px; margin-top: 16px; }
.auth-foot { position: relative; text-align: center; color: rgba(255,255,255,.8); font-size: 12px; margin: 20px 0 30px; }
/* ===== 统计条/榜单/徽章 ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { background: #fff; border-radius: 20px; padding: 5px 13px; font-size: 12px; color: #46586e; box-shadow: 0 1px 4px rgba(20,40,70,.08); }
.chip b { font-size: 14px; margin-left: 2px; }
.hbar { display: inline-block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #e60012, #ff8080); vertical-align: middle; min-width: 2px; }
.hbar.green { background: linear-gradient(90deg, #2e7d4f, #72c795); }
.hbar.grey { background: linear-gradient(90deg, #9db3c8, #c9d6e4); }
.tbl tr.rk1 td { background: #fff6e3; }
.tbl tr.me td { background: #fdeef0; }
.dot { display: inline-block; width: 7px; height: 7px; background: #f59e0b; border-radius: 50%; margin-left: 3px; vertical-align: 2px; }
.warn-text { color: #b07a00; }
/* 业主端进度 */
.progress-outer { background: #e3e9f1; border-radius: 10px; height: 14px; overflow: hidden; margin: 10px 0 4px; }
.progress-inner { background: linear-gradient(90deg, #2e7d4f, #4caf72); height: 100%; border-radius: 10px; transition: width .4s; }
.timeline { position: relative; margin-left: 8px; padding-left: 22px; border-left: 2px solid #dfe6ef; }
.tl-item { position: relative; padding: 6px 0 14px; }
.tl-dot { position: absolute; left: -33px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: #e3e9f1; color: #6b7a8d; text-align: center; line-height: 24px; font-size: 13px; border: 2px solid #fff; }
.tl-item.done .tl-dot { background: #2e7d4f; color: #fff; }
.tl-item.cur .tl-dot { background: #1f6fd0; color: #fff; }
.tl-item.done { opacity: .85; }
.tl-item.cur { font-weight: 600; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photogrid figure { margin: 0; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(20,40,70,.1); }
.photogrid img { width: 100%; height: 130px; object-fit: cover; display: block; }
.photogrid figcaption { font-size: 11px; color: #6b7a8d; padding: 5px 7px; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.photo-row figure { margin: 0; width: 150px; background: #fff; border: 1px solid #e4eaf1; border-radius: 8px; overflow: hidden; }
.photo-row img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-row figcaption { font-size: 11px; color: #6b7a8d; padding: 4px 6px; }
table.kv td { border-bottom: 1px dashed #e7ebf0; }
table.kv td:nth-child(odd) { color: #6b7a8d; width: 90px; }

/* ===== 移动端适配 ===== */
@media (max-width: 760px) {
  body { font-size: 15px; }
  header.top { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 6px 10px; }
  .brand { font-size: 15px; width: 100%; }
  header nav { order: 3; width: 100%; }
  header nav a { padding: 7px 10px; font-size: 14px; }
  header .who { font-size: 12px; gap: 8px; }
  .pwdbox form { right: 8px; }
  main { margin-top: 8px; padding: 0 8px 90px; }
  h1.page { font-size: 17px; }
  h1.page .right { float: none; display: inline-block; margin-left: 8px; }
  /* 宽表格 → 横向滑动 */
  table.tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table.tbl.kv { white-space: normal; }
  /* 16px 防止 iOS 聚焦自动放大 */
  .tbl input, .tbl select, .form input, .form select, .filter input, .filter select { font-size: 16px; }
  .form input, .form select { padding: 10px 9px; }
  input[type="date"], input[type="month"] { max-width: 150px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  button { padding: 10px 16px; }
  button.big { width: 100%; }
  button.sm, a.sm { padding: 7px 12px; margin: 1px; }
  .cards { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .card { min-width: 150px; flex: 0 0 auto; }
  .card b { font-size: 18px; }
  .filter { gap: 6px; }
  .filter input, .filter select, .filter button { flex: 1 1 45%; min-width: 0; }
  .inline { flex-wrap: wrap; gap: 8px; }
  .inline input, .inline select { font-size: 16px; padding: 8px; }
  .tbl th, .tbl td { padding: 8px; }
  .auth-card { margin: 4vh 12px; padding: 20px 20px 16px; }
  .brand img { height: 26px; }
}

/* 两级确认 & 顾家家居 */
button.okbtn { background: #1f9d55; }
button.okbtn:hover { background: #27ae60; }
button.grey { background: #7c8ea1; }
button.grey:hover { background: #64758a; }
.tag.grey { background: #e6ebf2; color: #6b7c93; }
.tag.kk-定制 { background: #fde8d8; color: #b45309; }
.tag.kk-软体 { background: #dff1fb; color: #0369a1; }

/* 批次C：客户类型 / 回访提醒 / 批次D顾家售后 */
.tag.err { background: #fbe3e3; color: #c02626; }
.tag.lv-A { background: #fbe3e3; color: #c02626; }
.tag.lv-B { background: #fdf0d5; color: #a26a00; }
.tag.lv-C { background: #e6ebf2; color: #46586e; }
.tag.duty-设计师 { background: #ede2f7; color: #6b3fa0; }
.tag.duty-工厂 { background: #fde8d8; color: #b45309; }
.tag.duty-安装 { background: #dff1fb; color: #0369a1; }
.tag.duty-运输 { background: #e0f2f1; color: #00695c; }
.tag.duty-其它 { background: #e6ebf2; color: #46586e; }
