/* CellPilot Website Styles */
/* Warm editorial theme */

:root {
    --bg-primary: #fff8dc;
    --bg-secondary: #fbf0c8;
    --bg-card: #fffdf0;
    --bg-card-hover: #f6e7b7;
    --bg-card-active: #66724a;
    --text-primary: #46533a;
    --text-secondary: #66724f;
    --text-muted: #767152;
    --accent-primary: #5f6f3d;
    --accent-secondary: #9d8a3b;
    --border-color: #ded0a2;
    --header-bg: rgba(255, 248, 220, 0.94);
    --shadow-soft: 0 18px 48px rgba(83, 79, 47, 0.08);
    --font-sans: Avenir Next, Avenir, Segoe UI, Helvetica Neue, Arial, sans-serif;
    --font-serif: Iowan Old Style, Palatino Linotype, Palatino, Georgia, serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.68;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
}

::selection {
    background-color: rgba(157, 138, 59, 0.28);
    color: #344026;
}

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

/* Header */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    font-family: var(--font-sans);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    color: var(--text-primary);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(109, 127, 69, 0.08);
}

.nav-link.active {
    color: #344026;
    background-color: rgba(109, 127, 69, 0.14);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.btn-primary:hover {
    background-color: rgba(109, 127, 69, 0.08);
    border-color: rgba(109, 127, 69, 0.35);
}

.btn-download {
    background-color: var(--accent-primary);
    color: #fffdf0;
    padding: 16px 48px;
    font-size: 1rem;
    border-radius: 8px;
    min-width: 320px;
}

.btn-download:hover {
    background-color: #5c6d39;
    transform: translateY(-1px);
}

/* Main Content */
.main {
    flex: 1;
    width: 100%;
}

/* Download Section */
.download-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    text-align: center;
}

.download-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0;
    line-height: 1.08;
}

.download-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 60px;
}

/* Platform Grid */
.platform-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.platform-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px 48px;
    min-width: 160px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-soft);
}

.platform-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(109, 127, 69, 0.35);
    transform: translateY(-2px);
}

.platform-card.active {
    background-color: var(--bg-card-active);
    color: #fffdf0;
    border-color: var(--bg-card-active);
}

.platform-card.active .platform-icon {
    color: #fffdf0;
}

.platform-icon {
    width: 48px;
    height: 48px;
    color: var(--text-primary);
}

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

.platform-name {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
}

/* Download Action */
.download-action {
    margin-bottom: 32px;
}

.download-requirements {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Version Info */
.version-info {
    margin-top: 36px;
}

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

.version-link {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-top: 8px;
    display: inline-block;
    font-family: var(--font-sans);
}

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

/* MCP Section */
.mcp-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.mcp-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.12;
}

.mcp-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.mcp-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.mcp-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    width: 360px;
    max-width: 100%;
    text-align: left;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.mcp-card:hover {
    border-color: rgba(109, 127, 69, 0.35);
    transform: translateY(-2px);
}

.mcp-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mcp-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-sans);
}

.mcp-card-version {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.mcp-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex: 1;
}

.mcp-card-desc code {
    background-color: var(--bg-secondary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.btn-mcp {
    width: 100%;
    background-color: var(--accent-primary);
    color: #fffdf0;
    padding: 14px 20px;
    font-size: 0.95rem;
}

.btn-mcp:hover {
    background-color: #5c6d39;
    transform: translateY(-1px);
}

.mcp-download-note {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.mcp-other-wrap {
    margin-top: 16px;
    font-family: var(--font-sans);
}

.mcp-other-wrap summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mcp-other-wrap summary::-webkit-details-marker {
    display: none;
}

.mcp-other-wrap summary::before {
    content: '▾';
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.mcp-other-wrap[open] summary::before {
    transform: rotate(180deg);
}

.mcp-other {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.mcp-other-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 9px 12px;
    background-color: var(--bg-card);
    transition: all 0.15s ease;
}

.mcp-other-link:hover {
    border-color: rgba(109, 127, 69, 0.35);
    color: var(--accent-primary);
}

.mcp-requirements {
    margin-top: 36px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 20px 0 56px;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    transform: translateY(-10px);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* Page Content Styles (for other pages) */
.page-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 0;
    line-height: 1.14;
}

.page-content {
    color: var(--text-secondary);
    font-size: 1.06rem;
    line-height: 1.55;
}

.page-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-top: 34px;
    margin-bottom: 10px;
}

.page-content h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-top: 22px;
    margin-bottom: 8px;
}

.page-content p {
    margin-bottom: 10px;
}

.page-content ul, .page-content ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.page-content li {
    margin-bottom: 4px;
}

.page-content code {
    background-color: rgba(255, 253, 240, 0.78);
    border: 1px solid rgba(222, 208, 162, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.page-content pre {
    background-color: rgba(255, 253, 240, 0.78);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.page-content pre code {
    background: none;
    padding: 0;
}

.page-content a {
    color: var(--accent-primary);
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.page-content table th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
}

.page-content table td {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: top;
}

.page-content table tr:nth-child(even) td {
    background-color: rgba(255, 253, 240, 0.55);
}

.page-content .method-block {
    border-left: 3px solid var(--accent-primary);
    padding-left: 18px;
    margin-bottom: 32px;
}

/* Collapsible sections */
.page-content details {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--bg-card);
    overflow: hidden;
}

.page-content details[open] {
    background-color: var(--bg-card);
}

.page-content details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-primary);
    list-style: none;
    user-select: none;
    transition: background-color 0.15s ease;
}

.page-content details summary::-webkit-details-marker {
    display: none;
}

.page-content details summary::after {
    content: '＋';
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: 400;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.page-content details[open] summary::after {
    content: '－';
}

.page-content details summary:hover {
    background-color: var(--bg-card-hover);
}

.page-content details .details-body {
    padding: 4px 24px 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Tutorial Hub */
.tutorial-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 24px 28px;
}

.tutorial-hero-content {
    width: 100%;
}

.section-kicker {
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-family: var(--font-sans);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.tutorial-intro {
    color: var(--text-secondary);
    font-size: 1.12rem;
    line-height: 1.75;
}

.tutorial-note {
    background-color: rgba(255, 253, 240, 0.66);
    border-left: 4px solid var(--accent-primary);
    border-radius: 8px;
    margin-top: 26px;
    padding: 22px 24px;
}

.tutorial-note p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.tutorial-note p:last-child {
    margin-bottom: 0;
}

.tutorial-note a,
.tutorial-detail a:not(.tutorial-back-link) {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.tutorial-note a:visited,
.tutorial-detail a:not(.tutorial-back-link):visited {
    color: #7e6d2d;
}

.tutorial-note a:hover,
.tutorial-detail a:not(.tutorial-back-link):hover {
    color: #526333;
}

.tutorial-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 34px 24px;
}

.tutorial-section:last-of-type {
    padding-bottom: 80px;
}

.tutorial-section-header {
    align-items: end;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 14px;
}

.tutorial-section-header h2 {
    font-size: 1.55rem;
    line-height: 1.2;
}

.tutorial-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tutorial-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tutorial-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.tutorial-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 22px;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.tutorial-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(109, 127, 69, 0.45);
    transform: translateY(-2px);
}

.tutorial-number {
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 800;
    font-family: var(--font-sans);
    margin-bottom: 28px;
}

.tutorial-card h3 {
    font-size: 1.02rem;
    line-height: 1.3;
    margin-bottom: 12px;
}

.tutorial-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.tutorial-grid-compact .tutorial-card {
    min-height: 176px;
    padding: 18px;
}

.tutorial-grid-compact .tutorial-number {
    margin-bottom: 20px;
}

.tutorial-grid-compact .tutorial-card h3 {
    font-size: 1.02rem;
}

.tutorial-grid-compact .tutorial-card p {
    font-size: 0.88rem;
    line-height: 1.5;
}

.tutorial-card-featured {
    min-height: 170px;
}

.tutorial-detail {
    max-width: 920px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.tutorial-back-link {
    color: var(--accent-primary);
    display: inline-block;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-sans);
    margin-bottom: 28px;
}

.tutorial-back-link:hover {
    text-decoration: underline;
}

.tutorial-placeholder {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 28px;
    padding: 28px;
}

.tutorial-placeholder h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.tutorial-placeholder p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.tutorial-placeholder pre {
    background-color: rgba(255, 248, 220, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 18px 0 4px;
    overflow-x: auto;
    padding: 16px;
}

.tutorial-placeholder code {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    white-space: pre;
}

.tutorial-step-list {
    color: var(--text-secondary);
    padding-left: 22px;
}

.tutorial-step-list li {
    margin-bottom: 8px;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 100px 24px;
}

.coming-soon-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.coming-soon h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.coming-soon p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .tutorial-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .download-title {
        font-size: 2.5rem;
    }

    .download-subtitle {
        font-size: 1rem;
    }

    .platform-grid {
        gap: 12px;
    }

    .platform-card {
        padding: 24px 32px;
        min-width: 120px;
    }

    .platform-icon {
        width: 36px;
        height: 36px;
    }

    .btn-download {
        min-width: 280px;
        padding: 14px 32px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .tutorial-hero {
        padding-top: 48px;
    }

    .tutorial-section-header {
        align-items: start;
        flex-direction: column;
        gap: 2px;
    }

    .tutorial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tutorial-grid-compact .tutorial-card {
        min-height: 210px;
        padding: 22px;
    }

    .tutorial-grid-compact .tutorial-number {
        margin-bottom: 28px;
    }

}

@media (max-width: 480px) {
    .platform-grid {
        flex-direction: column;
        align-items: center;
    }

    .platform-card {
        width: 100%;
        max-width: 200px;
    }

    .btn-download {
        width: 100%;
        min-width: auto;
    }

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

    .tutorial-card {
        min-height: 0;
    }
}
