:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --done-bg: #eef2ff;
    --done-line: #c7d2fe;
    --planned-bg: #f3f4f6;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(31, 41, 55, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--primary); }

/* 구역 라벨 (F-01 ~ F-06) */
.badge {
    display: inline-block;
    margin: 0 0 8px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--done-bg);
    border-radius: 999px;
}

/* ---------- header (F-01, F-02) ---------- */
header {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--accent));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 56px;
    padding-bottom: 32px;
}

header .badge {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

h1 {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1.2;
}

.affiliation {
    margin: 8px 0 0;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

.intro {
    margin: 16px 0 0;
    font-size: 1.25rem;
}

.contact { text-align: right; }

.button {
    display: inline-block;
    padding: 12px 24px;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-dark);
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.button:hover,
.button:focus-visible { transform: translateY(-2px); }

nav ul {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 0 20px;
    list-style: none;
}
nav a {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.95rem;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
}
nav a:hover,
nav a:focus-visible { background: rgba(255, 255, 255, 0.2); }

/* ---------- main sections (F-03 ~ F-05) ---------- */
main { padding-top: 40px; padding-bottom: 24px; }

section {
    margin-bottom: 32px;
    padding: 32px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    scroll-margin-top: 16px;
}

h2 {
    margin: 0 0 20px;
    font-size: 1.6rem;
}
h2 .sub {
    margin-left: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

/* 분류 / 이수 구분 태그 */
.tag {
    display: inline-block;
    padding: 2px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 999px;
}
.tag.project   { color: #3730a3; background: #e0e7ff; }
.tag.award     { color: #92400e; background: #fef3c7; }
.tag.license   { color: #065f46; background: #d1fae5; }
.tag.activity  { color: #9d174d; background: #fce7f3; }
.tag.education { color: #155e75; background: #cffafe; }
.tag.major     { color: #fff;    background: var(--primary); }
.tag.general   { color: #374151; background: #e5e7eb; }

/* F-03 표 */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}
caption {
    padding-bottom: 8px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--muted);
}
th, td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}
th {
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--bg);
}
tbody tr:hover { background: #fafbff; }
td:first-child {
    font-weight: 700;
    white-space: nowrap;
    color: var(--primary);
}

/* F-04 수강 과목 */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.course-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.course-list a { font-weight: 700; }

/* F-05 진행률 */
.progress-text {
    margin: -8px 0 6px;
    font-size: 0.95rem;
    color: var(--muted);
}
.progress-text strong { color: var(--primary); }
.progress-bar {
    display: block;
    width: 100%;
    height: 10px;
    margin-bottom: 20px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    appearance: none;
    background: var(--done-bg);
}
.progress-bar::-webkit-progress-bar { background: var(--done-bg); }
.progress-bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.progress-bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

/* F-05 주차별 링크 */
.legend {
    margin: -8px 0 16px;
    font-size: 0.9rem;
    color: var(--muted);
}
.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 4px 0 12px;
    border-radius: 50%;
    vertical-align: middle;
}
.legend .dot:first-child { margin-left: 0; }
.done-dot    { background: var(--primary); }
.planned-dot { background: #d1d5db; }

.weeks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.weeks li {
    border-radius: 10px;
    text-align: center;
}
.weeks .num {
    font-size: 1.4rem;
    font-weight: 900;
    margin-right: 2px;
}

.weeks .done {
    background: var(--done-bg);
    border: 1px solid var(--done-line);
    transition: transform 0.15s, box-shadow 0.15s;
}
.weeks .done:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.weeks .done a {
    display: block;
    padding: 14px 8px;
    font-weight: 700;
    text-decoration: none;
}

.weeks .planned {
    padding: 14px 8px;
    color: #9ca3af;
    background: var(--planned-bg);
    border: 1px dashed #d1d5db;
}
.weeks .planned em { font-size: 0.8rem; font-style: normal; }

/* 실습이 없는 주차: 링크가 아니므로 <a> 대신 <span>을 쓰되 진행 주차와 같은 모양 */
.weeks .done .no-link {
    display: block;
    padding: 14px 8px;
    font-weight: 700;
    color: var(--primary);
}
.weeks .note { display: block; }

/* ---------- footer (F-06) ---------- */
footer {
    padding: 32px 0 40px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
footer p { margin: 0; }
footer .badge { margin-bottom: 8px; }

/* ---------- 인쇄 / PDF 저장 ---------- */
@media print {
    @page { size: A4; margin: 12mm; }

    body { color: #000; background: #fff; font-size: 10pt; line-height: 1.5; }
    header { color: #000; background: none; border-bottom: 2px solid #000; }
    .header-inner { padding-top: 0; padding-bottom: 8px; }
    h1 { font-size: 22pt; }
    .affiliation, .intro { opacity: 1; }
    .intro { font-size: 11pt; }

    nav, .badge, .legend, .progress-bar { display: none; }
    .button { padding: 0; color: #000; background: none; box-shadow: none; }
    .button::after { content: " (github.com/woongkyu1182)"; }

    main { padding-top: 12px; padding-bottom: 0; }
    section { margin-bottom: 14px; padding: 0; box-shadow: none; break-inside: avoid; }
    h2 { margin-bottom: 8px; font-size: 14pt; }

    th { color: #000; background: #eee; }
    th, td { padding: 4px 8px; }
    td:first-child { color: #000; }
    .tag, .tag.project, .tag.award, .tag.license, .tag.activity, .tag.education, .tag.major, .tag.general { color: #000; background: none; border: 1px solid #000; padding: 0 6px; }
    tr { break-inside: avoid; }

    .course-list li, .weeks .done, .weeks .planned { background: none; border: 1px solid #999; }
    .weeks { grid-template-columns: repeat(8, 1fr); gap: 6px; }
    .weeks .planned { color: #666; }

    footer { padding: 8px 0 0; color: #000; border-top: 1px solid #000; }
    a, .weeks .done .no-link { color: #000; text-decoration: none; }
}

/* ---------- 좁은 화면 ---------- */
@media (max-width: 720px) {
    .header-inner { flex-direction: column; align-items: flex-start; padding-top: 40px; }
    .contact { text-align: left; }
    h1 { font-size: 2rem; }
    section { padding: 20px; }
}
