:root {
  --ink: #17211f;
  --muted: #66736f;
  --deep: #16231f;
  --green: #20705a;
  --green-soft: #e8f2ee;
  --gold: #d7ad3c;
  --paper: #fffdf9;
  --wash: #f5f3ee;
  --line: #ded8cc;
  --danger: #9a3f33;
  --steel: #61717b;
  --clay: #b66a45;
  --shadow: 0 18px 45px rgba(30, 35, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8f7f2 0%, #efebe2 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(32, 112, 90, 0.09), transparent 32%),
    linear-gradient(180deg, #f8f7f2 0%, #ede8dc 100%);
}

.auth-showcase {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 8px;
  color: #fffaf0;
  background:
    linear-gradient(120deg, rgba(255, 250, 240, 0.08) 0 1px, transparent 1px 78px),
    linear-gradient(145deg, #17231f 0%, #10211d 58%, #26362f 100%);
  box-shadow: 0 28px 70px rgba(17, 31, 27, 0.22);
  overflow: hidden;
}

.auth-showcase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-badge {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.72);
  background: rgba(255, 250, 240, 0.06);
  font-size: 12px;
  white-space: nowrap;
}

.auth-showcase-copy {
  max-width: none;
}

.auth-showcase-copy .page-kicker {
  color: #d8c17a;
}

.auth-showcase-copy h1 {
  margin: 0;
  max-width: none;
  color: #fffaf0;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-showcase-copy .headline-main,
.auth-showcase-copy .headline-sub {
  display: block;
}

.auth-showcase-copy .headline-main {
  white-space: nowrap;
}

.auth-showcase-copy p {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(255, 250, 240, 0.68);
  font-size: 16px;
  line-height: 1.8;
}

.login-ore-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  max-width: 620px;
  min-height: 112px;
  padding: 14px 18px 14px 12px;
  border: 1px solid rgba(255, 250, 240, 0.13);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.08);
  backdrop-filter: blur(10px);
}

.login-ore {
  position: relative;
  height: 76px;
  border-radius: 55% 55% 10px 10px;
  clip-path: polygon(50% 0%, 88% 35%, 100% 100%, 0% 100%, 12% 35%);
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.36), transparent 20%),
    linear-gradient(118deg, #c46b3d 0%, #8f4a2f 38%, #c8d2d9 58%, #2d2823 100%);
  box-shadow: inset -12px -14px 22px rgba(0,0,0,.28), inset 12px 7px 18px rgba(255,255,255,.14);
  overflow: hidden;
}

.login-ore-shine {
  position: absolute;
  left: -45%;
  top: -15%;
  width: 70%;
  height: 130%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
  transform: rotate(12deg);
  animation: ore-glint 3.9s ease-in-out infinite;
}

.login-ore-title {
  font-size: 18px;
  font-weight: 900;
}

.login-ore-meta {
  margin-top: 6px;
  color: rgba(255, 250, 240, 0.62);
  font-size: 13px;
}

.login-ore-card strong {
  color: #e6c65e;
  font-size: 20px;
  white-space: nowrap;
}

.auth-hero {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 8px;
  color: #fffaf0;
  background:
    radial-gradient(circle at 78% 18%, rgba(215, 173, 60, 0.22), transparent 28%),
    radial-gradient(circle at 18% 72%, rgba(64, 132, 109, 0.28), transparent 30%),
    linear-gradient(145deg, #17231f 0%, #10211d 58%, #25382f 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-brand {
  margin-bottom: 0;
}

.auth-copy {
  max-width: 720px;
}

.auth-title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 640px;
  margin: 22px 0 0;
  color: rgba(255, 250, 240, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.auth-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-points div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 250, 240, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.07);
}

.auth-points strong,
.auth-points span {
  display: block;
}

.auth-points strong {
  font-size: 18px;
}

.auth-points span {
  margin-top: 8px;
  color: rgba(255, 250, 240, 0.64);
  font-size: 13px;
  line-height: 1.5;
}

.auth-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.58), transparent 42%),
    var(--paper);
  box-shadow: 0 24px 64px rgba(30, 35, 32, 0.14);
}

.simple-auth-panel {
  gap: 20px;
}

.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-simple-title {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 950;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  padding: 5px;
  border-radius: 8px;
  background: #f2ede3;
}

.auth-tabs button {
  height: 42px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.auth-tabs button.active {
  color: var(--green);
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(30, 35, 32, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-submit {
  width: 100%;
  height: 52px;
  box-shadow: 0 14px 28px rgba(30, 106, 81, 0.22);
}

.auth-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-page {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  min-height: 100dvh;
  padding: clamp(28px, 7vw, 96px) 18px;
  background:
    radial-gradient(circle at 72% 12%, rgba(215, 188, 116, 0.18), transparent 26%),
    radial-gradient(circle at 12% 72%, rgba(40, 119, 91, 0.18), transparent 30%),
    linear-gradient(180deg, #0e211b 0%, #071018 48%, #050811 100%);
}

.auth-showcase {
  display: flex;
  min-height: 620px;
  border-radius: 42px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 250, 238, 0.07) 0 1px, transparent 1px 82px),
    radial-gradient(circle at 78% 18%, rgba(215, 188, 116, 0.22), transparent 30%),
    radial-gradient(circle at 12% 82%, rgba(31, 112, 85, 0.3), transparent 32%),
    linear-gradient(145deg, #13251f 0%, #07121b 56%, #151f1c 100%);
  box-shadow: 0 42px 100px rgba(0, 0, 0, 0.42);
}

.auth-panel {
  width: min(100%, 560px);
  min-height: 620px;
  justify-self: end;
  align-content: center;
  gap: 24px;
  padding: clamp(26px, 6vw, 54px);
  border: 1px solid rgba(118, 137, 166, 0.22);
  border-radius: 42px;
  color: #f7f9ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(215, 188, 116, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(18, 34, 31, 0.97), rgba(8, 15, 24, 0.98));
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.42);
}

.auth-logo-row {
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.auth-logo-row .brand-mark {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: #fff url("./assets/logo.png") center / 78% auto no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(6, 12, 18, 0.08),
    0 18px 42px rgba(255, 255, 255, 0.08);
}

.auth-logo-row .brand-mark::after {
  content: none;
}

.auth-logo-row .brand-title {
  color: #f7f9ff;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
}

.auth-logo-row .brand-sub {
  margin-top: 14px;
  color: rgba(150, 164, 190, 0.72);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.auth-simple-title,
.auth-panel > div:nth-of-type(2) .subtle {
  display: none;
}

.auth-tabs {
  display: none;
}

.auth-tabs button {
  color: rgba(199, 207, 202, 0.78);
}

.auth-tabs button.active {
  color: #07101f;
  background: #fff;
  box-shadow: 0 14px 32px rgba(255, 255, 255, 0.08);
}

.auth-form {
  gap: 18px;
}

.auth-form .label {
  display: none;
}

.auth-form .input {
  min-height: 70px;
  padding: 0 26px;
  border: 1px solid rgba(220, 199, 143, 0.16);
  border-radius: 22px;
  color: #f7f9ff;
  background: rgba(3, 8, 15, 0.66);
  font-size: 17px;
  font-weight: 750;
}

.auth-form .input::placeholder {
  color: rgba(175, 185, 181, 0.66);
}

.auth-form .input:focus {
  border-color: rgba(220, 199, 143, 0.48);
  box-shadow: 0 0 0 4px rgba(220, 199, 143, 0.08);
}

.auth-submit {
  height: 72px;
  margin-top: 10px;
  border-radius: 22px;
  color: #071018;
  background: linear-gradient(180deg, #fffdf6 0%, #f3e9cf 100%);
  box-shadow: 0 22px 44px rgba(220, 199, 143, 0.12);
  font-size: 17px;
  font-weight: 950;
}

.auth-note {
  color: rgba(182, 191, 187, 0.64);
  text-align: center;
  background: transparent;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.membership-copy {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(220, 199, 143, 0.16);
  border-radius: 18px;
  color: rgba(247, 249, 255, 0.78);
  background: rgba(3, 8, 15, 0.42);
  line-height: 1.6;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  background:
    linear-gradient(180deg, #17231f 0%, #101a18 100%);
  color: #fffaf0;
  border-right: 1px solid rgba(255, 250, 240, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff url("./assets/logo.png") center / 78% auto no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(6, 12, 18, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.16);
}

.brand-title {
  font-size: 21px;
  font-weight: 850;
}

.brand-sub {
  margin-top: 2px;
  color: rgba(255, 250, 240, 0.62);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.72);
  background: transparent;
  text-align: left;
}

.nav-btn.active {
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.1);
  box-shadow: inset 3px 0 0 var(--gold);
}

.content {
  min-width: 0;
  padding: 30px clamp(22px, 4vw, 54px) 46px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-kicker {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.subtle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.summary-bar {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 0;
  min-height: 112px;
  padding: 18px;
  margin-bottom: 22px;
  border-radius: 8px;
  color: #fffaf0;
  background: var(--deep);
  box-shadow: var(--shadow);
}

.summary-item {
  text-align: center;
}

.summary-label {
  color: rgba(255, 250, 240, 0.68);
  font-size: 13px;
}

.summary-value {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
}

.summary-value.money {
  color: var(--gold);
}

.summary-divider {
  width: 1px;
  height: 58px;
  background: rgba(255, 250, 240, 0.22);
}

.inventory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 14px;
}

.mini-metric {
  min-width: 104px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 850;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.gold-btn {
  height: 44px;
  min-width: 108px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 850;
}

.primary-btn {
  color: #fffaf0;
  background: linear-gradient(135deg, #1e6a51, #134234);
}

.gold-btn {
  color: #1e211c;
  background: linear-gradient(135deg, #f0d36b, #d4a72d);
  box-shadow: 0 12px 28px rgba(212, 167, 45, 0.22);
}

.secondary-btn {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #c8d8d0;
}

.danger-btn {
  color: #fffaf0;
  background: linear-gradient(135deg, #a84b3f, #7e3028);
}

.pile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.pile-card {
  position: relative;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 16px;
  min-height: 254px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.pile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(16, 36, 31, 0.09);
}

.pile-card.selected {
  border-color: var(--green);
  box-shadow: 0 18px 40px rgba(30, 106, 81, 0.16);
}

.select-dot {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #b9c7bf;
  color: var(--green);
  background: var(--paper);
  font-weight: 900;
}

.pile-card.selected .select-dot {
  border-color: var(--green);
  background: var(--green-soft);
}

.ore-visual {
  position: relative;
  align-self: center;
  height: 150px;
}

.ore-heap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 28px;
  height: 110px;
  border-radius: 56% 56% 16px 16px;
  clip-path: polygon(50% 0%, 88% 36%, 100% 100%, 0% 100%, 12% 36%);
  overflow: hidden;
  animation: ore-breathe 4.8s ease-in-out infinite;
  box-shadow: inset -18px -20px 34px rgba(0,0,0,.3), inset 16px 8px 24px rgba(255,255,255,.16);
}

.ore-heap::after {
  content: "";
  position: absolute;
  left: -52%;
  top: -10%;
  width: 72%;
  height: 130%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.48), transparent);
  transform: rotate(12deg);
  animation: ore-glint 3.9s ease-in-out infinite;
}

.ore-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 22px;
  border-radius: 50%;
  background: rgba(61, 51, 41, .22);
  filter: blur(1px);
}

@keyframes ore-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.015); }
}

@keyframes ore-glint {
  0% { transform: translateX(-20%) rotate(12deg); opacity: .16; }
  45% { opacity: .45; }
  100% { transform: translateX(190%) rotate(12deg); opacity: .1; }
}

.pile-name {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
}

.pile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 34px;
}

.pile-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 14px;
}

.info-label {
  color: #7b867f;
  font-size: 12px;
}

.info-value {
  margin-top: 2px;
  color: #25332d;
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.metal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metal-tag {
  min-width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 13px;
}

.pile-money {
  color: var(--green);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.pile-profit {
  margin-top: 4px;
  color: #8b6a2c;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.action-bar {
  position: sticky;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 82px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #16231f, #0f1a17);
  color: #fffaf0;
  box-shadow: 0 18px 40px rgba(16, 36, 31, 0.22);
}

.action-copy {
  font-size: 18px;
  font-weight: 900;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.edit-btn {
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
  border: 1px solid rgba(255, 250, 240, 0.18);
}

.fab {
  position: fixed;
  right: 34px;
  bottom: 34px;
  z-index: 6;
  width: 78px;
  height: 58px;
  border-radius: 8px;
  color: #fffaf0;
  font-size: 31px;
  font-weight: 700;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.34), transparent 24%),
    linear-gradient(135deg, #207457 0%, #174a3b 58%, #777f43 130%);
  box-shadow: 0 18px 36px rgba(30, 106, 81, 0.28);
  animation: fab-float 3.2s ease-in-out infinite;
}

@keyframes fab-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.mobile-fab {
  display: none;
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(30, 35, 32, 0.05);
}

.screen-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.back-btn {
  width: 58px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
  color: var(--green);
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.95), rgba(255,255,255,.55) 30%, transparent 58%),
    linear-gradient(135deg, rgba(255,253,247,.98), rgba(232,241,236,.88));
  border: 1px solid rgba(30, 106, 81, .15);
  box-shadow: 0 8px 20px rgba(16, 36, 31, .1);
  overflow: hidden;
}

.back-btn span {
  margin: 0 -3px;
  opacity: .24;
  animation: chev-flow 1.2s ease-in-out infinite;
}

.back-btn span:nth-child(3) { animation-delay: 0s; }
.back-btn span:nth-child(2) { animation-delay: .16s; }
.back-btn span:nth-child(1) { animation-delay: .32s; }

@keyframes chev-flow {
  0%, 100% { opacity: .22; transform: translateX(6px); }
  45% { opacity: 1; transform: translateX(-2px); }
}

.section-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.label {
  color: #4e5c55;
  font-size: 14px;
  font-weight: 800;
}

.optional {
  color: #8c9791;
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #d9cfbe;
  border-radius: 8px;
  outline: 0;
  color: #1d2b25;
  background: #f7f1e6;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(30, 106, 81, .55);
  box-shadow: 0 0 0 3px rgba(30, 106, 81, .1);
}

.textarea {
  min-height: 44px;
  padding-top: 12px;
  line-height: 1.4;
  resize: vertical;
}

.suggest-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.suggest-chip {
  min-height: 40px;
  border-radius: 8px;
  color: #315a47;
  background: #edf4f0;
  border: 1px solid #cbd8cf;
  font-weight: 750;
}

.draft-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.draft-row {
  display: grid;
  grid-template-columns: 1fr auto 34px;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px 8px 14px;
  border-radius: 8px;
  background: #f7f1e6;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--danger);
  background: #f2e1d8;
  font-size: 18px;
}

.weight-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.big-number {
  margin-top: 4px;
  font-size: 40px;
  font-weight: 950;
}

.weight-side {
  color: var(--muted);
  line-height: 1.7;
  text-align: right;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.sale-table,
.record-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.sale-table th,
.sale-table td,
.record-table th,
.record-table td {
  min-width: 112px;
  padding: 13px 12px;
  border-right: 1px solid #ebe3d6;
  border-bottom: 1px solid #ebe3d6;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}

.sale-table th,
.record-table th {
  color: #fffaf0;
  background: var(--deep);
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 1;
}

.pile-col {
  min-width: 150px;
  font-weight: 900;
}

.metal-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.price-input {
  width: 96px;
  min-height: 36px;
  text-align: center;
}

.total-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 24px;
  font-weight: 950;
}

.total-panel strong {
  color: var(--green);
}

.total-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--deep);
  color: #fffaf0;
}

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fffaf0;
  font-weight: 900;
}

.profile-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.profile-name {
  font-size: 22px;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sub {
  margin-top: 4px;
  color: rgba(255, 250, 240, .66);
  font-size: 13px;
  line-height: 1.4;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 950;
}

.buyer-list,
.record-list {
  display: grid;
  gap: 10px;
}

.buyer-row,
.record-card {
  padding: 14px;
  border-radius: 8px;
  background: #f7f1e6;
}

.buyer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-card {
  cursor: pointer;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.record-title {
  font-weight: 900;
}

.record-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  color: #3b4942;
  font-size: 14px;
}

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

.mobile-tabs {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  color: #fffaf0;
  background: rgba(16, 36, 31, .94);
  box-shadow: var(--shadow);
}

@media (max-width: 880px) {
  .auth-page {
    display: flex;
    align-items: center;
    padding: 18px 14px;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    width: 100%;
    max-width: 440px;
    min-height: 560px;
    padding: 22px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px 18px;
  }

  .nav {
    display: none;
  }

  .content {
    padding: 20px 14px 112px;
  }

  .topbar,
  .screen-head {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .page-actions {
    display: none;
  }

  .page-actions .primary-btn {
    width: 100%;
  }

  .form-grid,
  .stats-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .pile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pile-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 178px;
    padding: 10px;
    gap: 10px;
    border-radius: 8px;
  }

  .ore-visual {
    width: 100%;
    height: 128px;
    align-self: center;
  }

  .ore-heap {
    left: 4px;
    right: 4px;
    bottom: 22px;
    height: 92px;
    border-radius: 55% 55% 14px 14px;
  }

  .ore-ground {
    bottom: 12px;
    height: 20px;
  }

  .select-dot {
    right: 7px;
    top: 7px;
    width: 22px;
    height: 22px;
    font-size: 13px;
    border-width: 1px;
  }

  .pile-card-head {
    padding-right: 0;
  }

  .pile-name {
    display: -webkit-box;
    min-height: auto;
    padding-right: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 16px;
    line-height: 1.28;
  }

  .pile-meta {
    margin-top: 3px;
    font-size: 11px;
  }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 9px;
    margin-top: 10px;
  }

  .suggest-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-bar {
    min-height: 92px;
    margin-bottom: 16px;
    padding: 14px 12px;
  }

  .summary-value {
    font-size: 28px;
  }

  .inventory-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .mini-metric {
    width: auto;
    height: 32px;
    font-size: 12px;
  }

  .action-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 74px;
  }

  .action-copy {
    font-size: 16px;
  }

  .action-buttons .danger-btn,
  .action-buttons .edit-btn,
  .action-buttons .gold-btn {
    min-width: 74px;
    padding: 0 12px;
  }

  .fab {
    right: 20px;
    bottom: 90px;
    width: 64px;
    height: 50px;
  }

  .mobile-fab {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 16px;
    color: #fffaf0;
    font-size: 0;
    line-height: 1;
    font-weight: 850;
    background:
      radial-gradient(circle at 30% 22%, rgba(255,255,255,.34), transparent 24%),
      linear-gradient(135deg, #207457 0%, #174a3b 58%, #777f43 130%);
    box-shadow: 0 18px 38px rgba(30, 106, 81, 0.3);
    animation: fab-float 3.2s ease-in-out infinite;
  }

  .mobile-fab::before {
    content: "+";
    display: block;
    font-size: 34px;
    line-height: 1;
    transform: translateY(-1px);
  }

  .card-foot {
    flex: none;
    align-items: flex-end;
    margin-top: 8px;
    flex-direction: row;
  }

  .metal-tags {
    gap: 4px;
  }

  .metal-tag {
    min-width: 30px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 11px;
  }

  .metal-tag:nth-child(n+3) {
    display: grid;
  }

  .pile-money {
    font-size: 13px;
    text-align: right;
  }

  .pile-profit {
    display: block;
    font-size: 11px;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 -10px 28px rgba(16, 36, 31, .09);
  }

  .mobile-tabs .nav-btn {
    justify-content: center;
    color: var(--muted);
    background: transparent;
    min-height: 48px;
  }

  .mobile-tabs .nav-btn.active {
    color: var(--green);
    background: var(--green-soft);
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 12px;
  }

  .auth-panel {
    min-height: 540px;
    padding: 20px 16px;
    border-radius: 34px;
  }

  .auth-simple-title {
    font-size: 28px;
  }

  .auth-form .input {
    min-height: 62px;
    border-radius: 20px;
    font-size: 16px;
  }

  .auth-submit {
    height: 64px;
    border-radius: 20px;
  }

  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .profile-card {
    gap: 12px;
    padding: 18px;
  }

  .profile-card .avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
  }

  .profile-card .secondary-btn {
    flex: 0 0 84px;
    min-width: 84px;
    padding: 0 10px;
  }

  .profile-name {
    font-size: 18px;
  }

  .profile-sub {
    font-size: 12px;
  }

  .pile-card {
    grid-template-columns: 106px minmax(0, 1fr);
    min-height: 170px;
  }

  .ore-visual {
    max-width: none;
    width: 100%;
    min-width: 0;
    height: 118px;
  }

  .pile-name {
    font-size: 15px;
  }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
  }

  .card-foot {
    align-items: flex-end;
    flex-direction: row;
    gap: 5px;
  }

  .pile-money,
  .pile-profit {
    text-align: right;
  }
}
