:root {
  --paper: #f3eee4;
  --paper-2: #e8e0d2;
  --ink: #2b261f;
  --muted: #7a7266;
  --line: #ddd4c6;
  --card: #fffaf2;
  --moss: #3f6f52;
  --moss-2: #2f5640;
  --leaf: #6ea37c;
  --clay: #c45c26;
  --clay-2: #a4471a;
  --gold: #c9a227;
  --ok: #2f7a4f;
  --err: #b33a2b;
  --warn: #b7811a;
  --shadow: 0 18px 40px rgba(80, 58, 28, .08);
  --radius: 18px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --brand: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--moss-2); text-decoration: none; }
a:hover { color: var(--clay); }

body.page-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(900px 420px at 8% -10%, #f7e7c8 0%, transparent 60%),
    radial-gradient(700px 380px at 110% 10%, #d9eadc 0%, transparent 55%),
    var(--paper);
  overflow-x: hidden;
}

.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.floaters i {
  position: absolute;
  width: 18px;
  height: 12px;
  border-radius: 3px 3px 6px 6px;
  background: #e8c48a;
  opacity: .35;
  animation: fall 14s linear infinite;
}
.floaters i:nth-child(1) { left: 8%; animation-duration: 16s; }
.floaters i:nth-child(2) { left: 22%; animation-delay: -3s; width: 14px; }
.floaters i:nth-child(3) { left: 38%; animation-delay: -7s; background: #d9eadc; }
.floaters i:nth-child(4) { left: 55%; animation-delay: -2s; }
.floaters i:nth-child(5) { left: 68%; animation-delay: -9s; background: #f1c2a6; }
.floaters i:nth-child(6) { left: 79%; animation-delay: -5s; }
.floaters i:nth-child(7) { left: 90%; animation-delay: -11s; }
.floaters i:nth-child(8) { left: 14%; animation-delay: -13s; top: 40%; }
@keyframes fall {
  from { transform: translateY(-40px) rotate(-12deg); }
  to { transform: translateY(110vh) rotate(18deg); }
}

.hero-wrap {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 42px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-copy h1, .auth-card h1, .brand-row h1 {
  font-family: var(--brand);
  font-size: 56px;
  margin: 0;
  letter-spacing: .08em;
  font-weight: 600;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--clay);
  letter-spacing: .28em;
  font-size: 12px;
}
.lede { color: var(--muted); font-size: 16px; max-width: 36em; }
.feat-list { list-style: none; padding: 0; margin: 28px 0 0; }
.feat-list li { display: flex; gap: 12px; margin: 10px 0; color: #5c564c; }
.feat-list span {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #e7f0e6; color: var(--moss-2);
  font-size: 13px; flex: none;
}

.brand-row { display: flex; gap: 14px; align-items: center; }
.brand-row.compact { padding: 8px 4px 22px; }
.brand-row.compact strong { display: block; font-family: var(--brand); font-size: 22px; letter-spacing: .12em; }
.brand-row.compact em { font-style: normal; color: var(--muted); font-size: 12px; }
.logo-mark {
  width: 52px; height: 52px; border-radius: 18px;
  display: grid; place-items: center;
  background: #eef6ee; font-size: 28px;
  box-shadow: inset 0 0 0 1px #d5e6d6;
}
.logo-mark.pulse { animation: breathe 2.8s ease-in-out infinite; }
.logo-mark.has-img {
  padding: 4px;
  background: #fff;
  overflow: hidden;
}
.logo-mark.has-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 4px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
}
.auth-tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: #f3eee4;
  font-size: 13px;
}
.auth-tabs a.active,
.auth-tabs a:hover {
  background: #e7f0e6;
  color: var(--moss-2);
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.auth-card, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card, .install-card { padding: 32px 28px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.stack { display: grid; gap: 14px; margin-top: 18px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid #e4dacb;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #b7d0b8;
  box-shadow: 0 0 0 4px rgba(63, 111, 82, .12);
}
.btn {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 11px 16px;
  transition: transform .18s ease, background .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--moss); color: #fff; }
.btn-primary:hover { background: var(--moss-2); }
.btn-clay { background: var(--clay); color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn-sm { padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.foot-note { color: var(--muted); font-size: 12px; margin: 22px 0 0; }
.form-err, .banner { border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.form-err, .banner.err { background: #fbeceb; color: var(--err); }
.banner.ok { background: #e8f4ec; color: var(--ok); }
.banner.warn { background: #f8efd8; color: var(--warn); margin-bottom: 14px; }

.page-app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sider {
  background: #f8f3ea;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav { display: grid; gap: 4px; }
.nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #5b544a;
  transition: background .2s, color .2s, transform .2s;
}
.nav a:hover, .nav a.active {
  background: #eef6ee;
  color: var(--moss-2);
}
.sider-foot { margin-top: auto; display: grid; gap: 10px; }
.who { font-size: 13px; color: var(--muted); }
.workspace { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px 8px;
}
.topbar h2 { margin: 0; font-size: 22px; }
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.top-status {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eee7da;
  color: var(--muted);
}
.top-status.on { background: #e5f3ea; color: var(--ok); }
.top-status.off { background: #fbeceb; color: var(--err); }
.view { padding: 10px 28px 48px; animation: rise .35s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat {
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.stat b { display: block; font-size: 28px; letter-spacing: -.03em; margin-top: 6px; }
.stat span { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.stat.accent { background: #f7efe2; }
.panel { padding: 18px; margin-top: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.feed { display: grid; gap: 8px; }
.feed-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #faf6ef;
  animation: pop .35s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eee7da;
}
.pill.ok { background: #e5f3ea; color: var(--ok); }
.pill.warn { background: #f8efd8; color: var(--warn); }
.pill.err { background: #fbeceb; color: var(--err); }
.pill.live { background: #e5f3ea; color: var(--ok); }
.pill.live::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(47,122,79,.5);
  animation: ping 1.6s infinite;
}
@keyframes ping {
  70% { box-shadow: 0 0 0 8px transparent; }
}

.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.account-card { padding: 16px; display: grid; gap: 10px; }
.account-card.online { box-shadow: inset 3px 0 0 var(--moss); }
.account-card header { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.acc-pick { display: flex; align-items: flex-start; gap: 8px; margin: 0; cursor: pointer; }
.acc-pick input { margin-top: 4px; }
.kvs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.switch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px;
}
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #ddd4c6; position: relative; transition: .2s; flex: none; padding: 0; }
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: .2s;
}
.switch input:checked { background: var(--moss); }
.switch input:checked::after { left: 19px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 31, .46);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}
.modal-card {
  width: min(400px, 100%);
  background: #fffaf2;
  border-radius: 16px;
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.modal-card .stack { margin-top: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.mode-switch { display: flex; gap: 6px; margin-top: 4px; }
.mode-switch a, .mode-switch button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}
.mode-switch a.on, .mode-switch button.on { background: var(--moss); color: #fff; border-color: transparent; }
.log-box {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: #2b261f;
  color: #f3eee4;
  border-radius: 12px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.join-accs {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e4dacb;
  border-radius: 12px;
  padding: 10px;
}
.join-accs label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #3d372f;
  font-size: 13px;
}
.join-accs input { width: auto; padding: 0; flex: none; box-shadow: none; }
.pick-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.send-wrap { display: grid; gap: 14px; max-width: 720px; }
.send-card { position: relative; padding: 20px 20px 20px 28px; }
.send-step {
  position: absolute; left: 14px; top: 18px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--moss); color: #fff;
  font-size: 12px; display: grid; place-items: center;
}
.send-card h3 { margin: 0 0 6px; padding-left: 18px; }
.send-card .tiny { padding-left: 18px; }
.send-card label, .send-card .amt-box, .send-card .cur-row, .send-card .join-accs, .send-card .pick-tools, .send-card .modal-actions, .send-card .send-preview { margin-left: 18px; }
.cur-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cur-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; letter-spacing: .06em;
  cursor: pointer; color: #3d372f; position: relative;
  background: #fff; transition: background .15s, color .15s, border-color .15s;
}
.cur-chip input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; margin: 0; padding: 0;
}
.cur-chip.on { background: var(--moss); color: #fff; border-color: transparent; }
.amt-box { display: grid; gap: 8px; margin: 12px 0; }
.send-preview {
  background: #eef6ee; color: var(--moss-2);
  border-radius: 12px; padding: 10px 12px; font-size: 13px;
}
.wallet-hint { background: #f6f1e8; border-radius: 10px; padding: 8px 10px; }
.bar { height: 8px; background: #efe7da; border-radius: 99px; overflow: hidden; min-width: 120px; }
.bar > i { display: block; height: 100%; background: var(--moss); border-radius: 99px; transition: width .35s ease; }
.task-card { margin-bottom: 12px; display: grid; gap: 8px; }
.task-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.task-card.is-hi { box-shadow: inset 0 0 0 2px var(--moss); }
.task-items { list-style: none; padding: 0; margin: 8px 0 0; max-height: 280px; overflow: auto; }
.task-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #efe7da; font-size: 13px; }
.task-items li:last-child { border-bottom: 0; }
.task-mini { display: grid; gap: 6px; margin: 10px 0 14px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #efe7da; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr { transition: background .15s; }
tr:hover td { background: #faf6ef; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 12px;
}
.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  margin-top: 8px;
}
.chart i {
  flex: 1;
  background: #d9eadc;
  border-radius: 8px 8px 3px 3px;
  min-height: 6px;
  position: relative;
  transition: height .4s ease;
}
.chart i:hover { background: var(--leaf); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 31, .28);
  display: none;
  place-items: center;
  padding: 18px;
  z-index: 40;
  pointer-events: none;
}
.modal-mask:not([hidden]) {
  display: grid;
  pointer-events: auto;
  animation: fade .2s ease;
}
.modal-mask[hidden] {
  display: none !important;
  pointer-events: none !important;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(460px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 22px;
  animation: rise .28s ease;
}
.modal h3 { margin: 0 0 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px;
  display: grid; gap: 8px; z-index: 50;
}
.toast {
  background: #2b261f; color: #fffaf2;
  padding: 10px 14px; border-radius: 12px;
  animation: rise .25s ease;
  box-shadow: var(--shadow);
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--moss-2); }

.page-foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.plan-card {
  padding: 22px 20px 20px;
  display: grid;
  gap: 10px;
  align-content: start;
  position: relative;
  overflow: hidden;
}
.plan-card h3 { margin: 0; font-family: var(--brand); font-size: 24px; letter-spacing: .06em; }
.plan-kicker { font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.plan-card .btn { text-align: center; margin-top: 8px; display: block; }
.plan-card.is-current { box-shadow: inset 0 0 0 2px var(--moss); }
.plan-bronze { background: #fbf6f0; }
.plan-silver { background: #f4f6f8; }
.plan-gold { background: #f8f3e4; }
.plan-ribbon {
  position: absolute;
  top: 14px;
  right: -28px;
  background: var(--clay);
  color: #fff;
  font-size: 11px;
  padding: 4px 36px;
  transform: rotate(32deg);
}
.plan-feat { list-style: none; padding: 0; margin: 8px 0 0; }
.plan-feat li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #efe7da;
  font-size: 13px;
}
.plan-feat li:last-child { border-bottom: 0; }
.plan-feat i {
  font-style: normal;
  font-size: 11px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 0;
}
.plan-feat li.on i { background: #e5f3ea; color: var(--ok); }
.plan-feat li.off { color: #b8b0a4; }
.plan-feat li.off span { text-decoration: line-through; }
.plan-feat li.off i { background: #f1ece3; color: #a89f93; }
.member-set { display: grid; gap: 6px; min-width: 168px; }
.member-set select, .member-set input { padding: 7px 8px; font-size: 13px; }
.switch.dimmed { opacity: .45; }

@media (max-width: 960px) {
  .hero-wrap, .page-app, .grid-stats, .plan-grid { grid-template-columns: 1fr; }
  .sider {
    position: relative;
    height: auto;
    transform: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .menu-btn { display: none; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .hero-copy h1 { font-size: 42px; }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; }
}

details.card { padding: 12px 16px; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
