/* ==================================================================
   KRON · 客户设计端（H5）
   ================================================================== */

body.client { padding-bottom: env(safe-area-inset-bottom); }

.ctop {
  position: sticky; top: 0; z-index: 40;
  height: 58px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 6, 10, .82);
  backdrop-filter: blur(14px);
}
.ctop .brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.ctop .brand .mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--cyan); color: var(--cyan); font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
  box-shadow: inset 0 0 14px rgba(45, 226, 255, .2);
}
.ctop .brand .bt b { display: block; font-family: var(--font-display); font-size: 13px; letter-spacing: .26em; line-height: 1; }
.ctop .brand .bt i { display: block; font-style: normal; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .16em; color: var(--mute); margin-top: 4px; }
.ctop-right { display: flex; align-items: center; gap: 12px; }
.ctop .live { font-size: 8.5px; letter-spacing: .16em; color: var(--mute); display: flex; align-items: center; gap: 6px; }

.view {
  max-width: 880px; margin: 0 auto;
  padding: 20px 18px calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  min-height: calc(100vh - 58px);
}

/* 底部 tab */
.tabbar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 45; display: flex; gap: 4px; padding: 6px;
  background: rgba(6, 10, 16, .9);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(45, 226, 255, .06);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.tabbar button {
  border: 0; background: transparent; color: var(--mute);
  width: 94px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; font-family: var(--font-body); transition: all .2s var(--ease);
}
.tabbar button i { font-style: normal; font-family: var(--font-mono); font-size: 15px; line-height: 1; }
.tabbar button span { font-size: 10.5px; letter-spacing: .04em; }
.tabbar button.active { color: var(--cyan); background: rgba(45, 226, 255, .07); }
.tabbar button.active i { text-shadow: 0 0 12px var(--cyan); }

/* 通用标题 */
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-h h2 { font-size: 18px; letter-spacing: .02em; }
.sec-h .sub { font-size: 11px; color: var(--mute); }
.c-card { padding: 18px; }
.c-card.tight { padding: 14px; }

/* ---------- 首页 ---------- */
.home-hero { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 16px; }
.hh-title { font-size: clamp(30px, 8vw, 44px); line-height: 1.06; letter-spacing: -.01em; }
.hh-title em { font-style: normal; background: linear-gradient(100deg, #bff8ff, var(--cyan) 45%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hh-sub { font-size: 12.5px; color: var(--mute); line-height: 1.8; }

.area-block { padding: 18px; }
.area-input-row { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.area-input {
  width: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--font-display); font-size: 54px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1; padding: 0;
  font-variant-numeric: tabular-nums;
}
.area-input::placeholder { color: var(--mute-2); }
.area-unit { font-size: 16px; color: var(--cyan); font-family: var(--font-mono); }
.area-hint { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10.5px; color: var(--mute); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan) var(--p, 50%), rgba(255,255,255,.08) var(--p, 50%)); outline: none; margin-top: 14px; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; background: #05080d;
  border: 1px solid var(--cyan); box-shadow: 0 0 14px var(--cyan);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chip {
  height: 38px; border: 1px solid var(--line); background: rgba(4, 8, 13, .6);
  color: var(--mute); font-size: 11.5px; cursor: pointer; font-family: var(--font-body);
  transition: all .2s var(--ease); border-radius: 1px;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active { background: rgba(45, 226, 255, .12); color: var(--cyan); border-color: var(--cyan); }

.opt-row { display: flex; gap: 10px; }
.opt-row .field { flex: 1; }

.home-matrix { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.hm { background: var(--bg-2); padding: 14px 12px; display: flex; flex-direction: column; gap: 5px; }
.hm .k { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; color: var(--mute-2); text-transform: uppercase; }
.hm .v { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.hm .v small { font-size: 10px; color: var(--mute); margin-left: 2px; }

.preview-panel { position: relative; }
.canvas-host { position: relative; height: 320px; background: radial-gradient(70% 60% at 50% 40%, rgba(45,226,255,.07), transparent 70%), #05080d; overflow: hidden; }
.canvas-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.canvas-tabs { position: absolute; top: 10px; left: 10px; display: flex; border: 1px solid var(--line); background: rgba(4,8,13,.8); }
.canvas-tabs button { border: 0; background: transparent; color: var(--mute); height: 26px; padding: 0 11px; font-size: 10px; cursor: pointer; border-right: 1px solid var(--line); }
.canvas-tabs button:last-child { border-right: 0; }
.canvas-tabs button.active { background: rgba(45,226,255,.14); color: var(--cyan); }
.canvas-hint { position: absolute; right: 10px; bottom: 8px; font-size: 8.5px; color: var(--mute-2); letter-spacing: .1em; }

/* 分区列表 */
.zone-list { display: flex; flex-direction: column; gap: 8px; }
.zone { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: rgba(45, 226, 255, .03); border-left: 1px solid var(--line-strong); }
.zone .zc { flex: 1; min-width: 0; }
.zone .zn { font-size: 12px; color: var(--ink-2); }
.zone .zd { font-size: 9.5px; color: var(--mute-2); font-family: var(--font-mono); letter-spacing: .04em; margin-top: 2px; }
.zone .zv { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); white-space: nowrap; }
.zone .zbar { width: 40px; height: 3px; background: rgba(255,255,255,.06); }
.zone .zbar i { display: block; height: 100%; background: var(--cyan); }
.zone.tatami { border-left-color: var(--violet); }
.zone.tatami .zv { color: var(--violet); }
.zone.tatami .zbar i { background: var(--violet); }

/* 房间编辑 */
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-card { border: 1px solid var(--line); background: rgba(9, 15, 23, .55); }
.room-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.room-head .rname { font-size: 14px; font-weight: 600; }
.room-head .rarea { font-family: var(--font-mono); font-size: 10px; color: var(--mute); letter-spacing: .06em; }
.room-head .rvol { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--cyan); }
.room-head .chev { color: var(--mute-2); font-size: 10px; transition: transform .2s; }
.room-card.open .chev { transform: rotate(90deg); }
.room-body { display: none; padding: 0 14px 14px; }
.room-card.open .room-body { display: block; }
.dim-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.dim { display: flex; flex-direction: column; gap: 4px; }
.dim label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; color: var(--mute-2); text-transform: uppercase; }
.dim input { width: 100%; height: 34px; padding: 0 6px; text-align: center; background: rgba(4, 8, 13, .9); border: 1px solid rgba(255,255,255,.08); color: var(--ink); font-family: var(--font-mono); font-size: 12px; outline: none; }
.dim input:focus { border-color: var(--cyan); }
.room-note { font-size: 11px; color: var(--mute); margin-bottom: 10px; }
.room-actions { display: flex; justify-content: space-between; margin-top: 10px; }
.link-btn { border: 0; background: transparent; color: var(--mute); font-size: 11px; cursor: pointer; padding: 4px 0; }
.link-btn:hover { color: var(--cyan); }
.link-btn.danger:hover { color: var(--bad); }

/* 报价 */
.price-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.price-big { font-family: var(--font-display); font-size: clamp(38px, 11vw, 56px); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.price-big small { font-size: 16px; color: var(--mute); font-weight: 400; }
.price-note { font-size: 11px; color: var(--mute); line-height: 1.7; text-align: right; }

.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.opt {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line); background: rgba(4, 8, 13, .5);
  cursor: pointer; transition: all .2s var(--ease); text-align: left;
}
.opt b { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.opt span { font-family: var(--font-mono); font-size: 9px; color: var(--mute-2); }
.opt:hover { border-color: var(--line-strong); }
.opt.active { border-color: var(--cyan); background: rgba(45, 226, 255, .08); }
.opt.active b { color: var(--cyan); }

.bk { display: flex; flex-direction: column; gap: 9px; }
.bk-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.bk-row .k { color: var(--mute); }
.bk-row .dots { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.1); transform: translateY(-3px); }
.bk-row .v { font-family: var(--font-mono); color: var(--ink-2); }
.bk-row.total { padding-top: 10px; border-top: 1px solid var(--line); }
.bk-row.total .k { color: var(--ink); font-weight: 600; }
.bk-row.total .v { color: var(--cyan); font-size: 15px; }
.bk-row.discount .v { color: var(--ok); }

.pay-steps { display: flex; gap: 8px; }
.pay-step { flex: 1; border: 1px solid var(--line); padding: 10px; text-align: center; }
.pay-step em { display: block; font-style: normal; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; color: var(--mute-2); }
.pay-step b { display: block; font-family: var(--font-mono); font-size: 12px; margin-top: 5px; color: var(--ink-2); }
.pay-step .p { font-family: var(--font-mono); font-size: 9px; color: var(--cyan); }

/* 项目 */
.proj-card { display: flex; flex-direction: column; gap: 12px; }
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj-head .pn { font-size: 15px; font-weight: 600; }
.proj-head .pc { font-family: var(--font-mono); font-size: 9.5px; color: var(--mute); letter-spacing: .1em; margin-top: 3px; }
.proj-meta { display: flex; gap: 18px; font-size: 11px; color: var(--mute); }
.proj-meta b { color: var(--ink-2); font-family: var(--font-mono); font-weight: 500; }
.progress-line { height: 4px; background: rgba(255,255,255,.06); position: relative; }
.progress-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 10px rgba(45,226,255,.5); }
.progress-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; color: var(--mute-2); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 20px; bottom: -4px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border: 1px solid var(--cyan); margin-top: 4px; flex: none; background: #05080d; }
.tl-item.done .tl-dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.tl-item .tl-t { font-size: 12px; color: var(--ink-2); }
.tl-item .tl-d { font-size: 10px; color: var(--mute-2); margin-top: 2px; font-family: var(--font-mono); }

.rate { display: flex; gap: 6px; font-size: 26px; color: var(--mute-2); cursor: pointer; }
.rate span.on { color: #ffbf47; text-shadow: 0 0 12px rgba(255,191,71,.4); }

/* 登录 / 我的 */
.auth-card { display: flex; flex-direction: column; gap: 14px; }
.auth-card .who { display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; display: grid; place-items: center; background: rgba(45,226,255,.1); border: 1px solid var(--line-strong); color: var(--cyan); font-size: 20px; font-weight: 700; }
.code-hint { font-family: var(--font-mono); font-size: 10px; color: var(--warn); letter-spacing: .08em; }

/* 附件 */
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.att { border: 1px solid var(--line); background: rgba(4, 8, 13, .6); padding: 8px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.att-thumb { height: 86px; background: #05080d; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(45, 226, 255, .1); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-ext { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .16em; }
.att-load { font-family: var(--font-mono); font-size: 11px; color: var(--mute-2); }
.att-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: 9px; color: var(--mute-2); }
.att-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* 空状态 */
.empty { border: 1px dashed var(--line); padding: 34px 18px; text-align: center; color: var(--mute); font-size: 12px; }
.empty b { display: block; font-family: var(--font-mono); font-size: 18px; color: var(--mute-2); letter-spacing: .3em; margin-bottom: 10px; }

/* 移动端适配 */
@media (max-width: 560px) {
  .chips { grid-template-columns: repeat(3, 1fr); }
  .chips .chip:nth-child(4), .chips .chip:nth-child(5) { grid-column: span 1; }
  .home-matrix { grid-template-columns: repeat(2, 1fr); }
  .dim-grid { grid-template-columns: repeat(3, 1fr); }
  .ctop .live { display: none; }
  .opt-grid { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
  .view { padding-top: 28px; }
  .home-matrix { grid-template-columns: repeat(4, 1fr); }
  .canvas-host { height: 400px; }
  .quote-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
}
