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

:root {
  --accent: #7c5c2e;
  --accent-light: #f5efe6;
  --accent-mid: #c49a5a;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #999;
  --border: #e8e0d4;
  --bg: #fff;
  --bg-side: #faf7f2;
  --tag-bg: #f0ece4;
  --tag-text: #6b4f2a;
  --link: #3a6fa8;
}

body {
  font-family:
    'Helvetica Neue', Arial, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: #f0ece4;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--bg-side);
  padding: 2.5rem 1.5rem;
  border-right: 1px solid var(--border);
}

.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 3px solid var(--accent-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
}

.name {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-left: 2px solid var(--accent-mid);
  border-radius: 0 4px 4px 0;
  text-align: left;
}

.side-section {
  margin-bottom: 1.75rem;
}

.side-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 0.75rem;
}

.info-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
}

.info-label {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.info-val {
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.info-val a {
  color: var(--link);
  text-decoration: none;
}

.info-val a:hover {
  text-decoration: underline;
}

.info-website {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 6px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.cert-item {
  font-size: 12px;
  color: var(--text);
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.cert-item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-mid);
  margin-top: 7px;
  flex-shrink: 0;
}

.lang-row {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}

.lang-level {
  font-size: 11px;
  color: var(--text-muted);
}

.pref-row {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  gap: 6px;
}

.pref-label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 60px;
}

/* ── MAIN ── */
.main {
  padding: 2.5rem 2rem;
}

.main-name {
  display: none;
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--accent-mid);
  border-radius: 2px;
  display: inline-block;
}

.intro-text {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 0.75rem 1rem;
  background: var(--accent-light);
  border-radius: 6px;
  border-left: 3px solid var(--accent-mid);
}

.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.edu-name {
  font-weight: 600;
  font-size: 14px;
}

.edu-dept {
  font-size: 13px;
  color: var(--text-muted);
}

.edu-date {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.job {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.job:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
}

.job-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.job-period {
  font-size: 11px;
  color: #fff;
  background: var(--accent-mid);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.job-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.job-desc {
  font-size: 13px;
  color: var(--text);
  padding-left: 0;
  list-style: none;
}

.job-desc li {
  padding: 2px 0 2px 14px;
  position: relative;
  line-height: 1.6;
}

.job-desc li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--accent-mid);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

.job-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin: 10px 0 4px;
  padding: 2px 7px;
  background: var(--accent-light);
  border-left: 2px solid var(--accent-mid);
  border-radius: 0 4px 4px 0;
  display: inline-block;
}

.projects-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin: 10px 0 6px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.project-item {
  background: var(--accent-light);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.project-name {
  font-weight: 600;
  color: var(--accent);
}

.project-desc {
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 1px;
}

.ref-box {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 12px;
  align-items: center;
}

.ref-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ref-name {
  font-weight: 600;
  font-size: 14px;
}
.ref-role {
  font-size: 12px;
  color: var(--text-muted);
}
.ref-contact {
  font-size: 12px;
  color: var(--link);
  margin-top: 2px;
}

.portfolio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portfolio-list li a {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.portfolio-list li a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--link);
  border-top: 1.5px solid var(--link);
  transform: rotate(45deg);
  display: inline-block;
  flex-shrink: 0;
}

.portfolio-list li a:hover {
  text-decoration: underline;
}

.portfolio-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding: 0.5rem 0 0.25rem 0;
  margin-bottom: 1.5rem;
}

.timeline-track {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 0 0 1.5rem 0;
}

.timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, var(--accent-mid), var(--accent));
  border-radius: 3px;
}

.timeline-dots {
  position: relative;
  height: 32px;
}

.tl-dot {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.tl-dot-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-mid);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent-mid);
  margin-bottom: 4px;
  transition: transform 0.15s;
}

.tl-dot:hover .tl-dot-circle {
  transform: scale(1.4);
  background: var(--accent);
}

.tl-dot-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}

.tl-dot:hover .tl-dot-label {
  color: var(--accent);
  font-weight: 600;
}

.timeline-years {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── PORTFOLIO CARDS ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.portfolio-card:hover {
  border-color: var(--accent-mid);
  background: var(--accent-light);
}

.portfolio-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.portfolio-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.portfolio-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
}

.portfolio-card-url {
  font-size: 10px;
  color: var(--text-light);
  word-break: break-all;
}

.portfolio-card-note {
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .page {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .project-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff !important;
    padding: 0 !important;
  }
  .page {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }
  .sidebar {
    background: #faf7f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .job-period {
    background: var(--accent-mid) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .project-item {
    background: var(--accent-light) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tag {
    background: var(--tag-bg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .intro-text {
    background: var(--accent-light) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ref-box {
    background: var(--accent-light) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a {
    color: inherit !important;
    text-decoration: none !important;
  }
  .portfolio-card {
    border: 1px solid var(--border) !important;
  }
}
