:root {
  --ink: #293229;
  --muted: #697268;
  --paper: #fffdf6;
  --paper-deep: #f6f0dc;
  --line: #d8ceb2;
  --green: #4f7844;
  --green-dark: #304d2d;
  --gold: #b9812f;
  --red: #ad493d;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #e8efe1; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(220, 238, 243, .94) 0 188px, transparent 188px),
    repeating-linear-gradient(90deg, rgba(118, 105, 72, .045) 0 1px, transparent 1px 25px),
    var(--paper-deep);
}

button, input { font: inherit; letter-spacing: 0; }

.member-header {
  border-bottom: 1px solid #273e25;
  background: #355732;
  box-shadow: 0 4px 14px rgba(38, 54, 37, .14);
}

.member-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
}

.brand-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fffdf6;
  text-decoration: none;
}

.brand-link span { color: #e6c875; font-size: 12px; font-weight: 900; }
.brand-link strong { font-size: 20px; }

.member-header nav { display: flex; align-items: center; gap: 8px; }
.member-header nav a,
.member-header nav button {
  min-height: 36px;
  padding: 7px 12px;
  color: #fffdf6;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255, 253, 246, .36);
  border-radius: 4px;
  cursor: pointer;
}
.member-header nav a:hover,
.member-header nav button:hover { color: #2d422a; background: #f2d681; border-color: #f2d681; }

.member-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }

.member-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 128px;
  padding: 24px 28px;
  color: #fffdf6;
  background: #29472c;
  border: 1px solid #213923;
  border-radius: 8px 8px 0 0;
}

.eyebrow, .section-kicker {
  margin: 0 0 6px;
  color: #d7ad4f;
  font-size: 11px;
  font-weight: 900;
}

.member-intro h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.member-email { margin: 7px 0 0; color: rgba(255, 253, 246, .7); font-size: 14px; overflow-wrap: anywhere; }

.member-identity {
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 253, 246, .25);
}
.member-identity span { color: rgba(255, 253, 246, .64); font-size: 11px; font-weight: 800; }
.member-identity strong { color: #f1d77e; font: 800 24px Consolas, "Courier New", monospace; }

.page-message {
  min-height: 0;
  margin: 14px 0 0;
  padding: 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}
.page-message:not(:empty) { min-height: 42px; padding: 11px 13px; background: #edf5df; border: 1px solid #b7cb93; border-radius: 6px; }
.page-message.is-error:not(:empty) { color: var(--red); background: #fff0ed; border-color: #dcb4ab; }

.quota-section,
.member-section {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.quota-section { border-top: 0; border-radius: 0 0 8px 8px; }
.member-section { border-radius: 8px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.section-heading h2 { margin: 0; color: #31442e; font-size: 19px; }
.section-heading > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.purchase-link {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  color: #fffdf6;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: var(--gold);
  border: 1px solid #916321;
  border-radius: 4px;
}
.purchase-link:hover { color: #fff; background: #96651f; }

.quota-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.quota-grid > div { display: grid; gap: 7px; min-height: 114px; padding: 16px; background: #fffef9; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quota-grid span { color: #4d5c49; font-size: 13px; font-weight: 800; }
.quota-grid strong { color: var(--green-dark); font-size: 31px; line-height: 1; }
.quota-grid small { align-self: end; color: var(--muted); font-size: 12px; }

.member-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; margin-top: 18px; }
.member-side { display: grid; align-content: start; gap: 18px; }
.task-list { display: grid; }

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  padding: 16px 0;
  border-top: 1px solid #e4ddc9;
}
.task-item:first-child { padding-top: 0; border-top: 0; }
.task-copy { min-width: 0; }
.task-copy h3 { margin: 0; font-size: 15px; }
.task-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.task-meta span { padding: 3px 7px; color: #596254; font-size: 11px; font-weight: 800; background: #f1eddf; border-radius: 4px; }
.task-progress { grid-column: 1 / -1; height: 6px; overflow: hidden; background: #e6e1d3; border-radius: 3px; }
.task-progress span { display: block; height: 100%; background: #bd8b35; }

.task-item button,
.compact-form button,
.input-action button {
  align-self: center;
  min-height: 38px;
  padding: 7px 13px;
  color: #fffdf6;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--green);
  border: 1px solid #365d34;
  border-radius: 4px;
  cursor: pointer;
}
.task-item button:disabled { color: #7b8078; background: #e2e0d7; border-color: #d1cdbd; cursor: not-allowed; }

.compact-form { display: grid; gap: 8px; }
.compact-form label, .invite-label { color: #465144; font-size: 13px; font-weight: 800; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.input-action input {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9c0aa;
  border-radius: 4px;
}
.input-action input:focus { outline: 3px solid rgba(185, 129, 47, .23); border-color: var(--gold); }
.input-action input[readonly] { color: #60675f; background: #f2efe5; }

.invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 14px; border: 1px solid #ded5bf; }
.invite-stats div { padding: 10px; text-align: center; border-left: 1px solid #ded5bf; }
.invite-stats div:first-child { border-left: 0; }
.invite-stats dt { color: var(--muted); font-size: 11px; }
.invite-stats dd { margin: 4px 0 0; color: var(--green-dark); font-size: 20px; font-weight: 900; }
.section-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.history-section { margin-top: 18px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid #e1dac8; }
th { color: #42513e; background: #f4efdF; white-space: nowrap; }
td { color: #414a40; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.empty-row { padding: 22px; color: var(--muted); text-align: center; }
.amount-positive { color: #39703c; font-weight: 900; }
.amount-negative { color: var(--red); font-weight: 900; }

.history-pager { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 54px; padding-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.history-pager button { min-width: 76px; min-height: 34px; color: #fffdf6; font-weight: 800; background: var(--green); border: 1px solid #365d34; border-radius: 4px; cursor: pointer; }
.history-pager button:disabled { color: #7b8078; background: #e2e0d7; border-color: #d1cdbd; cursor: not-allowed; }

.dialog-open { overflow: hidden; }
.member-dialog { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; }
.member-dialog[hidden] { display: none; }
.member-dialog-backdrop { position: absolute; inset: 0; background: rgba(25, 34, 25, .58); }
.member-dialog-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  background: #fffdf6;
  border: 1px solid #bcae8d;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(24, 33, 24, .28);
}
.member-dialog-panel h2 { margin: 0; color: #65322d; font-size: 19px; }
.member-dialog-panel p { margin: 12px 0 20px; color: #4b5149; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.member-dialog-panel button {
  width: 100%;
  min-height: 40px;
  color: #fff;
  font-weight: 800;
  background: var(--green);
  border: 1px solid #365d34;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .member-layout { grid-template-columns: 1fr; }
  .member-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-side .member-section:last-child { grid-column: 1 / -1; }
  .quota-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .member-header-inner, .member-shell { width: min(100% - 22px, 1120px); }
  .member-header-inner { min-height: 60px; }
  .brand-link span { display: none; }
  .member-header nav a, .member-header nav button { padding: 6px 9px; }
  .member-shell { padding-top: 16px; }
  .member-intro { align-items: flex-start; flex-direction: column; gap: 16px; min-height: 0; padding: 20px; }
  .member-intro h1 { font-size: 23px; overflow-wrap: anywhere; }
  .member-identity { width: 100%; min-width: 0; padding: 13px 0 0; border-top: 1px solid rgba(255, 253, 246, .25); border-left: 0; }
  .quota-section, .member-section { padding: 16px; }
  .quota-grid { grid-template-columns: 1fr 1fr; }
  .quota-grid > div { min-height: 104px; padding: 13px; }
  .quota-grid strong { font-size: 27px; }
  .member-side { grid-template-columns: 1fr; }
  .member-side .member-section:last-child { grid-column: auto; }
  .task-item { grid-template-columns: 1fr; }
  .task-item button { width: 100%; }
  .task-progress { grid-column: auto; }
  .input-action { grid-template-columns: 1fr; }
  .input-action button { width: 100%; }
}
