/* 财富值北运营壳与登录页：对齐原版管理端布局与 token。不改若依 style/login/skins.css。 */
:root {
  --ink: #193e34;
  --gold: #aa874c;
  --paper: #f6f4ed;
  --line: #dce1d5;
  --muted: #7f897a;
  --card: #fffef9;
  --danger: #a55448;
}

* { box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font: 14px -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}

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

button {
  cursor: pointer;
  background: white;
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

button:hover { border-color: #9baa96; }

button:disabled {
  opacity: .5;
  cursor: wait;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- 登录页 ---------- */
body.wealth-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--paper);
}

.login {
  max-width: 440px;
  width: calc(100% - 32px);
  margin: 70px auto 40px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 36px;
  border-radius: 7px;
}

.login .eyebrow {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 2px;
}

.login h1 {
  font: 500 27px serif;
  letter-spacing: 3px;
  margin: 10px 0 0;
}

.login h2 {
  font: 23px serif;
  margin: 8px 0 18px;
}

.login p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}

.login-captcha {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: end;
}

.login-captcha img {
  display: block;
  width: 100%;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: #fafbf6;
  margin-top: 7px;
}

.login-status {
  min-height: 1.6em;
  font-size: 12px;
  color: var(--danger);
  margin: 8px 0 0;
}

.login-status.ok { color: var(--ink); }

.login-foot {
  margin: 0 0 40px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 运营壳布局 ---------- */
body.wealth-ops aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: var(--ink);
  color: #dbe3ce;
  padding: 35px 22px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

body.wealth-ops .brand {
  text-decoration: none;
  color: #eee4c5;
  font: 23px serif;
  letter-spacing: 3px;
  padding-left: 8px;
}

body.wealth-ops .brand small {
  display: block;
  font: 9px sans-serif;
  letter-spacing: 2px;
  margin-top: 10px;
  color: #adc1a4;
}

body.wealth-ops nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 50px;
}

body.wealth-ops nav button {
  background: none;
  color: #adc1a4;
  border: 0;
  text-align: left;
  padding: 15px;
  border-radius: 0;
}

body.wealth-ops nav button.active {
  background: #ffffff13;
  color: #f0e2bb;
  border-left: 2px solid #bda26b;
  border-radius: 0 4px 4px 0;
}

body.wealth-ops .aside-foot {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.9;
  color: #8ea683;
}

body.wealth-ops .aside-sys {
  display: block;
  margin-top: 12px;
  color: #c9d6b8;
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 1px;
}

body.wealth-ops .aside-sys:hover { color: #f0e2bb; }

body.wealth-ops .body {
  margin-left: 220px;
  padding: 0 40px;
  min-height: 100vh;
}

body.wealth-ops header {
  padding: 34px 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.eyebrow {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 2px;
}

body.wealth-ops h1 {
  font-size: 27px;
  font-weight: 500;
  margin: 10px 0 0;
  font-family: serif;
}

h2 { font: 23px serif; margin: 0 0 18px; }
h3 { font: 19px serif; }

body.wealth-ops main { padding: 30px 0 60px; }

.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

#status {
  font-size: 11px;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 25px;
}

.metric span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.metric b {
  display: block;
  font: 34px Georgia, serif;
  color: var(--gold);
  margin-top: 18px;
}

.panel { margin: 22px 0; }

.panel p {
  color: var(--muted);
  line-height: 1.9;
}

.notice {
  font-size: 12px;
  background: #ede9d9;
  color: #847447;
  padding: 14px 18px;
  line-height: 1.8;
  border-radius: 4px;
  margin-bottom: 22px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  white-space: normal;
}

th, td {
  padding: 17px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  background: #f7f8f0;
}

td button {
  font-size: 11px;
  padding: 7px 12px;
  margin: 2px;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.7;
}

td .break {
  overflow-wrap: anywhere;
  max-width: 280px;
}

.tag {
  display: inline-block;
  background: #e9efdf;
  color: #637955;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 10px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.toolbar label { margin: 0; }

.toolbar input, .toolbar select { min-width: 150px; }

.empty {
  text-align: center;
  padding: 45px;
  color: var(--muted);
}

label {
  display: block;
  font-size: 12px;
  margin: 15px 0 7px;
  color: #596951;
}

input:not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #d8dfce;
  border-radius: 4px;
  background: #fafbf6;
  color: var(--ink);
  margin-top: 7px;
}

input[type=checkbox] {
  width: auto;
  margin: 0;
}

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

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.primary:hover {
  background: #285446;
  border-color: #285446;
  color: white;
}

form > .primary {
  margin-top: 20px;
  width: 100%;
}

.danger { color: var(--danger); }

.muted {
  color: var(--muted);
  font-size: 12px;
}

.preline {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  width: min(740px, 94vw);
  padding: 32px;
  max-height: 90vh;
  overflow: auto;
}

dialog::backdrop {
  background: #17372d80;
  backdrop-filter: blur(3px);
}

.close {
  float: right;
  border: 0;
  font-size: 23px;
  padding: 0 6px;
  background: none;
}

.reply {
  background: #eaf0e2;
  padding: 15px;
  margin-top: 12px;
}

.sku-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 5px;
  padding: 14px 24px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  max-width: 90vw;
  transition: opacity .2s ease;
}

#toast.show { opacity: 1; }

@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  body.wealth-ops .body { padding: 0 24px; margin-left: 180px; }
  body.wealth-ops aside { width: 180px; }
  body.wealth-ops .brand { font-size: 19px; }
  body.wealth-ops header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  body.wealth-ops aside {
    position: static;
    width: auto;
    padding: 20px;
  }
  body.wealth-ops .brand small,
  body.wealth-ops .aside-foot { display: none; }
  body.wealth-ops nav {
    margin-top: 20px;
    flex-direction: row;
    overflow: auto;
    gap: 6px;
  }
  body.wealth-ops nav button {
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }
  body.wealth-ops .body { margin: 0; padding: 0 16px; }
  .metrics { gap: 10px; }
  .metric { padding: 18px; }
  .metric b { font-size: 26px; }
  body.wealth-ops header { padding-top: 22px; }
  .grid { grid-template-columns: 1fr; }
  .sku-row { grid-template-columns: 1fr 1fr; }
  dialog { padding: 22px; }
  .panel { padding: 16px; }
  .login { margin-top: 36px; padding: 24px; }
}
