:root {
  --void: #080a0d;
  --obsidian: #101318;
  --graphite: #1a1e24;
  --steel: #69717c;
  --silver: #c8ced7;
  --platinum: #edf1f6;
  --ice: #aebed7;
  --white: #fff;
  --line: #06c755;
  --danger: #e05b56;
  --border: rgba(203, 213, 227, .18);
  --border-light: #d8dee7;
  --shadow: 0 28px 80px rgba(0, 0, 0, .28);
  font-family: "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  color: #191d22;
  background: var(--void);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--void); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(157, 177, 210, .22), transparent 35%),
    radial-gradient(circle at 88% 7%, rgba(255, 255, 255, .09), transparent 28%),
    linear-gradient(155deg, #080a0d 0%, #12161c 52%, #090b0e 100%);
  color: var(--platinum);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.shell { position: relative; z-index: 1; width: min(1240px, 100%); margin: 0 auto; padding: 0 28px 64px; }
.member-shell { width: min(1080px, 100%); }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; font-weight: 800; letter-spacing: .03em; }
.brand-logo {
  width: 56px; height: 46px; padding: 4px; object-fit: contain; border-radius: 12px;
  background: linear-gradient(145deg, #fff, #d9dfe8);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 0 12px rgba(90,111,143,.22);
  filter: saturate(.72) contrast(1.08);
}
.brand span { display: grid; gap: 2px; line-height: 1.1; }
.brand small { color: var(--ice); font-size: 9px; font-weight: 700; letter-spacing: .24em; }

.button {
  position: relative; overflow: hidden; border: 1px solid transparent; border-radius: 12px;
  padding: 13px 19px; font-weight: 800; letter-spacing: .02em; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.primary {
  color: #0a0c0f;
  background: linear-gradient(135deg, #f7f9fc 0%, #aeb7c5 48%, #f4f7fb 100%);
  border-color: rgba(255,255,255,.65);
  box-shadow: 0 10px 30px rgba(146, 164, 192, .18);
}
.secondary { color: #313740; background: linear-gradient(145deg, #fff, #dce1e8); border-color: #c7ced8; }
.ghost { color: var(--silver); background: rgba(255,255,255,.04); border-color: var(--border); }
.danger { color: #fff; background: linear-gradient(135deg, #9f2f2c, #e05b56); border-color: rgba(255,255,255,.15); }
.compact { align-self: end; white-space: nowrap; }
.icon-button { width: 40px; height: 40px; border: 1px solid #c7ced8; border-radius: 11px; color: #343a43; background: linear-gradient(145deg, #fff, #e2e6ec); font-size: 20px; }

.center-card, .form-card {
  width: min(640px, 100%); margin: 56px auto; padding: clamp(30px, 6vw, 54px);
  border: 1px solid var(--border); border-radius: 28px;
  background: linear-gradient(145deg, rgba(29,34,42,.96), rgba(11,13,17,.98));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  color: var(--platinum);
}
.center-card { text-align: center; }
.hero-card {
  width: 100%; min-height: 600px; margin: 26px auto; overflow: hidden;
  display: grid; grid-template-columns: .92fr 1.08fr; align-items: stretch;
  border: 1px solid var(--border); border-radius: 32px;
  background: linear-gradient(135deg, rgba(29,34,42,.98), rgba(8,10,13,.98));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.09);
}
.hero-emblem {
  position: relative; display: grid; place-items: center; min-height: 560px; padding: 48px;
  background:
    radial-gradient(circle, rgba(255,255,255,.18), transparent 38%),
    linear-gradient(155deg, #b8c3d2 0%, #59616d 27%, #e5eaf1 49%, #555d68 71%, #b7c2d0 100%);
}
.hero-emblem::before, .hero-emblem::after { content: ""; position: absolute; inset: 28px; border: 1px solid rgba(255,255,255,.3); border-radius: 24px; }
.hero-emblem::after { inset: 42px; border-color: rgba(0,0,0,.14); }
.hero-emblem img {
  position: relative; z-index: 1; width: min(330px, 88%); aspect-ratio: 1.28; object-fit: contain;
  border-radius: 24px; background: #fff; filter: saturate(.72) contrast(1.1);
  box-shadow: 0 32px 70px rgba(4,6,9,.42), inset 0 0 30px rgba(129,151,184,.25);
}
.hero-copy { align-self: center; padding: clamp(42px, 7vw, 76px); }
.hero-copy h1, .form-card h1 { margin: 15px 0 19px; color: #fff; font-size: clamp(42px, 7vw, 72px); line-height: 1.03; letter-spacing: -.055em; }
.form-card h1 { font-size: clamp(35px, 6vw, 54px); }
.hero-copy p { color: #aeb5bf; line-height: 1.85; font-size: 16px; }
.eyebrow { color: var(--ice); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.light { color: #cfd8e6; }
.muted { color: #9da5b0; line-height: 1.75; }
.line-button {
  width: 100%; margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px;
  color: #fff; background: linear-gradient(135deg, #04a948, #06c755); border-color: rgba(255,255,255,.16);
  box-shadow: 0 12px 28px rgba(6,199,85,.2);
}
.line-symbol { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: var(--line); background: #fff; font-size: 12px; }
.notice { padding: 13px 15px; border: 1px solid rgba(196,167,99,.25); border-radius: 12px; color: #e0c98f !important; background: rgba(139,106,28,.16); font-size: 14px; }

.loading-emblem { width: 116px; height: 92px; margin: 0 auto 22px; padding: 7px; border-radius: 18px; background: linear-gradient(145deg, #fff, #bac3cf); box-shadow: 0 18px 44px rgba(0,0,0,.35); }
.loading-emblem img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; filter: saturate(.7); }
.spinner { width: 34px; height: 34px; margin: 0 auto 18px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--ice); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-emblem { width: 100px; height: 80px; padding: 6px; object-fit: contain; border-radius: 16px; background: linear-gradient(145deg, #fff, #c9d0da); filter: saturate(.7); box-shadow: 0 15px 36px rgba(0,0,0,.35); }

.form-stack { display: grid; gap: 17px; margin-top: 26px; }
label { display: grid; gap: 8px; color: #59616d; font-size: 14px; font-weight: 750; }
.form-card label, .hero-card label { color: #c2c9d2; }
input, textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid #c8cfd9; border-radius: 11px;
  outline: none; color: #161a20; background: linear-gradient(145deg, #fff, #f0f2f5);
  box-shadow: inset 0 1px 3px rgba(27,34,43,.08);
}
input:focus, textarea:focus, select:focus { border-color: #8494ac; box-shadow: 0 0 0 3px rgba(145,163,190,.18); }
textarea { min-height: 145px; resize: vertical; }

.wallet-hero {
  position: relative; overflow: hidden; padding: clamp(30px, 6vw, 52px); border: 1px solid rgba(255,255,255,.2); border-radius: 30px;
  color: #fff; background:
    linear-gradient(115deg, rgba(255,255,255,.1), transparent 28%),
    linear-gradient(135deg, #090b0f 0%, #2b313a 48%, #0b0d11 100%);
  box-shadow: 0 30px 70px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.14);
}
.wallet-hero::before { content: ""; position: absolute; inset: 1px; border: 1px solid rgba(255,255,255,.05); border-radius: 29px; pointer-events: none; }
.wallet-watermark { position: absolute; width: 440px; right: -95px; top: -95px; opacity: .085; filter: grayscale(1) contrast(1.35); mix-blend-mode: screen; }
.wallet-head { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.balance { margin-top: 5px; font-size: clamp(54px, 11vw, 88px); font-weight: 800; letter-spacing: -.055em; text-shadow: 0 4px 18px rgba(0,0,0,.28); }
.balance::after { content: " POINTS"; font-size: 12px; letter-spacing: .16em; color: #aab7ca; }
.member-chip { display: grid; gap: 5px; min-width: 132px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.07); backdrop-filter: blur(12px); }
.member-chip span { color: #aeb8c7; font-size: 11px; letter-spacing: .08em; }
.member-chip strong { font-size: 25px; }
.wallet-name { position: relative; z-index: 1; margin: 14px 0 0; color: #b8c1cf; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.panel { padding: 27px; border: 1px solid var(--border-light); border-radius: 22px; color: #1c2127; background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(229,233,239,.98)); box-shadow: 0 16px 42px rgba(0,0,0,.17), inset 0 1px 0 #fff; }
.panel .eyebrow { color: #67758a; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading h1, .section-heading h2 { margin: 6px 0 0; color: #15191e; font-size: 23px; letter-spacing: -.03em; }
.admin-page > .section-heading .page-title { margin: 0 0 20px; color: #fff; font-size: 35px; }
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.recipient-preview { padding: 14px 16px; border: 1px solid #aeb9c8; border-radius: 12px; color: #303945; background: linear-gradient(135deg, #eef2f7, #d6dce5); font-weight: 800; }
.transaction-list { margin-top: 20px; }
.transaction { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 15px 0; border-bottom: 1px solid #d9dee5; }
.transaction:last-child { border: 0; }
.transaction-title { font-weight: 800; color: #252a31; }
.transaction-time { color: #737c88; font-size: 12px; }
.transaction-amount { grid-row: span 2; align-self: center; font-weight: 900; }
.positive { color: #16805d; }.negative { color: #ba3f3a; }
.empty { padding: 28px 12px; text-align: center; color: #7a838f; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translateX(-50%); max-width: min(440px, calc(100vw - 32px)); padding: 14px 19px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; color: #fff; background: rgba(15,18,23,.96); box-shadow: 0 16px 42px rgba(0,0,0,.4); backdrop-filter: blur(12px); }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; }
.sidebar { height: fit-content; position: sticky; top: 20px; overflow: hidden; padding: 15px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(155deg, rgba(29,34,42,.98), rgba(11,13,17,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; margin: -15px -15px 14px; padding: 19px 17px; border-bottom: 1px solid var(--border); color: #bac5d5; font-size: 10px; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.sidebar-brand img { width: 58px; height: 46px; padding: 4px; object-fit: contain; border-radius: 10px; background: #fff; filter: saturate(.65); }
.nav-button { width: 100%; padding: 12px 13px; border: 1px solid transparent; border-radius: 10px; text-align: left; color: #9fa8b4; background: transparent; font-weight: 750; }
.nav-button.active { color: #11151a; background: linear-gradient(135deg, #f5f7fa, #adb7c5); border-color: rgba(255,255,255,.5); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.admin-main { min-width: 0; }
.page-title { margin: 0 0 20px; color: #fff; font-size: 35px; letter-spacing: -.045em; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; }
.stat-card { padding: 21px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg, rgba(37,43,52,.96), rgba(15,18,23,.98)); box-shadow: 0 14px 35px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.07); }
.stat-card span { color: #9fa9b7; font-size: 12px; letter-spacing: .04em; }.stat-card strong { display: block; margin-top: 9px; color: #fff; font-size: 28px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }.toolbar input { max-width: 390px; }
.table-wrap { overflow: auto; border: 1px solid var(--border-light); border-radius: 16px; color: #252a31; background: #f8f9fb; box-shadow: 0 15px 40px rgba(0,0,0,.18); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 15px; border-bottom: 1px solid #dfe3e9; text-align: left; }
th { color: #69717d; background: linear-gradient(#f8fafc, #e7ebf0); font-size: 11px; letter-spacing: .06em; }
tr[data-click] { cursor: pointer; } tr[data-click]:hover td { background: #e9edf2; }
.split-panels { display: grid; grid-template-columns: .9fr 1.45fr; gap: 18px; }
.pool-card { margin-bottom: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 15px; color: #e9edf3; background: linear-gradient(145deg, rgba(35,40,48,.96), rgba(15,18,23,.98)); cursor: pointer; transition: .18s ease; }
.pool-card:hover { transform: translateY(-1px); border-color: rgba(190,202,220,.35); }
.pool-card.active { border-color: #a8b6cb; box-shadow: 0 0 0 2px rgba(174,190,215,.12), 0 16px 30px rgba(0,0,0,.25); }
.pool-card h3 { margin: 0 0 8px; }.pool-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #9aa4b1; font-size: 12px; }
.badge { display: inline-block; padding: 4px 9px; border: 1px solid #c3cbd6; border-radius: 999px; color: #35404d; background: linear-gradient(135deg, #f8fafc, #d8dee6); font-size: 11px; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.checkbox-list { display: grid; gap: 12px; margin-top: 18px; }.checkbox-list label { display: flex; align-items: center; gap: 10px; }.checkbox-list input { width: auto; accent-color: #5f6d81; }
.dialog-card { width: min(620px, 100%); padding: 28px; border: 1px solid #7e8794; border-radius: 20px; color: #edf1f6; background: linear-gradient(145deg, #252a32, #0d1014); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.dialog-card::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(8px); }
.dialog-card h2 { margin: 0; font-size: 30px; }

@media (max-width: 980px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-emblem { min-height: 300px; padding: 50px; }
  .hero-emblem img { width: 250px; }
  .content-grid, .admin-layout, .split-panels { grid-template-columns: 1fr; }
  .sidebar { position: static; display: flex; overflow-x: auto; align-items: center; }
  .sidebar-brand { display: none; }.nav-button { width: auto; white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .shell { padding: 0 15px 42px; }.topbar { height: 78px; }
  .brand-logo { width: 48px; height: 40px; }.brand { font-size: 14px; }.brand small { font-size: 8px; }
  .hero-card { margin-top: 10px; border-radius: 24px; }.hero-emblem { min-height: 230px; padding: 36px; }.hero-emblem::before { inset: 16px; }.hero-emblem::after { inset: 27px; }.hero-emblem img { width: 190px; border-radius: 17px; }
  .hero-copy { padding: 35px 25px 40px; }.hero-copy h1 { font-size: 45px; }
  .content-grid { gap: 15px; }.panel { padding: 21px; }.wallet-hero { padding: 30px 23px; border-radius: 23px; }
  .wallet-head { display: grid; }.member-chip { width: fit-content; }.lookup-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }.balance { font-size: 58px; }
  .page-title { font-size: 30px; }.form-card { margin-top: 22px; }
}
