/* ============================================
   Chialiang Yeh CV — 墨黑 × 黃銅金
   ============================================ */
:root {
  --ink: #171a20;          /* 墨黑:頁首與重點文字 */
  --ink-soft: #3a3f47;     /* 內文 */
  --brass: #b08d3e;        /* 黃銅金:主要強調色 */
  --brass-deep: #8a6d2c;   /* 深金:hover / 邊線 */
  --paper: #fbfaf7;        /* 米白紙感背景 */
  --card: #ffffff;
  --line: #e6e1d6;
  --muted: #8b8577;
  --radius: 10px;
  --font-display: "Noto Serif TC", serif;
  --font-body: "Noto Sans TC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-soft);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--brass-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ---------- 頁首 ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(176,141,62,.22), transparent 60%),
    var(--ink);
  color: #f3f0e8;
  padding: 64px 0 56px;
  border-bottom: 3px solid var(--brass);
}
.hero-inner { display: flex; gap: 36px; align-items: center; flex-wrap: wrap; }
.hero img.photo {
  width: 148px; height: 148px; object-fit: cover; object-position: top;
  border-radius: 50%;
  border: 3px solid var(--brass);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  background: #fff;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
}
.hero .name-en {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--brass);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 2px;
}
.hero .title-line { margin-top: 12px; font-size: 17px; color: #d9d4c7; }
.hero .company-line { font-size: 15px; color: #a49d8c; margin-top: 2px; }
.hero .tagline {
  margin-top: 16px;
  font-size: 14.5px;
  color: #cfc9ba;
  max-width: 560px;
  border-left: 2px solid var(--brass);
  padding-left: 12px;
}
.hero .contact { margin-top: 14px; font-size: 14px; color: #bdb6a5; display: flex; gap: 20px; flex-wrap: wrap; }
.hero .contact a { color: var(--brass); }
.hero-actions { margin-top: 18px; }

/* ---------- 區塊標題 ---------- */
section { padding: 44px 0 8px; }
.sec-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--brass) 0, var(--line) 60%, transparent);
}

/* ---------- 簡歷 ---------- */
.summary-list { list-style: none; counter-reset: sum; }
.summary-list li {
  counter-increment: sum;
  position: relative;
  padding: 8px 0 8px 44px;
}
.summary-list li::before {
  content: counter(sum, decimal-leading-zero);
  position: absolute;
  left: 0; top: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--brass);
  letter-spacing: .05em;
}

/* ---------- 經歷時間軸 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--brass), var(--line));
}
.job { position: relative; padding: 0 0 36px 18px; }
.job::before {
  content: "";
  position: absolute;
  left: -26px; top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--brass);
}
.job .period {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: .08em;
}
.job h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  margin-top: 2px;
}
.job h3 .co { color: var(--brass-deep); font-size: 16px; font-weight: 600; margin-left: 10px; }
.job .group { margin-top: 14px; }
.job .group-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--brass-deep);
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.job ul { list-style: none; }
.job ul li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 15px;
}
.job ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 14px;
  width: 6px; height: 6px;
  background: var(--brass);
  transform: rotate(45deg);
}

/* ---------- 卡片區(教育/語言/認證) ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
}
.card .period { font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.card .cat {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 6px;
}
.card ul { list-style: none; }
.card ul li { position: relative; padding: 3px 0 3px 16px; font-size: 14.5px; }
.card ul li::before {
  content: "";
  position: absolute; left: 0; top: 13px;
  width: 5px; height: 5px; background: var(--brass); transform: rotate(45deg);
}

/* ---------- 其他實績 ---------- */
.others .label { font-weight: 700; color: var(--ink); }
.others ul { list-style: none; margin-top: 6px; }
.others ul li { position: relative; padding: 3px 0 3px 16px; font-size: 14.5px; }
.others ul li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 5px; height: 5px; background: var(--brass); transform: rotate(45deg);
}

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

/* ---------- 管理頁 ---------- */
.admin-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #f3f0e8;
  padding: 12px 0;
  border-bottom: 2px solid var(--brass);
}
.admin-bar .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-bar .tag { font-size: 13px; color: var(--brass); letter-spacing: .1em; font-weight: 700; }
.btn {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--brass);
  background: var(--brass);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--brass-deep); border-color: var(--brass-deep); }
.btn.ghost { background: transparent; color: var(--brass); }
.btn.ghost:hover { background: rgba(176,141,62,.12); }
.btn.danger { background: transparent; border-color: #b4552f; color: #b4552f; }

.login-box {
  max-width: 420px;
  margin: 12vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(23,26,32,.08);
}
.login-box h1 { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.login-box p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.login-box input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: var(--font-body);
}
.login-box .err { color: #b4552f; font-size: 13.5px; margin-bottom: 10px; display: none; }

/* 編輯模式:可編輯元素外觀 */
[contenteditable="true"] {
  outline: 1px dashed rgba(176,141,62,.55);
  outline-offset: 3px;
  border-radius: 4px;
  transition: background .15s;
}
[contenteditable="true"]:hover { background: rgba(176,141,62,.07); }
[contenteditable="true"]:focus { background: rgba(176,141,62,.1); outline-style: solid; }

.item-tools {
  display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle;
}
.mini-btn {
  font-size: 12px;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.mini-btn:hover { border-color: var(--brass); color: var(--brass-deep); }
.add-row { margin: 6px 0 0 18px; }

.notice {
  background: #fdf6e7;
  border: 1px solid #ecd9a8;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #7a6224;
  margin: 14px 0;
}

@media (max-width: 640px) {
  .hero { padding: 44px 0 40px; }
  .hero-inner { gap: 22px; }
  .job { padding-left: 10px; }
  body { font-size: 15px; }
}

@media print {
  .admin-bar, .item-tools, .add-row, .notice, .hero-actions { display: none !important; }
  .hero { background: var(--ink) !important; -webkit-print-color-adjust: exact; }
  body { background: #fff; }
}
