:root {
  --primary: #FF6B35;
  --text: #1D2129;
  --sub: #86909C;
  --muted: #C9CDD4;
  --bg: #F2F3F5;
  --white: #FFFFFF;
  --line: #E5E6EB;
  --ok: #00B42A;
  --warn: #FF7D00;
  --danger: #F53F3F;
  --info: #165DFF;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 24px 20px 80px; }
.banner {
  background: #fff7ed;
  border: 1px solid #ffd8bf;
  color: #ad4e00;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.brand-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: transparent;
}
.brand-copy { min-width: 0; }
.brand-name {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #4e5969;
}
.brand-copy h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.page-ver {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  color: #c9cdd4;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.brand-panel .lead {
  margin: 0 0 14px;
  max-width: 42em;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.55;
}
.brand-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
}
.brand-url {
  flex: 1 1 220px;
  min-width: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  color: #86909c;
  word-break: break-all;
}
.brand-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
h1 { font-size: 24px; margin: 0 0 8px; font-weight: 700; }
.lead { color: var(--sub); font-size: 14px; margin: 0 0 16px; line-height: 1.6; }
.btn {
  border: none;
  border-radius: 8px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--line);
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
}
.layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.25fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
}
.preview-col { position: sticky; top: 16px; min-width: 0; }
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.sec { font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.hint { font-size: 12px; color: var(--sub); margin: 0 0 14px; line-height: 1.5; }
label.field { display: block; margin-bottom: 12px; }
.field-name { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="date"], textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
textarea {
  height: 88px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
input[readonly], input:disabled {
  background: #f5f7fb;
  color: #64748b;
}
.field-count { display: block; margin-top: 4px; font-size: 12px; color: var(--sub); text-align: right; }
.field--error textarea {
  border-color: var(--danger);
}
input[type="date"] { color-scheme: light; }
input:focus { border-color: var(--primary); }
.req { color: var(--danger); margin-left: 2px; }
.field--error .field-name,
.field--error .addr-tag,
.field--error .radio-label { color: var(--danger); }
.field--error input[type="text"],
.field--error input[type="tel"],
.field--error input[type="date"],
.field--error .cell-pick {
  border-color: var(--danger);
}
.addr-box.field--error {
  box-shadow: inset 0 0 0 1px var(--danger);
}
.seg.seg--error {
  outline: 1px solid var(--danger);
  border-radius: 10px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.addr-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.addr-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 6px 10px;
  text-align: center;
}
.addr-tag { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.addr-box input {
  width: 100%;
  height: 32px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 14px;
  outline: none;
}
.cell-pick {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 12px;
}
.cell-pick .empty { color: var(--muted); }
.community-wrap { position: relative; margin-bottom: 12px; }
.community-wrap input:disabled { background: var(--bg); color: var(--muted); }
.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 6;
  max-height: 240px;
  overflow: auto;
}
.suggest-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--bg); }
.suggest-item small { display: block; color: var(--sub); font-size: 12px; margin-top: 2px; }
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px 16px;
  box-sizing: border-box;
}
.sheet {
  width: min(560px, 100%);
  max-height: 72vh;
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 24px;
  overflow: auto;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}
.city-sheet {
  width: min(420px, 100%);
  min-height: 0;
  max-height: min(72vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 12px;
}
.city-sheet .sheet-head {
  flex-shrink: 0;
}
.city-sheet .sheet-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 280px;
  max-height: min(280px, 46svh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.picker-open {
  overflow: hidden;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
}
.continue-sheet {
  align-self: center;
  border-radius: 16px;
  max-height: none;
  width: min(420px, calc(100% - 32px));
  margin: 16px;
  padding-bottom: 20px;
}
.continue-body { padding: 4px 4px 0; }
.continue-lead {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.continue-ask {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.contract-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  margin-bottom: 12px;
  align-items: start;
}
@media (max-width: 640px) {
  .contract-dates { grid-template-columns: 1fr; }
}
.contract-dates > .field {
  margin-bottom: 0;
}
.quick-term {
  margin: 0;
  min-height: 0;
}
.quick-term .field-name { margin-bottom: 6px; }
.quick-term-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}
.quick-term-seg button {
  flex: 0 0 auto;
  min-width: 64px;
  border: none;
  background: transparent;
  color: var(--sub);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.quick-term-seg button.on {
  background: var(--white);
  color: var(--primary);
  font-weight: 700;
}
.city-item {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.city-item.on { color: var(--primary); font-weight: 700; }
.radio-label { font-size: 12px; color: var(--sub); font-weight: 600; margin: 4px 0 8px; }
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}
.seg button {
  flex: 1 1 auto;
  min-width: 72px;
  border: none;
  background: transparent;
  color: var(--sub);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.seg button.on {
  background: var(--white);
  color: var(--primary);
  font-weight: 700;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--sub); }
.callout {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  margin: 10px 0;
}
.callout.info { background: #e8f3ff; color: #0e42d2; }
.callout.ok { background: #e8ffea; color: #009a29; }
.callout.warn { background: #fff7e8; color: #d25f00; }
.callout.err { background: #ffece8; color: #cb2634; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--sub); font-weight: 600; }
table th:nth-child(2),
table td:nth-child(2),
table th:nth-child(4),
table td:nth-child(4) { white-space: nowrap; }
tr.row-excluded td { color: var(--muted); text-decoration: line-through; }
tr.row-excluded td.col-act { text-decoration: none; }
tr.row-paid td { color: #15803d; }
.col-act { white-space: nowrap; width: auto; }
.paid-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.paid-check.is-off { color: var(--muted); cursor: default; }
.paid-check input { width: auto; height: auto; margin: 0; }
.btn-mini {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
}
.btn-mini.warn { color: var(--danger); border-color: #f7c1c1; }
.room-tag {
  float: right;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}
.login-box { max-width: 420px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bill-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  background: #fafafa;
}
.bill-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.bill-group-head b { font-size: 14px; }
.preview-commit { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.err-text { color: var(--danger); font-size: 12px; margin-top: 8px; }
.busy-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(29, 33, 41, 0.36);
}
.busy-box {
  width: min(280px, 100%);
  background: var(--white);
  border-radius: 16px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}
.busy-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #ffd8bf;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}
@keyframes busy-spin {
  to { transform: rotate(360deg); }
}
.busy-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.busy-sub {
  margin: 0;
  font-size: 13px;
  color: var(--sub);
}
.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.option-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.option-chip button {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
}
.option-chip.on {
  border-color: #ffd8bf;
  background: #fff7ed;
}
.option-chip.on button { color: var(--primary); font-weight: 700; }
.chip-x {
  padding: 8px 8px !important;
  color: var(--sub) !important;
  border-left: 1px solid var(--line) !important;
}
.custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.custom-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px;
  padding: 0 10px;
}
.custom-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.media-item {
  position: relative;
  width: 88px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}
.media-thumb {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.media-name {
  display: block;
  font-size: 11px;
  color: var(--sub);
  word-break: break-all;
}
.media-item .chip-x {
  position: absolute;
  top: 0;
  right: 0;
  background: #fff !important;
  border-left: none !important;
}
.media-add {
  width: 88px;
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 12px;
  cursor: pointer;
  position: relative;
}
.media-add input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.sub-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0 12px;
  background: #fafafa;
}
.sub-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
.media-block { margin: 8px 0 12px; }
@media (prefers-reduced-motion: reduce) {
  .busy-spinner { animation: none; }
}
