/* personal_site/assets/style.css — 全站共享主题
   模块划分:
     1. reset + body theme
     2. nav.topbar
     3. footer
     4. article typography(深色 GFM 元素)
     5. hero(index)
     6. latest grid + card(index)
     7. catalog(catalog.html)
     8. about card(about.html)
     9. cover-hero(pages/*.html)
     10. see-all / cta 按钮
*/

/* ---------- 1. reset + body ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", system-ui, sans-serif;
}
body {
    background: #0b101c;
    color: #d8e1ee;
    line-height: 1.75;
    min-height: 100vh;
}
body.page-root {
    background-image:
        radial-gradient(circle at 20% 10%, rgba(30, 90, 220, 0.08), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(0, 160, 200, 0.06), transparent 45%);
}

/* ---------- 2. nav.topbar ---------- */
nav.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 16, 28, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(80, 160, 255, 0.12);
    padding: 14px 32px;
    display: flex;
    gap: 32px;
    align-items: center;
}
nav.topbar .brand {
    color: #7fc2ff;
    font-weight: bold;
    margin-right: auto;
    letter-spacing: 1px;
    font-size: 16px;
    text-decoration: none;
}
nav.topbar .brand:hover { color: #2388ff; }
nav.topbar a {
    color: #c8d8f0;
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s;
}
nav.topbar a:hover { color: #2388ff; }

/* ---------- 3. footer ---------- */
footer.site {
    text-align: center;
    padding: 30px 0 40px;
    color: #60789c;
    font-size: 14px;
    border-top: 1px solid rgba(80, 160, 255, 0.08);
    margin-top: 60px;
}
footer.site a {
    color: inherit;
    text-decoration: none;
    transition: 0.2s;
}
footer.site a:hover { color: #7fc2ff; }

/* ---------- 4. article typography(pages/*.html 用) ---------- */
main.article {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
article { font-size: 16px; }
article h1, article h2, article h3, article h4 {
    color: #ffffff;
    margin: 1.6em 0 0.7em;
    line-height: 1.35;
}
article h1 {
    font-size: 26px;
    border-bottom: 1px solid rgba(80, 160, 255, 0.2);
    padding-bottom: 0.3em;
}
article h2 { font-size: 22px; color: #7fc2ff; }
article h3 { font-size: 19px; color: #8ccbff; }
article p { margin: 1em 0; color: #c8d8f0; }
article a {
    color: #7fc2ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(127, 194, 255, 0.5);
}
article a:hover { color: #ffffff; border-bottom-style: solid; }
article ul, article ol { margin: 1em 0 1em 1.6em; color: #c8d8f0; }
article li { margin: 0.3em 0; }
article strong { color: #ffffff; }
article em { color: #b8ccec; }
article code {
    background: rgba(35, 136, 255, 0.12);
    color: #a4d0ff;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 0.92em;
}
article pre {
    background: #0f1626;
    border: 1px solid rgba(80, 160, 255, 0.15);
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 1.2em 0;
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.55;
    color: #d8e1ee;
}
article pre code { background: none; padding: 0; color: inherit; }
article blockquote {
    border-left: 3px solid #2388ff;
    padding: 0.4em 1em;
    margin: 1.2em 0;
    color: #a5b8d4;
    background: rgba(35, 136, 255, 0.05);
    border-radius: 0 8px 8px 0;
}
article table {
    border-collapse: collapse;
    margin: 1.2em 0;
    width: 100%;
    font-size: 15px;
}
article th, article td {
    border: 1px solid rgba(80, 160, 255, 0.18);
    padding: 10px 14px;
    text-align: left;
}
article th { background: rgba(35, 136, 255, 0.15); color: #ffffff; }
article td { color: #c8d8f0; }
article img { max-width: 100%; border-radius: 8px; margin: 1em 0; }
/* 课程页二维码:居中收窄,不被 article img 的全宽规则撑大 */
article p:has(> img[alt*="二维码"]) {
    text-align: center;
}
article img[alt*="二维码"] {
    display: inline-block;
    max-width: 260px;
    width: 70%;
    margin: 1.6em auto 0.4em;
    border-radius: 12px;
    border: 1px solid rgba(80, 160, 255, 0.25);
}
article p:has(> img[alt*="二维码"]) + p {
    text-align: center;
}
article p:has(> img[alt*="二维码"]) + p strong {
    color: #7fc2ff;
}
article hr { border: 0; border-top: 1px dashed rgba(80, 160, 255, 0.2); margin: 2em 0; }

/* ---------- 5. hero(index.html) ---------- */
.hero {
    position: relative;
    height: 62vh;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 30%, rgba(35, 136, 255, 0.28), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(0, 200, 220, 0.18), transparent 55%),
        #0b101c;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(80, 160, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 160, 255, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}
.hero h1 {
    position: relative;
    font-size: clamp(38px, 6vw, 72px);
    color: #ffffff;
    letter-spacing: 4px;
    text-shadow: 0 0 32px rgba(35, 136, 255, 0.55);
}
.hero .en {
    position: relative;
    margin-top: 12px;
    color: #7fc2ff;
    font-size: clamp(13px, 1.4vw, 16px);
    letter-spacing: 8px;
    text-transform: uppercase;
    font-weight: 300;
    opacity: 0.85;
}
.hero .sub {
    position: relative;
    margin-top: 22px;
    color: #8cb8e8;
    font-size: clamp(15px, 1.8vw, 20px);
    letter-spacing: 2px;
}
.hero .cta {
    position: relative;
    margin-top: 40px;
    display: flex;
    gap: 16px;
}
.hero .cta a {
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 15px;
    transition: 0.25s;
    border: 1px solid rgba(35, 136, 255, 0.4);
    color: #cfe1ff;
}
.hero .cta a.primary {
    background: rgba(35, 136, 255, 0.22);
    color: #ffffff;
}
.hero .cta a:hover {
    background: rgba(35, 136, 255, 0.35);
    border-color: #2388ff;
    transform: translateY(-2px);
}

/* ---------- 6. latest grid + card(index.html) ---------- */
.latest {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 24px 90px;
}
.latest h2 {
    font-size: 22px;
    color: #7fc2ff;
    border-left: 4px solid #2388ff;
    padding-left: 14px;
    margin-bottom: 32px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}
.card {
    position: relative;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(80, 160, 255, 0.18);
    background: #141c2c;
    cursor: pointer;
    transition: 0.28s;
    text-decoration: none;
    display: block;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(35, 136, 255, 0.55);
    box-shadow: 0 8px 30px rgba(35, 136, 255, 0.25);
}
.card .cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: 0.4s;
}
.card:hover .cover { transform: scale(1.06); }
.card .mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(11, 16, 28, 0.92) 0%,
        rgba(11, 16, 28, 0.55) 50%,
        rgba(11, 16, 28, 0.15) 100%);
}
.card .title {
    position: absolute;
    left: 18px; right: 18px; bottom: 16px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    line-height: 1.4;
}
.card.no-cover .title {
    top: 50%; bottom: auto;
    left: 12px; right: 12px;
    transform: translateY(-50%);
    text-align: center;
    font-size: 22px;
    letter-spacing: 2px;
}
.see-all { text-align: center; margin-top: 50px; }
.see-all a {
    color: #7fc2ff;
    text-decoration: none;
    font-size: 15px;
    padding: 10px 24px;
    border: 1px solid rgba(80, 160, 255, 0.3);
    border-radius: 22px;
    transition: 0.2s;
}
.see-all a:hover {
    background: rgba(35, 136, 255, 0.12);
    border-color: #2388ff;
    color: #ffffff;
}

/* ---------- 7. catalog(catalog.html) ---------- */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}
.container h1 {
    font-size: 34px;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.container .intro {
    color: #8cb8e8;
    font-size: 15px;
    margin-bottom: 36px;
}
ul.catalog { list-style: none; }
ul.catalog li { border-bottom: 1px solid rgba(80, 160, 255, 0.1); }
ul.catalog a {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    color: inherit;
    text-decoration: none;
    border-radius: 10px;
    transition: 0.2s;
}
ul.catalog a:hover { background: rgba(35, 136, 255, 0.08); }
ul.catalog .thumb {
    width: 72px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(80, 160, 255, 0.15);
    position: relative;
    overflow: hidden;
}
ul.catalog .thumb.no-cover::after {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
ul.catalog .title {
    flex: 1;
    font-size: 17px;
    color: #e6edf7;
}
ul.catalog .date {
    color: #60789c;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.empty {
    color: #60789c;
    text-align: center;
    padding: 60px 0;
    font-size: 15px;
}

/* ---------- 8. about card(about.html) ---------- */
.about-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 60px 24px;
}
.about-card {
    background: rgba(20, 28, 44, 0.65);
    border: 1px solid rgba(80, 160, 255, 0.18);
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 0 45px rgba(24, 110, 220, 0.12);
    backdrop-filter: blur(10px);
}
.about-card .avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 24px;
    border: 3px solid #2388ff;
    box-shadow: 0 0 22px rgba(35, 136, 255, 0.35);
}
.about-card h1 {
    text-align: center;
    font-size: 30px;
    color: #ffffff;
    margin-bottom: 8px;
}
.about-card .tagline {
    text-align: center;
    color: #8cb8e8;
    font-size: 18px;
    margin-bottom: 40px;
}
.about-card section { margin: 36px 0; }
.about-card h2 {
    font-size: 21px;
    color: #7fc2ff;
    border-left: 4px solid #2388ff;
    padding-left: 14px;
    margin-bottom: 18px;
}
.about-card p { color: #c8d8f0; font-size: 16px; }
.about-card .skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}
.about-card .skill-tag {
    background: rgba(35, 136, 255, 0.12);
    color: #8ccbff;
    border: 1px solid rgba(35, 136, 255, 0.25);
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 15px;
}
.about-card .contact a {
    display: inline-block;
    color: #7fc2ff;
    text-decoration: none;
    margin-right: 20px;
    transition: 0.25s;
}
.about-card .contact a:hover {
    color: #2388ff;
    text-decoration: underline;
}

/* ---------- 9. cover-hero(pages/*.html) ---------- */
.cover-hero {
    position: relative;
    height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}
.cover-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(11, 16, 28, 0.25) 0%,
        rgba(11, 16, 28, 0.65) 70%,
        #0b101c 100%);
}
.cover-hero h1 {
    position: relative;
    color: #ffffff;
    font-size: clamp(26px, 4vw, 42px);
    padding: 0 24px 40px;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
    max-width: 900px;
}
