:root {
  color-scheme: light dark;
  --bg: #f7f8f4;
  --surface: #fff;
  --ink: #172c27;
  --muted: #65766e;
  --line: #dfe6df;
  --accent: #24624f;
  --soft: #e9f1e9;
  font:
    16px/1.6 system-ui,
    -apple-system,
    "Noto Sans TC",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #9cbfa4;
  outline-offset: 3px;
}
.quiet {
  color: var(--accent);
  background: var(--soft);
}
input,
select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  width: 100%;
}
label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}
label input,
label select {
  display: block;
  margin-top: 5px;
}
.topbar {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4vw;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: 20px;
}
.brand {
  font-weight: 750;
  font-size: 1.2rem;
  white-space: nowrap;
}
.brand small {
  font-size: 0.62rem;
  letter-spacing: 2px;
  margin-left: 12px;
  font-weight: 500;
  color: var(--muted);
}
.brand-icon {
  background: var(--accent);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  margin-right: 10px;
}
#account {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 86px);
  max-width: 1440px;
  margin: auto;
}
nav {
  border-right: 1px solid var(--line);
  padding: 40px 20px;
}
nav a {
  display: block;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 0.92rem;
}
nav a[aria-current="page"] {
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}
nav p {
  color: var(--muted);
  font-size: 0.75rem;
  padding: 50px 16px 0;
  line-height: 2;
}
main {
  padding: 30px clamp(20px, 5vw, 72px);
  min-width: 0;
}
h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.3;
  letter-spacing: -0.04em;
  margin: 10px 0 12px;
}
h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 16px;
}
.subtitle {
  color: var(--muted);
  margin-bottom: 36px;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-label h2 {
  margin: 0;
}
article,
.stock-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 18px;
}
.stock-card {
  margin: 0;
  display: block;
}
.stock-card:hover {
  border-color: var(--accent);
}
.ticker {
  font-size: 1.2rem;
  font-weight: 750;
}
.stock-card small,
.muted {
  color: var(--muted);
}
.price {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
  margin: 16px 0;
}
.badge {
  display: inline-block;
  color: var(--accent);
  background: var(--soft);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 12px;
}
.metric strong {
  display: block;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.metric small {
  color: var(--muted);
}
form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
form label {
  flex: 1;
  min-width: 150px;
}
#watch-list {
  margin-top: 24px;
}
.watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
#notice:empty {
  display: none;
}
#notice {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  overflow-wrap: anywhere;
}
.welcome {
  padding: 60px 0 100px;
  max-width: 600px;
}
.welcome h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
}
.welcome p:not(.eyebrow) {
  color: var(--muted);
  margin: 24px 0 36px;
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 24px 0;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .topbar {
    min-height: 72px;
    padding: 16px 20px;
  }
  .brand small {
    display: none;
  }
  #account {
    max-width: 40%;
    font-size: 0.7rem;
  }
  .layout {
    display: block;
  }
  nav {
    display: flex;
    padding: 10px 12px;
    gap: 4px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav a {
    margin: 0;
    padding: 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  nav p {
    display: none;
  }
  main {
    padding: 24px 20px;
  }
  .welcome {
    padding: 30px 0 70px;
  }
  footer {
    display: block;
  }
  footer span {
    display: block;
    margin-top: 8px;
  }
  article {
    padding: 20px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111c18;
    --surface: #192720;
    --ink: #e7eee8;
    --muted: #a1b4a8;
    --line: #304237;
    --accent: #82ba9a;
    --soft: #213e2f;
  }
  button,
  .button,
  .brand-icon {
    color: #10281c;
  }
  .quiet {
    color: var(--accent);
  }
}
