/* ============================================================
   热土引擎 REngine 主页（Bento Grid 风格）
   参考 bento-grid.html 的视觉体系，主色沿用项目蓝 #0686b1
   ============================================================ */

:root {
    /* 主题 */
    --theme-primary: #0686b1;
    --theme-primary-hover: #056a8c;

    /* 颜色 */
    --bg-body: #f5f5f7;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: #e5e7eb;
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(6, 134, 177, 0.3);

    --font-display: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-display);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

/* Material Symbols 图标修复 */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    width: 1em;
    height: 1em;
    overflow: hidden;
}

/* ---------- 布局工具类 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* md-flex：默认隐藏（移动端无顶栏导航），≥768px 显示 */
.md-flex { display: none; }
@media (min-width: 768px) {
    .md-flex { display: flex; }
    .md-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Header ---------- */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-box {
    width: 32px;
    height: 32px;
    background-color: var(--theme-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 9999px;
    padding: 3px 9px;
}

.topnav { justify-content: center; flex: 1; }

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text-main); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--theme-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    height: 36px;
    padding: 0 16px;
    border-radius: 9999px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn-primary:hover {
    background-color: var(--theme-primary-hover);
    box-shadow: var(--shadow-glow);
}

/* ---------- Hero ---------- */
.hero {
    padding-top: 120px;
    padding-bottom: 80px;
    overflow: hidden;
    position: relative;
    text-align: center;
}
@media (min-width: 768px) {
    .hero { padding-top: 176px; padding-bottom: 112px; }
}

.hero-content { position: relative; z-index: 2; }

.blob {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 130%;
    background: radial-gradient(circle at center,
        rgba(6, 134, 177, 0.14),
        rgba(147, 51, 234, 0.10),
        transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    pointer-events: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 9999px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--theme-primary);
    animation: pulse 2s infinite;
}

h1.display-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin-bottom: 24px;
}
@media (min-width: 768px) {
    h1.display-title { font-size: 4rem; }
}

.text-gradient {
    background: linear-gradient(to right, var(--theme-primary), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 38rem;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-actions { justify-content: center; flex-wrap: wrap; }

.btn-large {
    height: 48px;
    padding: 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.btn-large:hover { transform: translateY(-2px); }

.btn-outline {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background-color: #f9fafb;
    box-shadow: var(--shadow-soft);
}

/* ---------- Section 通用 ---------- */
.section { padding: 96px 0; }

.section-head {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 4rem;
}
.section-head h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.section-head p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}
@media (max-width: 640px) {
    .section-head h2 { font-size: 1.75rem; }
}

/* ---------- Bento Grid ---------- */
.bento-section { padding: 96px 0; }

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
    gap: 24px;
}
@media (min-width: 768px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento-grid { grid-template-columns: repeat(4, 1fr); } }

.bento-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.bento-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

/* 大板块内边距容器 */
.bento-pad {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* 与 .flex 同用时保持横向布局（统一身份卡 / MCP 横条） */
.bento-pad.flex { flex-direction: row; }

/* 嵌套图标字号继承修正 */
.watermark-icon .material-symbols-outlined { font-size: 72px; }
.ai-icons .material-symbols-outlined { font-size: 32px; }

/* 跨格 */
.span-2-row { grid-row: span 2; }
.span-2-col { grid-column: span 1; }
@media (min-width: 768px) {
    .span-2-col { grid-column: span 2; }
    .span-3-col { grid-column: span 2; }
}
@media (min-width: 1024px) {
    .span-3-col { grid-column: span 3; }
}

/* 图标块 */
.icon-tile {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.tile-primary {
    background: var(--theme-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(6, 134, 177, 0.3);
}
.tile-green  { background: rgba(22, 163, 74, 0.1);  color: #16a34a; }
.tile-purple { background: rgba(147, 51, 234, 0.1); color: #9333ea; }
.tile-orange { background: rgba(178, 80, 0, 0.1);   color: #b25000; }
.tile-teal   { background: rgba(13, 148, 136, 0.1); color: #0d9488; }

.tile-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}
.bento-pad .tile-title { font-size: 1.5rem; }

.tile-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 22rem;
    line-height: 1.6;
}

.tile-desc-sm {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.6;
}

.tile-desc-dark {
    color: #999;
    font-size: 0.75rem;
    line-height: 1.6;
}

/* 黑底特色卡（软件激活） */
.card-dark {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.dark-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #facc15;
    margin-bottom: 1rem;
}

/* MCP 横条 */
.card-accent {
    background: linear-gradient(to right, rgba(6, 134, 177, 0.08), rgba(96, 165, 250, 0.06));
    border-color: rgba(6, 134, 177, 0.25);
}

.ai-icons { color: var(--theme-primary); opacity: 0.55; font-size: 32px; }

/* 大水印图标（统一身份卡右侧） */
.watermark-icon {
    font-size: 72px;
    opacity: 0.08;
    transform: rotate(12deg);
    flex-shrink: 0;
}

/* ---------- 站点导航板块 ---------- */
.site-list {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 1rem;
}

.site-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.site-item:hover {
    transform: translateX(4px);
    border-color: rgba(6, 134, 177, 0.4);
    box-shadow: var(--shadow-soft);
}

.site-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-blue   { background: rgba(6, 134, 177, 0.12);  color: #0686b1; }
.icon-green  { background: rgba(22, 163, 74, 0.12);  color: #16a34a; }
.icon-orange { background: rgba(178, 80, 0, 0.12);   color: #b25000; }
.icon-purple { background: rgba(147, 51, 234, 0.12); color: #9333ea; }

.site-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}
.site-name em {
    font-style: normal;
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-left: 6px;
}

.site-host {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-arrow {
    margin-left: auto;
    font-size: 18px;
    color: var(--text-secondary);
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
}
.site-item:hover .site-arrow {
    color: var(--theme-primary);
    transform: translateX(3px);
}

/* ---------- Workflow ---------- */
.workflow-step {
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.workflow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.3s;
}
.workflow-step:hover .step-icon { transform: scale(1.1); }

.workflow-step h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.workflow-step p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
}

/* ---------- Metrics ---------- */
.metrics-band {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    text-align: center;
}
@media (min-width: 768px) {
    .metrics-grid { grid-template-columns: repeat(4, 1fr); }
    .metrics-item:not(:last-child) { border-right: 1px solid var(--border-color); }
}

.metric-val {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 8px;
    color: var(--text-main);
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */
footer {
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
    padding-top: 64px;
    padding-bottom: 40px;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 36rem;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 1.5rem;
}
.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--theme-primary); }

.footer-top { margin-bottom: 56px; }

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.sys-ok {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ok-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: pulse 2s infinite;
}

/* ---------- 动画 ---------- */
@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.4); }

/* ---------- 移动端微调 ---------- */
@media (max-width: 640px) {
    .bento-section,
    .section { padding: 64px 0; }

    .bento-grid {
        grid-auto-rows: minmax(200px, auto);
        gap: 16px;
    }

    /* 站点导航大卡在移动端自适应高度 */
    .span-2-row { grid-row: span 1; }

    .bento-card { border-radius: 20px; }
    .bento-pad { padding: 0; }
    .bento-pad .tile-title { font-size: 1.25rem; }

    .workflow-step { padding: 24px; }

    .metrics-band { padding: 56px 0; }
    .metric-val { font-size: 2rem; }
}
