/* ============================================
   Consultant-Max 淺色專業風
   白底 × 深藍 × 藍色點綴 × 金色標題細節
   ============================================ */
:root {
  --navy: #16324f;
  --navy-deep: #0e2136;
  --blue: #2f6fb2;
  --blue-soft: #e8f0f8;
  --gold: #b08a3e;
  --ink: #22303d;
  --muted: #5b6b7a;
  --line: #dde5ec;
  --bg: #f7f9fb;
  --card: #ffffff;
  --font-body: "Noto Sans TC", "PingFang TC", sans-serif;
  --font-display: "Noto Serif TC", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--ink); line-height: 1.7;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="460" height="460"><g fill="none" stroke="%2316324f" stroke-opacity="0.045"><path d="M-20 90 L120 30 L250 100 L400 40 L480 90"/><path d="M40 320 L170 250 L310 330 L460 270"/><path d="M120 30 L170 250"/><path d="M250 100 L310 330"/></g><g fill="%232f6fb2" fill-opacity="0.08"><circle cx="120" cy="30" r="3"/><circle cx="250" cy="100" r="2.5"/><circle cx="400" cy="40" r="3"/><circle cx="170" cy="250" r="3"/><circle cx="310" cy="330" r="2.5"/></g></svg>');
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ---------- 頂欄 ---------- */
.topbar { background: var(--navy-deep); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { color: #fff; font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; }
.brand::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); margin-left: 8px; vertical-align: middle; }
.lang-btn {
  background: transparent; color: #cfd9e3; border: 1px solid #43566b; border-radius: 999px;
  padding: 4px 16px; font-size: 13px; cursor: pointer; font-family: var(--font-body);
}
.lang-btn:hover { color: #fff; border-color: #8fa5bb; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #ffffff 0%, var(--blue-soft) 100%); border-bottom: 1px solid var(--line); }
.hero-inner { display: flex; gap: 40px; align-items: center; padding: 48px 24px; }
.photo-frame {
  flex: 0 0 300px; aspect-ratio: 27 / 40; overflow: hidden; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(22, 50, 79, .18);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 0% 45%; display: block; }
.hero-text h1 { font-family: var(--font-display); font-size: 40px; color: var(--navy); line-height: 1.3; }
.hero-text .alias { color: var(--gold); font-style: italic; margin-left: 6px; }
.tagline {
  display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 15px; letter-spacing: 1px;
}
.intro { margin-top: 16px; color: var(--muted); max-width: 520px; }
.contact { margin-top: 18px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.contact a { color: var(--blue); text-decoration: none; border-bottom: 1px solid transparent; }
.contact a:hover { border-bottom-color: var(--blue); }

/* ---------- 內容區 ---------- */
main { padding: 36px 24px 20px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 28px; margin-bottom: 20px;
}
.grid .card { margin-bottom: 0; }
.grid { margin-bottom: 20px; }
.card.accent { border-left: 4px solid var(--gold); }
.sec-title {
  font-family: var(--font-display); font-size: 20px; color: #fff;
  margin: -26px -28px 18px; padding: 13px 28px;
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="360" height="120"><g fill="none" stroke="%23ffffff" stroke-opacity="0.10"><path d="M180 -10 L250 60 L200 130"/><path d="M250 60 L360 20"/><path d="M300 130 L340 70 L360 90"/></g><g fill="%23ffffff" fill-opacity="0.14"><circle cx="250" cy="60" r="2.5"/><circle cx="340" cy="70" r="2"/><circle cx="200" cy="15" r="2"/></g></svg>') right center / auto 100% no-repeat,
    linear-gradient(115deg, var(--navy-deep) 0%, var(--navy) 55%, #2c567f 100%);
  border-radius: 13px 13px 0 0;
  position: relative;
}
.sec-title::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--gold), #d8b56a);
  border-radius: 13px 0 0 0;
}
.sec-title::after {
  content: "❯❯❯"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 13px; letter-spacing: 3px; opacity: .85; font-family: var(--font-body);
}
.card.accent { border-left: none; }
.dot-list { list-style: none; }
.dot-list li { padding-left: 18px; position: relative; margin-bottom: 8px; }
.dot-list li::before {
  content: ""; position: absolute; left: 2px; top: .68em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--blue);
}
.card.accent .dot-list li::before { background: var(--gold); }

.job { margin-bottom: 18px; }
.job:last-child { margin-bottom: 0; }
.job h3 { font-size: 16px; color: var(--navy); margin-bottom: 8px; }
.job .org { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 14px; }

.topic-list { list-style: none; }
.topic-list li { margin-bottom: 10px; padding-left: 18px; position: relative; }
.topic-list li::before {
  content: ""; position: absolute; left: 2px; top: .68em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--blue);
}
.topic-label {
  display: inline-block; font-weight: 700; color: var(--blue); margin-right: 8px;
}

/* ---------- 授課&演講實例 ---------- */
.gallery-group { margin-bottom: 26px; }
.gallery-group:last-child { margin-bottom: 0; }
.gallery-label {
  font-size: 15px; color: var(--navy); margin-bottom: 12px;
  padding-left: 12px; border-left: 4px solid var(--gold);
}
.gallery-grid {
  list-style: none; columns: 3; column-gap: 14px;
}
.gallery-item { break-inside: avoid; margin-bottom: 14px; }
.gallery-item figure { margin: 0; }
.gallery-item img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  border: 1px solid var(--line); cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item img:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(22, 50, 79, .18); }
.gallery-item figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
body[data-admin] .gallery-item img { cursor: default; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 22, 36, .92);
  display: flex; align-items: center; justify-content: center; padding: 40px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: 100%; max-height: 100%; text-align: center; margin: 0; }
.lightbox img {
  max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain;
  border-radius: 8px;
}
.lightbox figcaption { color: #cfd9e3; font-size: 14px; margin-top: 12px; }
.lb-close, .lb-nav {
  position: fixed; background: rgba(255, 255, 255, .1); color: #fff; border: none;
  border-radius: 50%; width: 44px; height: 44px; font-size: 18px; cursor: pointer;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 26px 0 40px; border-top: 1px solid var(--line); margin-top: 16px;
}

/* ---------- 管理後台 ---------- */
#login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 40px; width: 360px; box-shadow: 0 12px 32px rgba(22, 50, 79, .08);
}
.login-box h1 { font-family: var(--font-display); color: var(--navy); font-size: 24px; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.login-box input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; margin-bottom: 14px; font-family: var(--font-body);
}
.login-box input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.err { display: none; background: #fdecea; color: #b3261e; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }

.btn {
  background: var(--navy); color: #fff; border: none; border-radius: 8px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; font-family: var(--font-body);
}
.btn:hover { background: var(--blue); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn.danger { background: #b3261e; }
.btn.danger:hover { background: #8f1d17; }

.admin-bar { background: var(--navy-deep); padding: 10px 0; position: sticky; top: 0; z-index: 10; }
.admin-bar .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-bar .tag { color: var(--gold); font-size: 14px; margin-right: 6px; }
.admin-bar .btn.ghost { color: #cfd9e3; border-color: #43566b; }
.admin-bar .btn.ghost:hover { color: #fff; border-color: #8fa5bb; }
.notice {
  background: var(--blue-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--ink); margin: 16px 0;
}

[contenteditable="true"] { outline: 1px dashed #a9c3dc; outline-offset: 2px; border-radius: 2px; }
[contenteditable="true"]:focus { outline: 2px solid var(--blue); background: #fffbe8; }
.item-tools { margin-left: 8px; }
.mini-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; padding: 1px 8px; cursor: pointer; color: var(--muted); font-family: var(--font-body);
}
.mini-btn:hover { color: #b3261e; border-color: #b3261e; }
.add-row { margin: 6px 0 14px; }

/* ---------- RWD ---------- */
@media (max-width: 760px) {
  .gallery-grid { columns: 2; }
  .lightbox { padding: 24px 8px; }
  .hero-inner { flex-direction: column; gap: 26px; text-align: center; padding: 36px 24px; }
  .photo-frame { flex: none; width: 240px; }
  .hero-text h1 { font-size: 32px; }
  .intro { max-width: none; }
  .contact { justify-content: center; }
  .grid { grid-template-columns: 1fr; }
}
