/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    --bg: #0f0f0f;
    --bg-rgb: 15, 15, 15;
    --bg-card: #1a1a1a;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd1;
    --border: #2a2a2a;
    --radius: 12px;
    --max-w: 720px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

html.light {
    --bg: #f8f8f8;
    --bg-rgb: 248, 248, 248;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #888;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd1;
    --border: #e0e0e0;
}

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

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

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

a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ===== Container ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header & Nav ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(var(--bg-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo:hover { color: var(--accent); }

.nav-list {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-list a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-list a:hover,
.nav-list a:focus {
    color: var(--text);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle span + span { margin-top: 5px; }

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Sections ===== */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 56px;
}

.hero-content {
    width: 100%;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

.hero-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.contact-item:hover {
    color: var(--accent);
}

a.contact-item {
    text-decoration: none;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Works ===== */
.works {
    background: var(--bg-card);
}

.works-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    margin-top: 36px;
}

.works-subtitle:first-of-type {
    margin-top: 0;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.works-grid + .works-subtitle {
    margin-top: 48px;
}

.work-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform 0.2s, border-color 0.2s;
}

.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.work-card-more {
    border-style: dashed;
    opacity: 0.6;
    cursor: default;
}

.work-card-more:hover {
    transform: none;
    border-color: var(--border);
}

.work-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    color: var(--accent);
}

.work-icon svg {
    width: 100%;
    height: 100%;
}

.work-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.work-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.work-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.work-link:hover span {
    transform: translateX(3px);
    display: inline-block;
}

/* ===== Contact ===== */
.contact-list {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 32px;
    min-width: 140px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
    cursor: default;
}

a.contact-card {
    cursor: pointer;
}

a.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.contact-card svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.contact-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.contact-card-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
}

.footer-content {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-beian {
    margin-top: 8px;
}

.footer-beian a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-beian a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .section-title { font-size: 1.5rem; }
    .works-grid { grid-template-columns: 1fr; }
    .nav-list {
        display: none;
        position: absolute;
        top: 56px; left: 0; right: 0;
        background: rgba(var(--bg-rgb), 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 16px 20px;
        gap: 12px;
        border-bottom: 1px solid var(--border);
    }
    .nav-list.open { display: flex; }
    .nav-toggle { display: block; }
}
