/* ============================================
   BioCODER.com — Professional Light Theme
   ============================================ */

:root {
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-tertiary: #8888a8;
    --bg-primary: #fafaf8;
    --bg-secondary: #f0efe8;
    --bg-card: #ffffff;
    --accent: #2c5f7c;
    --accent-light: #e8f1f5;
    --accent-warm: #c47a3a;
    --border: #e0dfd8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    --radius: 10px;
    --font-sans: 'Noto Sans TC', -apple-system, sans-serif;
    --font-serif: 'Source Serif 4', 'Noto Serif TC', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-warm); }

/* ============ NAV ============ */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250,250,248,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 0 24px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-primary); }
.logo-text { font-family: var(--font-serif); font-size: 1.3rem; letter-spacing: 0.5px; }
.logo-accent { color: var(--accent); }

.nav-links { display: flex; gap: 6px; }
.nav-link {
    padding: 6px 14px; border-radius: 6px; font-size: 0.88rem; font-weight: 500;
    color: var(--text-secondary); transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { background: var(--accent-light); color: var(--accent); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text-primary); margin: 4px 0; border-radius: 2px; transition: 0.2s; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 60px; left: 0; right: 0;
        background: var(--bg-primary); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 12px 24px;
    }
    .nav-links.open { display: flex; }
}

/* ============ HERO ============ */
.hero {
    max-width: 1100px; margin: 0 auto; padding: 80px 24px 60px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}

.hero-greeting { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); margin-bottom: 8px; }
.hero-name { font-family: var(--font-serif); font-size: 3.2rem; font-weight: 600; line-height: 1.2; margin-bottom: 4px; }
.hero-name-en { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 300; color: var(--text-secondary); margin-bottom: 20px; font-style: italic; }

.hero-tagline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 28px; font-size: 0.95rem; }
.tagline-line { background: var(--accent-light); padding: 3px 12px; border-radius: 20px; color: var(--accent); font-weight: 500; }
.tagline-sep { color: var(--text-tertiary); }

.hero-quote {
    font-family: var(--font-serif); font-style: italic; font-size: 0.95rem;
    color: var(--text-secondary); line-height: 1.9;
    border-left: 3px solid var(--accent-warm); padding-left: 20px; margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 12px; }

.btn {
    padding: 10px 24px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s; display: inline-block; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1e4a5f; color: #fff; }
.btn-outline { border: 1.5px solid var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Floating cards */
.hero-visual { position: relative; min-height: 380px; }
.card-stack { position: relative; width: 100%; height: 380px; }

.floating-card {
    position: absolute; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.floating-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon { font-size: 1.5rem; display: block; margin-bottom: 6px; }
.card-label { font-weight: 600; font-size: 0.9rem; display: block; }
.card-detail { font-size: 0.78rem; color: var(--text-tertiary); display: block; margin-top: 2px; }

.card-1 { top: 0; left: 10%; }
.card-2 { top: 30px; right: 5%; }
.card-3 { top: 180px; left: 5%; }
.card-4 { top: 220px; right: 10%; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.card-1 { animation: float 5s ease-in-out infinite; }
.card-2 { animation: float 5s ease-in-out 1s infinite; }
.card-3 { animation: float 5s ease-in-out 2s infinite; }
.card-4 { animation: float 5s ease-in-out 3s infinite; }

@media (max-width: 768px) {
    .hero { grid-template-columns: 1fr; padding: 50px 24px 40px; gap: 40px; }
    .hero-name { font-size: 2.4rem; }
    .hero-visual { min-height: 320px; }
    .card-stack { height: 320px; }
}

/* ============ SECTIONS ============ */
.section { padding: 80px 24px; }
.section-alt { background: var(--bg-secondary); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-title { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; margin-bottom: 8px; text-align: center; }
.section-subtitle { text-align: center; color: var(--text-tertiary); font-size: 0.9rem; margin-bottom: 48px; }

/* Career Grid */
.career-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.career-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; transition: all 0.3s;
}
.career-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.career-number { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--accent-light); line-height: 1; margin-bottom: 12px; }
.career-card:hover .career-number { color: var(--accent); }
.career-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.career-period { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 12px; }
.career-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.career-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; background: var(--accent-light); color: var(--accent); font-weight: 500; }

@media (max-width: 768px) { .career-grid { grid-template-columns: 1fr; } }

/* Download Grid */
.download-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.download-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px 16px; text-align: center; transition: all 0.3s; color: var(--text-primary);
}
.download-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); color: var(--accent); }
.download-icon { font-size: 2rem; }
.download-name { font-size: 0.88rem; font-weight: 600; }
.download-format { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-tertiary); text-transform: uppercase; }

@media (max-width: 768px) { .download-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ TIMELINE (chaochi.html) ============ */
.page-header {
    text-align: center; padding: 60px 24px 40px;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 600; margin-bottom: 8px; }
.page-header p { color: var(--text-secondary); font-size: 0.95rem; }

.timeline { max-width: 800px; margin: 0 auto; padding: 40px 24px 80px; position: relative; }
.timeline::before {
    content: ''; position: absolute; left: 120px; top: 40px; bottom: 80px;
    width: 2px; background: var(--border);
}

.timeline-era {
    margin: 48px 0 24px; padding: 8px 20px; display: inline-block;
    background: var(--accent); color: #fff; border-radius: 20px;
    font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
    position: relative; left: 60px;
}

.timeline-item { display: grid; grid-template-columns: 110px 1fr; gap: 32px; margin-bottom: 28px; position: relative; }
.timeline-year {
    font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
    color: var(--accent); text-align: right; padding-top: 4px;
}
.timeline-year::after {
    content: ''; position: absolute; left: 115px; top: 10px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg-primary); border: 2.5px solid var(--accent); z-index: 1;
}
.timeline-content {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; transition: all 0.3s;
}
.timeline-content:hover { box-shadow: var(--shadow-md); }
.timeline-content p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.8; }
.timeline-content .highlight { color: var(--text-primary); font-weight: 500; }

.timeline-link {
    display: inline-block; margin-top: 40px; padding: 10px 24px;
    background: var(--accent-light); color: var(--accent); border-radius: 8px;
    font-weight: 500; font-size: 0.9rem; position: relative; left: 142px;
}
.timeline-link:hover { background: var(--accent); color: #fff; }

@media (max-width: 768px) {
    .timeline::before { left: 16px; }
    .timeline-era { left: 0; }
    .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 36px; }
    .timeline-year { text-align: left; }
    .timeline-year::after { left: -28px; top: 6px; }
    .timeline-link { left: 36px; }
}

/* ============ TRAINING TABLE (training.html) ============ */
.training-section { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }

.training-era {
    margin: 48px 0 20px; padding: 8px 20px; display: inline-block;
    background: var(--accent); color: #fff; border-radius: 20px;
    font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
}

.training-legend {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px;
    padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-secondary); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-a { background: #4caf50; }
.legend-b { background: #ff9800; }
.legend-c { background: #2196f3; }
.legend-d { background: #9c27b0; }
.legend-e { background: #f44336; }
.legend-f { background: #607d8b; }

.training-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.training-table thead th {
    background: var(--bg-secondary); padding: 12px 16px; text-align: left;
    font-weight: 600; font-size: 0.8rem; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border);
}
.training-table tbody td {
    padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.training-table tbody tr:hover { background: var(--accent-light); }
.training-table tbody tr:last-child td { border-bottom: none; }

.training-table .num { font-family: var(--font-mono); font-weight: 600; color: var(--text-tertiary); width: 40px; text-align: center; }
.training-table .org { font-weight: 500; }
.training-table .date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-tertiary); white-space: nowrap; }

.cat-badge {
    display: inline-block; width: 8px; height: 8px; border-radius: 2px;
    margin-right: 6px; vertical-align: middle;
}

@media (max-width: 768px) {
    .training-table { font-size: 0.78rem; }
    .training-table thead th, .training-table tbody td { padding: 8px 10px; }
    .training-table .date { font-size: 0.72rem; }
}

/* ============ FOOTER ============ */
.footer { text-align: center; padding: 32px 24px; border-top: 1px solid var(--border); }
.footer p { font-size: 0.8rem; color: var(--text-tertiary); }
