:root {
  --bg: #f4fbf6;
  --surface: #ffffff;
  --text: #163528;
  --muted: #5d7a6a;
  --green: #1f7a4d;
  --green2: #2f9e63;
  --gold: #e6b422;
  --red: #e11d2e;
  --border: rgba(31, 122, 77, 0.14);
  --shadow: 0 12px 28px rgba(22, 53, 40, 0.08);
  font-family: "Segoe UI", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(240, 201, 74, 0.25), transparent 55%),
    radial-gradient(800px 420px at 90% 10%, rgba(47, 158, 99, 0.2), transparent 50%),
    #eef8f1;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  flex-wrap: wrap;
}

.hint { max-width: 240px; }
.hint img { height: 56px; margin-bottom: 10px; }
.hint p { margin: 8px 0; line-height: 1.5; color: var(--muted); }
.hint strong { color: var(--green); }

.phone {
  width: 390px;
  height: 780px;
  border-radius: 40px;
  padding: 12px;
  background: linear-gradient(160deg, #ffffff, #e8f6ee);
  border: 1px solid rgba(31, 122, 77, 0.2);
  box-shadow: 0 28px 60px rgba(22, 53, 40, 0.16);
  position: relative;
}

.notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 22px;
  background: #163528;
  border-radius: 0 0 14px 14px;
  z-index: 5;
}

.home-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 4px;
  border-radius: 99px;
  background: rgba(22, 53, 40, 0.2);
  z-index: 5;
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fcf8 0%, #eef8f1 100%);
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 48px 18px 12px;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 8px 4px 18px;
}
.tabbar.tabs-5 { grid-template-columns: repeat(5, 1fr); }
.tabbar button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 8px 2px;
  cursor: pointer;
}
.tabbar button.active { color: var(--green); }
.section-title {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--green);
  font-weight: 800;
}
.hint-box {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #8a6d00;
  font-size: 0.82rem;
  line-height: 1.45;
}
.ok-msg {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(47, 158, 99, 0.12);
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}
select {
  width: 100%;
  margin: 6px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.logo-top {
  display: block;
  height: 88px;
  margin: 0 auto 12px;
  object-fit: contain;
  background: transparent;
}
.lang-menu {
  position: absolute;
  top: 36px;
  right: 12px;
  z-index: 30;
}
.lang-trigger {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(22, 53, 40, 0.14);
  padding: 6px;
  overflow: hidden;
}
.lang-dropdown.open { display: block; }
.lang-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.lang-item:hover { background: rgba(47, 158, 99, 0.08); }
.lang-item.active {
  background: rgba(47, 158, 99, 0.14);
  color: var(--green);
}
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.status-dot.green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.status-dot.red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.status-dot.yellow { background: #eab308; box-shadow: 0 0 0 3px rgba(234,179,8,.2); }
.sub { text-align: center; color: var(--muted); margin: 0 0 16px; font-size: 0.9rem; }

input {
  width: 100%;
  margin: 6px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
input:focus { border-color: var(--green2); box-shadow: 0 0 0 3px rgba(47,158,99,.15); }

.btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--green2), var(--green));
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31,122,77,.22);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  background: #fff;
  color: var(--green);
  border: 1px solid var(--border);
  box-shadow: none;
  margin-top: 8px;
}

.error { color: var(--red); font-size: 0.88rem; margin-bottom: 8px; text-align: center; }

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}
.status-banner.online {
  border-color: rgba(47,158,99,.35);
  background: linear-gradient(135deg, rgba(47,158,99,.12), #fff);
}
.status-banner.offline {
  border-color: rgba(225,29,46,.3);
  background: linear-gradient(135deg, rgba(225,29,46,.08), #fff);
}
.status-banner .label { font-weight: 800; color: var(--green); }
.status-banner.offline .label { color: var(--red); }
.status-banner .hint-sm { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.metric h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.metric .v {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green);
}

.list-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31,122,77,.1);
  font-size: 0.92rem;
}
.list-row:last-child { border-bottom: none; }

/* 首頁收益進度 */
.earn-progress {
  text-align: center;
  margin-bottom: 12px;
}
.earn-progress .caption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.earn-ring-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 8px;
}
.earn-ring-wrap svg {
  width: 168px;
  height: 168px;
  transform: rotate(-90deg);
}
.earn-ring-wrap .track {
  fill: none;
  stroke: rgba(31, 122, 77, 0.12);
  stroke-width: 10;
}
.earn-ring-wrap .arc {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear;
}
.earn-ring-wrap .center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: none;
}
.earn-ring-wrap .center small {
  color: var(--muted);
  font-size: 0.72rem;
}
.earn-ring-wrap .center .amt {
  color: var(--green);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.2;
}
.earn-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 122, 77, 0.12);
  overflow: hidden;
  margin-top: 10px;
}
.earn-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green2));
  border-radius: 999px;
  transition: width 0.2s linear;
}
.earn-pct {
  margin-top: 6px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Modal */
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(22, 53, 40, 0.35);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}
.modal {
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
  border: 1px solid var(--border);
}
.modal h3 {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 1.1rem;
}
.modal p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; font-size: 0.9rem; }
.modal ol { margin: 0 0 14px; padding-left: 18px; color: var(--text); font-size: 0.9rem; line-height: 1.55; }
.modal .actions { display: grid; gap: 8px; }

@media (max-width: 820px) {
  .hint { display: none; }
  .phone { width: min(390px, 100vw - 20px); height: min(780px, 100vh - 20px); }
}
