:root{
  --bg:#fff3ec;
  --bg2:#ffe7da;
  --ink:#36241a;
  --muted:#927568;
  --line:rgba(58,42,32,.10);
  --card:rgba(255,255,255,.70);
  --brand:#ff8a4c;      /* 淺橙主色 */
  --brand2:#ff6b35;     /* 深橙 */
  --accent:#ffb347;
  --up:#1aa179;
  --down:#e0556b;
  --shadow:0 10px 30px rgba(255,107,53,.14);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"PingFang TC","Microsoft JhengHei","Noto Sans CJK TC",system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--ink);
  background:
    radial-gradient(1200px 520px at 82% -12%,rgba(255,138,76,.22),transparent 60%),
    radial-gradient(900px 520px at 0% 0%,rgba(255,107,53,.16),transparent 55%),
    linear-gradient(180deg,var(--bg),var(--bg2));
  min-height:100vh;
}
.wrap{max-width:1120px;margin:0 auto;padding:0 18px}

/* Header */
.site-header{
  position:sticky;top:0;z-index:20;
  backdrop-filter:saturate(160%) blur(14px);
  background:rgba(255,255,255,.55);
  border-bottom:1px solid var(--line);
}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.brand-mark{
  width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-weight:800;
  box-shadow:var(--shadow);
}
.brand-text{font-weight:800;letter-spacing:.5px;font-size:18px}
.site-nav{display:flex;gap:18px}
.site-nav a{color:var(--muted);text-decoration:none;font-weight:600;font-size:14px}
.site-nav a:hover{color:var(--brand)}
.site-nav a.act{color:var(--brand);border-bottom:2px solid var(--brand);padding-bottom:2px}

/* Hero */
.hero{
  margin:34px 0 22px;padding:34px 32px;border-radius:var(--radius);
  background:linear-gradient(135deg,rgba(255,138,76,.96),rgba(255,107,53,.94));
  color:#fff;box-shadow:var(--shadow);position:relative;overflow:hidden;
}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.14)}
.hero h1{margin:0 0 8px;font-size:30px;letter-spacing:1px}
.hero p{margin:0;opacity:.92;font-size:15px}
.hero .upd{margin-top:14px;display:inline-flex;align-items:center;gap:8px;font-size:13px;
  background:rgba(255,255,255,.18);padding:6px 12px;border-radius:999px}
.dot{width:8px;height:8px;border-radius:50%;background:#FFD9A8;box-shadow:0 0 0 4px rgba(255,217,168,.25)}

/* Section title */
.sec-title{display:flex;align-items:center;gap:10px;margin:28px 4px 14px;font-size:18px;font-weight:800}
.sec-title::before{content:"";width:5px;height:20px;border-radius:3px;background:linear-gradient(var(--brand),var(--brand2))}

/* Currency grid */
.cur-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:16px}
.cur-card{
  display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:16px;
  background:var(--card);border:1px solid var(--line);text-decoration:none;color:inherit;
  backdrop-filter:blur(8px);box-shadow:var(--shadow);transition:transform .25s ease,box-shadow .25s ease;
}
.cur-card:hover{transform:translateY(-4px);box-shadow:0 18px 40px rgba(255,107,53,.18)}
.flag-wrap{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center}
.cur-flag{width:40px;height:28px;object-fit:cover;border-radius:6px;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.flag-txt{width:40px;height:28px;border-radius:6px;display:none;place-items:center;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-size:11px;font-weight:700}
.cur-meta{flex:1;min-width:0}
.cur-name{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cur-code{color:var(--muted);font-size:12px;letter-spacing:.5px}
.cur-rates{text-align:right;line-height:1.35}
.cur-rates .lab{display:block;font-size:11px;color:var(--muted)}
.cur-rates b{font-size:16px;color:var(--brand2)}
.cur-rates .sub{font-size:12px;color:var(--muted);margin-top:2px}

/* Detail */
.back{display:inline-flex;align-items:center;gap:6px;margin:24px 0 0;color:var(--brand);text-decoration:none;font-weight:600}
.detail-head{display:flex;align-items:center;gap:16px;margin:18px 0}
.detail-head .flag-wrap{width:54px;height:54px;flex-basis:54px}
.detail-head .cur-flag{width:54px;height:38px}
.detail-head h1{margin:0;font-size:26px}
.detail-head .code{color:var(--muted);font-weight:600}

.rate-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:18px 0}
.rate-box{padding:18px;border-radius:16px;background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);text-align:center}
.rate-box .k{font-size:13px;color:var(--muted);font-weight:600}
.rate-box .v{font-size:26px;font-weight:800;margin-top:6px;color:var(--ink)}
.rate-box.primary{background:linear-gradient(135deg,rgba(255,138,76,.14),rgba(255,107,53,.14));border-color:rgba(255,138,76,.32)}

.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;margin:18px 0}
.panel h3{margin:0 0 12px;font-size:17px}
.chart-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.chart-tools button{
  border:1px solid var(--line);background:#fff;color:var(--muted);font-weight:600;font-size:13px;
  padding:6px 12px;border-radius:999px;cursor:pointer;transition:.2s;
}
.chart-tools button.active,.chart-tools button:hover{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-color:transparent}
#chart{width:100%;height:360px}

/* History table */
.tbl-wrap{max-height:420px;overflow:auto;border-radius:12px;border:1px solid var(--line)}
table.data{width:100%;border-collapse:collapse;font-size:14px}
table.data th,table.data td{padding:10px 12px;text-align:right;border-bottom:1px solid var(--line)}
table.data th:first-child,table.data td:first-child{text-align:left}
table.data thead th{position:sticky;top:0;background:#fff3ea;color:var(--muted);font-weight:700}
table.data tbody tr:hover{background:rgba(255,138,76,.07)}
.na{color:var(--muted);font-style:italic}

/* Article */
.article{border-top:1px dashed var(--line);margin-top:14px;padding-top:14px;color:#4a3328;line-height:1.8}
.article h2{font-size:18px;margin:0 0 10px}
.bot-art-table{width:100%;border-collapse:collapse;margin:12px 0;font-size:14px}
.bot-art-table th,.bot-art-table td{border:1px solid var(--line);padding:8px 10px;text-align:right}
.bot-art-table th:first-child,.bot-art-table td:first-child{text-align:left}
.bot-art-table th{background:#fff3ea}

/* Empty state */
.empty{padding:50px;text-align:center;color:var(--muted);background:var(--card);border:1px dashed var(--line);border-radius:var(--radius)}
.empty a{color:var(--brand);font-weight:700}

/* Footer */
.site-footer{margin-top:40px;padding:22px 0;border-top:1px solid var(--line);color:var(--muted);font-size:13px;text-align:center}

@media(max-width:680px){
  .rate-grid{grid-template-columns:repeat(2,1fr)}
  .hero{padding:26px 20px}
  .hero h1{font-size:24px}
}

/* Bank switcher bar */
.bank-bar{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin:22px 0 4px;padding:14px 18px;border-radius:14px;
  background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);
}
.bank-bar label{font-weight:700;font-size:14px;color:var(--ink)}
.bank-bar select{
  font-size:15px;font-weight:600;color:var(--ink);
  padding:8px 12px;border-radius:10px;border:1px solid var(--line);
  background:#fff;cursor:pointer;min-width:180px;
}
.bank-bar select:focus{outline:2px solid rgba(255,138,76,.4)}
.bank-bar .bank-now{font-size:14px;color:var(--muted)}
.bank-bar .bank-now b{color:var(--brand2)}
.bank-bar .upd{margin-left:auto;display:inline-flex;align-items:center;gap:8px;font-size:13px;
  background:rgba(255,138,76,.14);color:var(--brand2);padding:6px 12px;border-radius:999px}
.bank-bar .back{margin:0 0 0 auto}
