:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-2: #7c3aed;
    --ink: #0f172a;
    --muted: #64748b;
    --bg: #f5f7fb;
    --card: #ffffff;
    --line: #e6eaf2;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
    line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
img, video { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ── header ── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand-mark { font-size: 24px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--brand); }
.site-nav .nav-admin { color: var(--muted); font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; }

/* ── hero ── */
.hero {
    background: radial-gradient(1200px 400px at 20% -10%, #dbeafe 0%, transparent 60%),
                radial-gradient(900px 400px at 100% 0%, #ede9fe 0%, transparent 55%),
                linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    padding: 64px 0 56px;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero-badge {
    display: inline-block; font-size: 13px; font-weight: 600; color: var(--brand);
    background: #e0e7ff; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero-text h1 { font-size: 44px; line-height: 1.15; letter-spacing: -.5px; }
.hero-text p { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art {
    font-size: 150px; line-height: 1;
    filter: drop-shadow(0 20px 40px rgba(37, 99, 235, .25));
    animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ── buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 22px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); font-size: 15px; font-weight: 500;
    cursor: pointer; transition: all .2s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ── sections ── */
.section { padding: 56px 0 72px; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.page-head { padding: 44px 0 24px; }
.page-head h1 { font-size: 32px; }
.page-head p { color: var(--muted); margin-top: 8px; }

/* ── product grid ── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
    color: var(--ink); display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15, 23, 42, .14); }
.product-cover {
    aspect-ratio: 16 / 10; background: linear-gradient(135deg, #dbeafe, #ede9fe);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-cover img, .product-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { font-size: 64px; }
.product-body { padding: 18px 20px 22px; }
.product-body h3 { font-size: 19px; }
.tagline { color: var(--brand); font-size: 14px; margin-top: 4px; font-weight: 500; }
.summary { color: var(--muted); font-size: 14px; margin-top: 8px; }
.more { display: inline-block; margin-top: 14px; color: var(--brand); font-size: 14px; font-weight: 600; }

/* ── product detail ── */
.product-detail { padding-bottom: 64px; }
.breadcrumb { padding: 24px 0 8px; font-size: 14px; color: var(--muted); }
.breadcrumb a { color: var(--brand); }
.pd-top { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 20px 0 32px; align-items: center; }
.pd-cover {
    border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.pd-cover img, .pd-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-version {
    display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
    background: #ecfdf5; color: #065f46; font-size: 14px;
}
.pd-info h1 { font-size: 36px; }
.pd-tagline { color: var(--brand); font-size: 17px; margin-top: 8px; font-weight: 600; }
.pd-summary { color: var(--muted); margin-top: 14px; font-size: 16px; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.rich-content {
    background: var(--card); border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow); margin-bottom: 32px;
}
.rich-content h1, .rich-content h2, .rich-content h3 { margin: 22px 0 12px; line-height: 1.3; }
.rich-content h1:first-child, .rich-content h2:first-child, .rich-content h3:first-child { margin-top: 0; }
.rich-content p { margin: 12px 0; }
.rich-content ul, .rich-content ol { margin: 12px 0; padding-left: 24px; }
.rich-content img, .rich-content video { border-radius: 10px; margin: 14px 0; }
.rich-content a { text-decoration: underline; }

.pd-gallery { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.pd-gallery h2 { font-size: 22px; margin-bottom: 18px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gallery-item { border-radius: 12px; overflow: hidden; background: #f1f5f9; }
.gallery-item img, .gallery-item video { width: 100%; height: 170px; object-fit: cover; }
.gallery-item figcaption { padding: 8px 12px; font-size: 13px; color: var(--muted); }

/* 详情内嵌图片/视频：直接作为详情内容，不再单独成章 */
.detail-media { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.detail-media-item {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); margin: 0;
}
.detail-media-item img, .detail-media-item video { width: 100%; display: block; }
.detail-media-item figcaption { padding: 10px 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ── firmware versions ── */
.fw-versions {
    background: var(--card); border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow); margin-bottom: 32px;
}
.fw-versions h2 { font-size: 22px; margin-bottom: 16px; }
.version-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.version-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.version-notes { margin-top: 8px; font-size: 14px; }
.version-parts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #e5e7eb; color: #374151; }
.pill-ok { background: #d1fae5; color: #065f46; }
.pill-muted { background: #f1f5f9; color: #64748b; }

/* ── 3D viewer ── */
.pd-3d {
    background: var(--card); border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow); margin-bottom: 32px;
}
.pd-3d-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-3d-head h2 { font-size: 22px; }
.pd-3d-head .muted { font-size: 13px; }
.model-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.model-tab {
    padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; cursor: pointer; font-size: 14px; color: var(--ink);
}
.model-tab:hover { border-color: var(--brand); color: var(--brand); }
.model-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.model-stage model-viewer {
    width: 100%; height: 480px; border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}
.model-caption { margin-top: 10px; font-size: 13px; }
.model-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }

/* ── downloads ── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.filter-bar select, .filter-bar input {
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; font-size: 14px; min-width: 150px;
}
.dl-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 64px; }
.dl-item {
    display: flex; align-items: center; gap: 18px;
    background: var(--card); border-radius: var(--radius); padding: 18px 22px;
    box-shadow: var(--shadow);
}
.dl-icon {
    flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.dl-main { flex: 1; min-width: 0; }
.dl-main h3 { font-size: 17px; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.chip { background: #eef2ff; color: var(--brand); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.dl-desc { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ── upgrade ── */
.notice {
    background: #eff6ff; border: 1px solid #dbeafe; border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 28px;
}
.notice strong { display: block; margin-bottom: 8px; }
.notice ol { padding-left: 20px; color: var(--muted); }
.notice li { margin: 4px 0; }
.fw-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 64px; }
.fw-card {
    display: flex; gap: 22px; align-items: center;
    background: var(--card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow);
}
.fw-cover {
    flex: 0 0 auto; width: 120px; height: 90px; border-radius: 12px; overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    display: flex; align-items: center; justify-content: center;
}
.fw-cover img { width: 100%; height: 100%; object-fit: cover; }
.fw-body { flex: 1; min-width: 0; }
.fw-body h3 { font-size: 19px; margin-bottom: 6px; }
.fw-notes { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
esp-web-install-button { --esp-tools-button-color: var(--brand); --esp-tools-button-border-radius: 10px; }

/* ── custom flasher ── */
.flash-console {
    background: var(--card); border-radius: var(--radius); padding: 26px;
    box-shadow: var(--shadow); margin-bottom: 30px;
}
.flash-console h2 { font-size: 22px; }
.flash-console > p { margin-top: 6px; }
.flash-tabs { display: flex; gap: 8px; margin: 18px 0 16px; flex-wrap: wrap; }
.flash-tab {
    padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; transition: all .2s;
}
.flash-tab:hover { border-color: var(--brand); color: var(--brand); }
.flash-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.flash-panel.hidden { display: none; }
.flash-console label { display: block; margin-bottom: 14px; font-size: 14px; color: #374151; }
.flash-console input[type="text"], .flash-console select {
    width: 100%; padding: 9px 12px; margin-top: 5px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 14px; background: #fff;
}
.file-drop {
    border: 1.5px dashed #c7d2fe; border-radius: 12px; padding: 20px; text-align: center;
    background: #f8faff; cursor: pointer; margin-bottom: 16px !important;
}
.file-drop input[type="file"] { margin-top: 10px; }
.flash-row { display: flex; gap: 14px; flex-wrap: wrap; }
.flash-row label { flex: 1; min-width: 150px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.flash-action { margin-top: 8px; }
.flash-status { margin: 14px 0 12px; font-size: 14px; }
.flash-status.ok { color: #065f46; }
.custom-flasher[hidden] { display: none; }
.section-sub { font-size: 22px; margin: 8px 0 16px; }

/* ── footer ── */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 14px; }

.center-box { text-align: center; padding: 90px 20px; }
.big-emoji { font-size: 72px; margin-bottom: 12px; }
.center-box h1 { font-size: 30px; margin-bottom: 10px; }
.center-box .btn { margin-top: 22px; }

@media (max-width: 760px) {
    .site-nav { gap: 14px; }
    .site-nav a { font-size: 14px; }
    .hero { padding: 40px 0 36px; }
    .hero-inner { flex-direction: column; text-align: center; gap: 20px; }
    .hero-text h1 { font-size: 32px; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-art { font-size: 96px; }
    .pd-top { grid-template-columns: 1fr; gap: 22px; }
    .pd-info h1 { font-size: 28px; }
    .rich-content { padding: 20px; }
    .pd-gallery { padding: 20px; }
    .dl-item { flex-wrap: wrap; }
    .dl-item .btn { width: 100%; }
    .fw-card { flex-direction: column; align-items: flex-start; }
    .fw-cover { width: 100%; height: 140px; }
    .section-head h2 { font-size: 24px; }
    .page-head h1 { font-size: 26px; }
}

@media (max-width: 420px) {
    .site-nav { gap: 10px; }
    .site-nav a { font-size: 13px; }
    .container { padding: 0 14px; }
}
