/* =========================================================
   國際成長資源平台 — 共用設計系統（會員/後台頁面用）
   深色科技感 + 金 / 沉穩可信賴
   ========================================================= */
:root {
  --navy-900: #050b14; --navy-850: #070f1a; --navy-800: #0a1726;
  --navy-700: #14304a; --navy-600: #1f4d75;
  --gold: #cda961; --gold-soft: #e2cb92; --gold-deep: #b89150;
  --paper: #070e18; --paper-2: #0a1320; --paper-3: #0e1d2f;
  --ink: #e9eef4; --muted: #98a8ba; --muted-2: #677a8e;
  --line: rgba(255, 255, 255, 0.10); --line-soft: rgba(255, 255, 255, 0.06);
  --on-navy: #e8edf2; --on-navy-muted: #9fb1c2;
  --head: #f4f7fb;
  --surface: rgba(255,255,255,0.045); --surface-2: rgba(255,255,255,0.07);
  --accent: #3bb7c4; --accent-soft: #7fd6de; --accent-deep: #1f8a95;
  --serif: "Noto Serif TC", Georgia, "Songti TC", serif;
  --sans: "Noto Sans TC", -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --display: "Space Grotesk", "Noto Sans TC", -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1180px; --gutter: clamp(20px, 5vw, 64px); --radius: 6px;
  --shadow-lift: 0 36px 70px -34px rgba(0,0,0,0.75);
  --ok: #4fc98a; --err: #e07566;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); font-weight: 350; color: var(--ink); background: var(--paper); line-height: 1.75; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; position: relative; }
/* 程式生成抽象背景：漸層光暈 + 細網格 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% -5%, rgba(205,169,97,0.12), transparent 60%),
    radial-gradient(55% 45% at 8% 8%, rgba(59,183,196,0.10), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(31,77,117,0.22), transparent 65%),
    var(--paper);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(110% 80% at 50% 0%, #000 35%, transparent 80%);
          mask-image: radial-gradient(110% 80% at 50% 0%, #000 35%, transparent 80%);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 900; line-height: 1.2; color: var(--head); letter-spacing: -0.01em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.mono { font-family: var(--mono); }

.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); font-weight: 500; display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: 0.03em; padding: 14px 28px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; transition: all .25s ease; line-height: 1; }
.btn .arr { transition: transform .25s ease; }
.btn:hover .arr { transform: translateX(4px); }
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-navy { background: var(--navy-800); color: var(--on-navy); }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--head); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(7,14,24,0.72); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line-soft); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(145deg, #16314c, #0a1726); display: grid; place-items: center; color: var(--gold-soft); font-family: var(--serif); font-weight: 700; font-size: 18px; border: 1px solid rgba(205,169,97,0.4); box-shadow: 0 0 18px -6px rgba(205,169,97,0.45); }
.brand .name { display: flex; flex-direction: column; line-height: 1.15; }
.brand .name b { font-family: var(--sans); font-weight: 800; font-size: 17px; color: var(--head); letter-spacing: .01em; }
.brand .name span { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--muted-2); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { font-size: 15px; color: var(--ink); font-weight: 400; padding: 8px 16px; border-radius: var(--radius); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--gold-soft); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-login { font-size: 14px; color: var(--muted); font-weight: 400; padding: 8px 12px; }
.nav-login:hover { color: var(--gold-soft); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 48px var(--gutter); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; padding: clamp(28px, 5vw, 44px); box-shadow: var(--shadow-lift); }
.auth-card .eyebrow { margin-bottom: 16px; }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }
.auth-alt a { color: var(--gold-soft); font-weight: 500; }
.auth-aux { display: flex; justify-content: flex-end; margin-top: -8px; margin-bottom: 18px; }
.auth-aux a { font-size: 13px; color: var(--muted); }
.auth-aux a:hover { color: var(--gold-soft); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; color: var(--head); font-weight: 600; margin-bottom: 7px; }
.field label .req { color: var(--gold-deep); }
.field input, .field select, .field textarea { width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink); padding: 13px 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-2); transition: border-color .2s, background .2s; -webkit-appearance: none; appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2398a8ba' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 38px; }
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: var(--surface-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full .btn { width: 100%; margin-top: 4px; }

.msg { font-size: 14px; padding: 12px 14px; border-radius: 6px; margin-bottom: 18px; display: none; }
.msg.show { display: block; }
.msg.err { background: rgba(224,117,102,.12); color: var(--err); border: 1px solid rgba(224,117,102,.3); }
.msg.ok { background: rgba(79,201,138,.12); color: var(--ok); border: 1px solid rgba(79,201,138,.3); }

/* ---------- Dashboard / Admin shell ---------- */
.page-hero { background: linear-gradient(135deg,#0a1726,#070e18); color: var(--on-navy); padding: clamp(40px,6vw,64px) 0; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-hero::after { content:""; position:absolute; inset:0; background: radial-gradient(110% 90% at 90% -20%, rgba(205,169,97,0.16), transparent 55%), radial-gradient(90% 80% at 5% 120%, rgba(59,183,196,0.12), transparent 60%); pointer-events:none; }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color:#fff; font-size: clamp(26px,4vw,40px); margin: 10px 0 0; }
.page-hero p { color: var(--on-navy-muted); margin-top: 10px; }
.section-pad { padding: clamp(40px, 6vw, 64px) 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.stat { background: var(--surface); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.stat .label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--gold-deep); text-transform: uppercase; }
.stat .val { font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--head); margin-top: 8px; line-height: 1; }
.stat .val.small { font-size: 20px; }

.panel { background: var(--surface); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; margin-bottom: 28px; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 19px; }
.panel-body { padding: 8px 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 24px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; }
tbody tr:hover { background: var(--surface-2); }
td .sub { color: var(--muted-2); font-size: 12.5px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted-2); }

.chip { display: inline-block; white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); background: var(--paper-2); }
.chip.admin { color: var(--gold-soft); border-color: rgba(205,169,97,.4); background: rgba(205,169,97,.12); }
.status-sel { font-family: var(--sans); font-size: 13px; color: var(--ink); padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-2); }

.dash-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.info-list { list-style: none; }
.info-list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 24px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.info-list li span:first-child { color: var(--muted); }
.info-list li span:last-child { color: var(--head); font-weight: 500; text-align: right; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--on-navy-muted); padding: 48px 0 28px; margin-top: auto; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.site-footer .mono { letter-spacing: .1em; }
.site-footer a:hover { color: var(--gold-soft); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  table { font-size: 13px; }
  th, td { padding: 11px 14px; }
}
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
