/* ============================================
   新中式 · 作品集 — 样式表
   匹配旧版 HTML 结构（.stars .nav .hero .avatar .btn .dock .grid .card 等）
   ============================================ */

/* 引入字体（如加载慢可删除此行，自动回退系统字体） */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---------- 变量 ---------- */
:root {
    --ink: #1a1a1a;
    --ink-light: #4a4a4a;
    --ink-lighter: #8a8a8a;
    --paper: #faf8f5;
    --paper-warm: #f5f0e8;
    --accent: #c75b39;
    --accent-soft: #e07b5a;
    --accent-pale: #fdf0eb;
    --gold: #b8945a;
    --border: #e8e3db;
    --shadow-sm: 0 2px 12px rgba(0,0,0,.04);
    --shadow-md: 0 8px 40px rgba(0,0,0,.06);
    --shadow-lg: 0 20px 60px rgba(0,0,0,.08);
    --radius: 10px;
    --radius-lg: 16px;
    --font-serif: 'Noto Serif SC', 'STSong', 'SimSun', 'Songti SC', serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- 水墨背景（复用 .stars 元素） ---------- */
.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.stars::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    top: -180px; right: -130px;
    border-radius: 50%;
    background: var(--ink);
    opacity: .025;
    animation: inkFloat1 20s ease-in-out infinite;
}
.stars::after {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    bottom: -80px; left: -90px;
    border-radius: 50%;
    background: var(--ink);
    opacity: .022;
    animation: inkFloat2 25s ease-in-out infinite;
}
@keyframes inkFloat1 {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(-35px, 25px) scale(1.04); }
    66% { transform: translate(18px, -18px) scale(.96); }
}
@keyframes inkFloat2 {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(28px, -28px) scale(1.06); }
}

/* ---------- 导航栏 ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: rgba(250,248,245,.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, box-shadow .3s;
}
/* 滚动后加阴影——配合 script.js 给 .nav 添加 .nav--scrolled */
.nav--scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--ink);
    user-select: none;
}

.nav nav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}
.nav nav a {
    padding: 7px 16px;
    border-radius: 18px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--ink-light);
    letter-spacing: .04em;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav nav a:hover {
    color: var(--accent);
    background: var(--accent-pale);
}

/* ---------- Hero 首页 ---------- */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 100px 24px 60px;
}

.avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    /* 如果还是 <div> 也能用背景图兜底 */
    background-image: url('https://raw.githubusercontent.com/jt6kdpmc7j-hue/puppet-master-ultra/main/avatar.webp');
    background-size: cover;
    background-position: center;
    box-shadow: 0 3px 20px rgba(0,0,0,.08);
    margin-bottom: 28px;
    transition: transform var(--transition);
    user-select: none;
    -webkit-user-drag: none;
    border: 3px solid transparent;
    position: relative;
}
.avatar:hover {
    transform: scale(1.04);
}

/* 头像光环 */
.avatar::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: .12;
    pointer-events: none;
    animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { inset: -10px; opacity: .12; }
    50% { inset: -18px; opacity: .05; }
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 8px;
}
.hero p {
    font-size: 1rem;
    color: var(--ink-lighter);
    letter-spacing: .05em;
    margin-bottom: 32px;
}

/* ---------- 社交按钮 .dock ---------- */
.dock {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 22px;
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .04em;
    transition: all var(--transition);
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--ink-light);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: scale(.96);
}

/* Telegram 按钮 */
.btn.tg {
    color: #1e93d2;
    border-color: #b8ddf5;
}
.btn.tg:hover {
    background: #e8f4fb;
    border-color: #1e93d2;
}

/* 邮箱按钮 */
.btn.mail {
    color: var(--accent);
    border-color: #f0d0c4;
}
.btn.mail:hover {
    background: var(--accent-pale);
    border-color: var(--accent);
}

/* 按钮内加图标文字（原按钮为空，用 ::before 显示内容） */
.btn::before {
    font-size: .95rem;
    line-height: 1;
}
.btn.tg::before {
    content: '✈';
}
.btn.mail::before {
    content: '✉';
}

/* ---------- 通用区块 ---------- */
.section {
    position: relative;
    z-index: 1;
    padding: 90px 24px;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.section h2 {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--ink);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}
/* 标题下方装饰短线 */
.section h2::after {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--accent);
    margin: 10px auto 0;
    border-radius: 1px;
    opacity: .5;
}

.section p {
    font-size: .95rem;
    color: var(--ink-lighter);
    letter-spacing: .04em;
    line-height: 1.8;
    max-width: 460px;
    margin: 0 auto;
}

/* ---------- 项目卡片 ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 8px;
    text-align: left;
}

.card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    border: 1px solid var(--border);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--ink);
    text-align: center;
    transition: all var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
    color: var(--accent);
}
.card:hover::before {
    transform: scaleX(1);
}
.card:active {
    transform: scale(.97);
}

/* ---------- 关于区块微调 ---------- */
#about.section p {
    font-size: 1rem;
    line-height: 2;
}
#about.section p strong {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- 联系区块微调 ---------- */
#contact p a {
    color: var(--accent);
    border-bottom: 1px dotted var(--accent);
    transition: border-color .3s;
}
#contact p a:hover {
    border-bottom-style: solid;
}

/* ---------- 页脚 ---------- */
.section:last-of-type {
    padding-bottom: 100px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .nav {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    .logo {
        font-size: 1rem;
    }
    .nav nav a {
        padding: 6px 12px;
        font-size: .8rem;
        border-radius: 14px;
    }
    .hero {
        min-height: auto;
        padding: 110px 16px 50px;
    }
    .avatar {
        width: 88px; height: 88px;
        margin-bottom: 20px;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .hero p {
        font-size: .9rem;
        margin-bottom: 24px;
    }
    .btn {
        padding: 7px 16px;
        font-size: .82rem;
    }
    .section {
        padding: 56px 16px;
    }
    .section h2 {
        font-size: 1.4rem;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card {
        padding: 24px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .nav nav {
        gap: 0;
    }
    .nav nav a {
        padding: 5px 9px;
        font-size: .72rem;
    }
    .hero h1 {
        font-size: 1.4rem;
    }
    .dock {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 180px;
        justify-content: center;
    }
}
