/* ============================================================
   简历站样式 · 参考 cv.hackdeacon.cn 的版式
   - 960px 纸张 / 分区图标 / 卡片网格 / 时间线
   - 浅色 · 深色 · 打印
   ============================================================ */

:root {
    --bg: #f5f5f7;
    --paper: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --border: #e8e8ed;
    --border-strong: #d2d2d7;
    --accent: #0071e3;
    --accent-soft: #eaf3fe;
    --card: #fbfbfd;
    --card-border: #ececef;
    --tag-bg: #f0f0f3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
    --radius: 18px;
    --radius-sm: 12px;
}

html[data-theme="dark"] {
    --bg: #0b0b0d;
    --paper: #141416;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;
    --border: #2a2a2d;
    --border-strong: #3a3a3e;
    --accent: #0a84ff;
    --accent-soft: #102a44;
    --card: #1a1a1d;
    --card-border: #2a2a2d;
    --tag-bg: #232326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .35);
}

/* 默认浅色；深色由右上角按钮手动切换（简历场景以浅色为主） */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    padding: 36px 16px 80px;
    transition: background .25s ease, color .25s ease;
}

/* ---------- 工具栏 ---------- */
.toolbar {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.tool-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--card-border);
    border-radius: 11px;
    background: var(--paper);
    color: var(--text-secondary);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all .18s ease;
}

.tool-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ---------- 纸张 ---------- */
.resume-container { max-width: 960px; margin: 0 auto; }

.resume-paper {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 44px 48px 52px;
    transition: background .25s ease;
}

.loading { text-align: center; color: var(--text-secondary); padding: 60px 0; }

/* ---------- 头部 ---------- */
.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

.header-main { flex: 1; min-width: 0; }

.name-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.name { font-size: 32px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }

.alias { font-size: 15px; color: var(--text-tertiary); font-weight: 500; letter-spacing: .3px; }

.headline {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1.5;
}

.tagline { margin-top: 6px; font-size: 13.5px; color: var(--text-secondary); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
}

.status::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.contacts { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 16px; }

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: none; border: none; padding: 0;
    font-family: inherit;
    cursor: default;
}

a.contact-item:hover, .contact-item.copyable:hover { color: var(--accent); }
.contact-item i { font-size: 14px; color: var(--text-tertiary); }
.contact-item.copyable { cursor: pointer; }

.avatar-wrap { flex-shrink: 0; }

.avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    display: block;
}

/* ---------- 分区 ---------- */
.section { margin-top: 34px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    letter-spacing: -.2px;
}

.section-title i {
    font-size: 19px;
    color: var(--accent);
}

.section-title .en {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: .6px;
    text-transform: uppercase;
}

/* ---------- 核心优势卡片 ---------- */
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.highlight-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px 16px 15px;
}

.highlight-card .hc-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.8px;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 7px;
}

.highlight-card .hc-title i { font-size: 16px; color: var(--accent); }

.highlight-card .hc-desc {
    font-size: 12.8px;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ---------- 简介 ---------- */
.summary-text { font-size: 14.5px; line-height: 1.85; color: var(--text); }

/* ---------- 技术栈 ---------- */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.skill-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}

.skill-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.8px;
    font-weight: 650;
    margin-bottom: 10px;
}

.skill-head i { font-size: 16px; color: var(--accent); }

.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.skill-tag {
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--text);
    font-size: 12.2px;
    line-height: 1.6;
    white-space: nowrap;
}

.skill-note {
    margin-top: 10px;
    font-size: 12.3px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ---------- 工作经历（时间线） ---------- */
.timeline { position: relative; padding-left: 18px; }

.timeline::before {
    content: "";
    position: absolute;
    left: 4px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--border);
}

.entry {
    position: relative;
    padding-bottom: 26px;
}

.entry:last-child { padding-bottom: 0; }

.entry::before {
    content: "";
    position: absolute;
    left: -18px; top: 8px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--accent);
}

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.entry-title { font-size: 15.5px; font-weight: 650; color: var(--text); }

.entry-role {
    font-size: 13.2px;
    color: var(--accent);
    font-weight: 500;
    margin-left: 8px;
}

.entry-period {
    font-size: 12.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.entry-loc { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; }

.entry-summary {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* 工作经历里的子项目 */
.sub-entry { margin-top: 13px; padding-left: 12px; border-left: 2px solid var(--border); }

.sub-title {
    font-size: 13.8px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.sub-desc {
    font-size: 13.2px;
    color: var(--text-secondary);
    line-height: 1.72;
}

/* ---------- 项目卡片 ---------- */
.project-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 18px 18px 16px;
    margin-bottom: 12px;
}

.project-card:last-child { margin-bottom: 0; }

.pc-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pc-name { font-size: 15px; font-weight: 650; }
.pc-alias { font-size: 12.5px; color: var(--text-tertiary); margin-left: 8px; font-weight: 500; }
.pc-period { font-size: 12.3px; color: var(--text-tertiary); white-space: nowrap; }

.pc-desc {
    margin-top: 7px;
    font-size: 13.2px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.entry-list { margin-top: 8px; padding-left: 0; list-style: none; }

.entry-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
    font-size: 13.2px;
    color: var(--text);
    line-height: 1.7;
}

.entry-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: .72em;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.tech-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

.tech-tag {
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11.8px;
    font-weight: 500;
}

.pc-links { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }

.pc-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
}

.pc-link:hover { text-decoration: underline; }

/* ---------- 教育 ---------- */
.edu-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
}

.edu-card:last-child { margin-bottom: 0; }

.edu-icon { font-size: 20px; color: var(--accent); margin-top: 1px; }

.edu-main { flex: 1; }

.edu-school { font-size: 14.5px; font-weight: 650; }
.edu-major { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.edu-period { font-size: 12.3px; color: var(--text-tertiary); white-space: nowrap; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%; bottom: 40px;
    transform: translate(-50%, 20px);
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .84);
    color: #fff;
    font-size: 13.5px;
    opacity: 0; pointer-events: none;
    transition: all .25s ease;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast i { font-size: 15px; color: #30d158; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    body { padding: 14px 10px 60px; font-size: 14px; }
    .resume-paper { padding: 26px 20px 34px; border-radius: 14px; }
    .toolbar { top: 10px; right: 10px; }
    .tool-btn { width: 34px; height: 34px; font-size: 15px; }

    .header { flex-direction: column-reverse; align-items: flex-start; gap: 16px; }
    .avatar { width: 84px; height: 84px; }
    .name { font-size: 25px; }

    .highlight-grid { grid-template-columns: 1fr; }
    .skill-grid { grid-template-columns: 1fr; }

    .entry-head, .pc-head { flex-direction: column; gap: 2px; }
    .section-title .en { display: none; }
}

/* ---------- 打印 ---------- */
@media print {
    :root {
        --bg: #fff; --paper: #fff; --text: #000;
        --text-secondary: #333; --text-tertiary: #666;
        --border: #ddd; --border-strong: #ccc;
        --accent: #0055b3; --accent-soft: #eef4fb;
        --card: #fafafa; --card-border: #e5e5e5; --tag-bg: #f2f2f2;
        --shadow: none;
    }

    body { background: #fff; padding: 0; font-size: 11.5px; }
    .toolbar, .toast { display: none !important; }
    .resume-paper { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }

    .section, .entry, .project-card, .edu-card, .highlight-card, .skill-card { break-inside: avoid; }
    .section-title { margin-bottom: 10px; }
    a { color: inherit; text-decoration: none; }
    .avatar { width: 84px; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
