/* 長輩友善樣式（REQ-007）：大字、大按鈕、高對比。 */
:root {
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #555;
  --line: #d0d0d0;
  --primary: #1EA672;      /* 主色（與 CityGPT 設計系統一致的翠綠） */
  --primary-dark: #15825a;
  --danger: #c0392b;
  /* 燈號色（都另配文字，不只靠顏色, AC-007.2） */
  --green: #1EA672;
  --red: #c0392b;
  --amber: #e08e0b;
  --grey: #777;
}

* { box-sizing: border-box; }

body {
  font-family: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 20px;            /* 大字體 */
  line-height: 1.6;
  color: var(--fg);
  background: #f4f6f5;
  margin: 0;
  padding: 0;
}

.container { max-width: 760px; margin: 0 auto; padding: 20px 16px 80px; }

header.appbar {
  background: var(--primary);
  color: #fff;
  padding: 18px 16px;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header.appbar a { color: #fff; text-decoration: underline; font-size: 18px; }

h1 { font-size: 28px; margin: 24px 0 12px; }
h2 { font-size: 22px; margin: 20px 0 10px; }

/* 按鈕：大、好點 */
.btn {
  display: inline-block;
  font-size: 20px;
  font-weight: 700;
  padding: 14px 22px;         /* 按鈕高度 ≥44px */
  min-height: 52px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); }
.btn.big { width: 100%; font-size: 22px; padding: 18px; }
.btn.danger { background: var(--danger); }
.btn.secondary { background: #666; }

/* 卡片 */
.card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 14px 0;
}

/* 股票現價列 */
.stock-head { display: flex; justify-content: space-between; align-items: baseline; }
.stock-name { font-size: 24px; font-weight: 700; }
.stock-price { font-size: 26px; font-weight: 700; }

/* 燈號：色塊 + 文字（AC-007.2 不只靠顏色） */
.light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  margin-top: 8px;
}
.light .dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.light.green { background: #e3f5ed; color: #0f6b47; } .light.green .dot { background: var(--green); }
.light.red   { background: #fbe7e4; color: #8e261a; } .light.red .dot   { background: var(--red); }
.light.amber { background: #fcf2dc; color: #8a5a06; } .light.amber .dot { background: var(--amber); }
.light.grey  { background: #ececec; color: #444; }    .light.grey .dot  { background: var(--grey); }

/* 輸入 */
label { display: block; font-size: 18px; margin: 12px 0 6px; font-weight: 600; }
input[type="text"], input[type="number"] {
  width: 100%;
  font-size: 22px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
}
.hint { color: var(--muted); font-size: 16px; margin-top: 6px; }

/* 條件三欄 */
.cond-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }

/* 甜甜價（系統參考價）區塊 — 視覺上與手動設定分開 */
.sweet {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0f7ff;
  border: 1px dashed #9ec5f0;
  border-radius: 10px;
}
.sweet-title { font-size: 17px; font-weight: 700; color: #1a5fa8; margin-bottom: 6px; }
.sweet-row { display: flex; justify-content: space-between; font-size: 19px; padding: 3px 0; }
.sweet-row b { color: #0f4c81; }
.conf-high { color: #0f6b47; }
.conf-normal { color: #777; }

/* 甜甜價通知勾選區 */
.sweet-alert-box {
  margin-top: 16px;
  padding: 14px;
  background: #f0f7ff;
  border: 1px solid #cfe2f7;
  border-radius: 10px;
}
.sweet-alert-title { font-weight: 700; font-size: 18px; color: #1a5fa8; margin-bottom: 10px; }
.chk { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; }
.chk input[type="checkbox"] { width: 26px; height: 26px; }
.sweet-select { width: 100%; font-size: 19px; padding: 12px; margin-top: 6px; border: 2px solid var(--line); border-radius: 10px; }

/* 持有/成本區 */
.holding-box { padding: 12px; background: #fafafa; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }

/* 停利停損 價格 or % 並列 */
.tp-row { display: flex; align-items: center; gap: 8px; }
.tp-row input { flex: 1; }
.tp-row span { font-size: 17px; color: var(--muted); white-space: nowrap; }

/* 帳面損益 */
.pnl { margin-top: 8px; font-size: 19px; font-weight: 700; padding: 6px 12px; border-radius: 8px; display: inline-block; }
.pnl-up { background: #fbe7e4; color: #c0392b; }    /* 台股紅漲 */
.pnl-down { background: #e3f5ed; color: #0f6b47; }  /* 綠跌 */

/* 管理者：成員的股票唯讀檢視 */
.member-stocks { margin-top: 10px; }
.member-stocks-title { font-weight: 700; font-size: 17px; color: var(--muted); margin-bottom: 6px; }
.member-stock-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 18px; }

/* 卡片動作（移除股票）— 低調，放卡片內、設定區之外 */
.card-actions { margin-top: 12px; text-align: right; }
.btn-remove {
  font-size: 16px;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn-remove:hover { background: var(--danger); color: #fff; }

/* 為什麼說明（摺疊） */
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--primary-dark); font-size: 17px; }

/* 管理者表格 */
table { width: 100%; border-collapse: collapse; font-size: 18px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { padding: 12px 16px; border-radius: 10px; margin: 12px 0; font-size: 18px; }
.msg.error { background: #fbe7e4; color: #8e261a; }
.center { text-align: center; }
.login-wrap { max-width: 440px; margin: 60px auto; text-align: center; }
.login-wrap .logo { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.login-wrap p { font-size: 20px; color: var(--muted); margin-bottom: 28px; }
