/* ================================================================
   斯乌苏 · AI Content Creator — Global Styles
   Design: Apple-inspired minimalism, white + orange (#FF6B35)
   ================================================================ */

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

:root {
    --bg: #FFFFFF;
    --bg-secondary: #F8F8F8;
    --text: #1A1A1A;
    --text-secondary: #6B6B6B;
    --accent: #FF6B35;
    --accent-hover: #E55A2B;
    --accent-light: #FFF3ED;
    --border: #E5E5E5;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
    --max-width: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== Navigation ========== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: all var(--transition);
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.nav-links a.active {
    color: var(--accent);
    font-weight: 500;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-lang {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.nav-lang:hover {
    color: var(--text);
    border-color: #ccc;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* ========== Hero ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 6rem;
}

.hero-content {
    max-width: 680px;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
    border: 3px solid var(--bg-secondary);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 1rem;
}

.hero h1 .accent {
    color: var(--accent);
}

.hero .subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.hero .tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

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

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ========== Section ========== */
.section {
    padding: 6rem 2rem;
}

.section-bg {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section-more {
    text-align: center;
    margin-top: 3rem;
}

.section-more a {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.section-more a:hover {
    letter-spacing: 0.02em;
}

/* ========== Tutorial Cards ========== */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.tutorial-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.tutorial-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.tutorial-card-cover {
    aspect-ratio: 3 / 4;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tutorial-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tutorial-card:hover .tutorial-card-cover img {
    transform: scale(1.05);
}

.tutorial-card-cover .placeholder-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.4;
}

.tutorial-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.tutorial-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-card-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tutorial-card-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: var(--accent-light);
    color: var(--accent);
}

/* ========== Page Header ========== */
.page-header {
    padding: 7.5rem 2rem 2.5rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== Filter Bar ========== */
.filter-bar {
    padding: 0 2rem 2rem;
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tag {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tag.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ========== Tutorial Detail ========== */
.tutorial-detail {
    padding: 6.5rem 2rem 4rem;
}

.tutorial-detail .container {
    max-width: 780px;
}

.back-link {
    display: inline-block;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    transition: color var(--transition);
}

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

.tutorial-detail-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.tutorial-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.xhs-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: auto;
    transition: opacity var(--transition);
}

.xhs-link:hover {
    opacity: 0.7;
}

/* ========== Markdown Body ========== */
.markdown-body {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text);
}

.markdown-body h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    letter-spacing: -0.01em;
}

.markdown-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.35rem;
    list-style: disc;
}

.markdown-body ol li {
    list-style: decimal;
}

.markdown-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.markdown-body a:hover {
    opacity: 0.8;
}

.markdown-body blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
}

.markdown-body blockquote p {
    margin-bottom: 0;
}

.markdown-body code {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.88em;
    background: var(--bg-secondary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.markdown-body pre {
    margin: 1rem 0;
    padding: 1.25rem;
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.88rem;
    line-height: 1.6;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.markdown-body th,
.markdown-body td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.markdown-body th {
    font-weight: 600;
    background: var(--bg-secondary);
}

.markdown-body tr:hover td {
    background: var(--accent-light);
}

/* Code block copy button */
.code-block-wrapper {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

/* ========== Tutorial Prev/Next Nav ========== */
.tutorial-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.tutorial-nav-item {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.tutorial-nav-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.tutorial-nav-item.next {
    text-align: right;
}

.tutorial-nav-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.tutorial-nav-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

/* ========== Resource Tabs ========== */
.resource-tabs {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.resource-tab {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    margin-bottom: -1px;
}

.resource-tab:hover {
    color: var(--text);
}

.resource-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.resource-panel {
    display: none;
}

.resource-panel.active {
    display: block;
}

.loading-state,
.loading-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
}

/* ========== About Page ========== */
.about-hero {
    padding: 7.5rem 2rem 3rem;
}

.about-hero-inner {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    max-width: 720px;
    margin: 0 auto;
}

.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-secondary);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.about-hero-text h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.about-identity {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.about-slogan {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 500;
}

.about-content {
    max-width: 720px;
}

.about-block {
    margin-bottom: 3.5rem;
}

.about-block:last-child {
    margin-bottom: 0;
}

.about-block h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.about-block p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.about-block p:last-child {
    margin-bottom: 0;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tool-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.tool-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tool-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.find-me-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.find-me-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.find-me-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.find-me-platform {
    font-weight: 600;
    font-size: 0.95rem;
}

.find-me-handle {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 4rem 2rem 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.footer-col ul li {
    margin-bottom: 0.65rem;
}

.footer-col ul a {
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.footer-col ul a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========== Reveal Animations ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========== Typewriter ========== */
.hero-line {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    border-right: 2px solid var(--accent);
    vertical-align: bottom;
}

.hero-line.typing {
    animation: blink-caret 0.6s step-end infinite;
}

.hero-line.done {
    width: 100%;
    border-right: none;
}

.hero-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-fade.visible {
    opacity: 1;
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .tutorials-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 0.75rem;
        border-bottom: 1px solid var(--border);
        gap: 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.7rem 1rem;
        width: 100%;
        border-radius: 8px;
    }

    .nav-toggle {
        display: block;
    }

    .tutorial-nav {
        grid-template-columns: 1fr;
    }

    .tutorial-nav-item.next {
        text-align: left;
    }

    .tutorial-detail-header h1 {
        font-size: 1.4rem;
    }

    .page-header {
        padding: 6.5rem 1.5rem 2rem;
    }

    .xhs-link {
        margin-left: 0;
        width: 100%;
    }

    .markdown-body table {
        font-size: 0.82rem;
    }

    .markdown-body th,
    .markdown-body td {
        padding: 0.5rem 0.6rem;
    }

    .hero {
        min-height: auto;
        padding: 7rem 1.5rem 4rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    /* About page mobile */
    .about-hero {
        padding: 6.5rem 1.5rem 2rem;
    }

    .about-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .about-avatar {
        width: 100px;
        height: 100px;
    }

    .about-hero-text h1 {
        font-size: 1.6rem;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .find-me-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Resource tabs mobile */
    .resource-tabs {
        gap: 0;
    }

    .resource-tab {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }

    /* Table horizontal scroll on mobile */
    .markdown-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Filter tags scroll on mobile */
    .filter-tags {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .filter-tag {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.55rem;
    }

    .hero-avatar {
        width: 80px;
        height: 80px;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .about-avatar {
        width: 80px;
        height: 80px;
    }

    .about-hero-text h1 {
        font-size: 1.4rem;
    }

    .resource-tab {
        font-size: 0.8rem;
        padding: 0.6rem 0.75rem;
    }
}
