:root {
  --bg: #f4f1eb;
  --paper: #fff;
  --ink: #1f1b16;
  --muted: #6b6560;
  --line: #e6e2dc;
  --subtle: #f7f5f1;
  --warn: #8a5a12;
  --warn-bg: #f8efe2;
  --warn-line: #ead7b8;
  --ok: #1f6b3a;
  --ok-bg: #e7f5ec;
  --danger: #9b1c1c;
  --danger-bg: #fdecec;
  --accent: #1f4f8a;
  --accent-soft: #e8eef6;
  --shadow: 0 12px 40px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font: 16px/1.6 "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }
button[disabled] { opacity: .55; cursor: default; }

.demo-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn);
  text-align: center;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}

.app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-hd {
  padding: 14px 20px 12px;
  border-bottom: 1px solid #eee;
  background: var(--paper);
  position: sticky;
  top: 42px;
  z-index: 30;
}

.app-hd .app-name { font-size: 13px; color: var(--muted); }
.app-hd h1 { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.app-hd .who {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.app-bd {
  flex: 1;
  padding: 16px 20px 20px;
  display: none;
  gap: 12px;
}
.app-bd.on { display: grid; align-content: start; }

.nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px 12px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.nav.show { display: grid; }
.nav button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.nav button.on {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.field, .fake { display: grid; gap: 6px; }
.field b, .fake b, .lab { font-size: 13px; font-weight: 700; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; font-weight: 400; }

input[type=text],
input[type=tel],
input[type=password],
input[type=number],
input[type=file],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 88px; resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b6560' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.btn, .btn2, .btn3 {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  width: 100%;
}

.btn { background: var(--accent); color: #fff; }
.btn2 { background: var(--subtle); border: 1px solid var(--line); }
.btn3 { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c8c8; }

.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn, .btns .btn2, .btns .btn3 { width: auto; flex: 1; min-width: 96px; }

.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.alert, .neutral, .okbox, .dangerbox {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
}
.alert { background: var(--warn-bg); color: var(--warn); }
.neutral { background: var(--subtle); }
.okbox { background: var(--ok-bg); color: var(--ok); }
.warnbox { background: var(--warn-bg); color: var(--warn); }
.dangerbox { background: var(--danger-bg); color: var(--danger); }
button.card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.kv-row { display: grid; grid-template-columns: 7em 1fr; gap: 8px; font-size: 14px; }
.kv-row b { color: var(--muted); font-weight: 600; }

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--subtle);
  white-space: nowrap;
  font-weight: 650;
}
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.acc { background: var(--accent-soft); color: var(--accent); }

.ticket, .card, .panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--paper);
}
.ticket { cursor: pointer; }
.ticket .top, .kv-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.ticket + .ticket, .card + .card, .panel + .panel { margin-top: 0; }
.list { display: grid; gap: 10px; }

.kv { display: grid; gap: 8px; }
.kv div { display: grid; grid-template-columns: 7em 1fr; gap: 8px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 600; }

.checks { display: grid; gap: 8px; }
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
}
.check input { margin-top: 4px; }

.demo-accounts {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.demo-accounts button {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--subtle);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.demo-accounts button strong { display: block; font-size: 14px; }
.demo-accounts button span { color: var(--muted); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: 14px;
  text-align: left;
  width: auto;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

.money { font-variant-numeric: tabular-nums; font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
  max-width: 80%;
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.dlg-mask {
  position: fixed;
  inset: 0;
  background: rgba(31,27,22,.4);
  z-index: 70;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.dlg-mask.on { display: flex; }
.dlg {
  background: var(--paper);
  width: 100%;
  max-width: 430px;
  border-radius: 16px 16px 0 0;
  padding: 16px 20px 24px;
}
.dlg h3 { margin: 0 0 8px; font-size: 18px; }

.file-name { font-size: 13px; color: var(--accent); }

.pending-flag {
  border: 1px dashed var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

@media (min-width: 700px) {
  body { padding: 24px 0 40px; }
  .app {
    min-height: 760px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid #d6d3cd;
  }
  .app-hd { top: 0; }
  .demo-banner {
    max-width: 430px;
    margin: 0 auto 0;
    border-radius: 0;
  }
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .demo-banner { width: 100%; max-width: 430px; border-radius: 12px 12px 0 0; position: static; }
  .app { border-radius: 0 0 28px 28px; }
}
