/* ============================================================
   common.css — 共享设计系统
   两个工具页 / 落地页 / SEO 页面共用一份主题与基础组件。
   暗色为默认；[data-theme="light"] 切换亮色。
   ============================================================ */

:root {
    --bg: #0a0e14;
    --surface: #111820;
    --surface-2: #1a2230;
    --surface-3: #222d3d;
    --border: #2a3545;
    --border-hover: #3a4a5f;
    --text: #e0e8f0;
    --text-muted: #5e7085;
    --accent: #00e5a0;
    --accent-dim: #00b87e;
    --accent-glow: rgba(0, 229, 160, 0.12);
    --error: #ff6b6b;
    --error-bg: rgba(255, 107, 107, 0.08);
    --warning: #ffa64d;

    /* 背景氛围光斑 */
    --body-bg-1: rgba(0, 229, 160, 0.04);
    --body-bg-2: rgba(0, 180, 140, 0.03);
    --body-bg-3: rgba(0, 100, 80, 0.02);

    /* 画布网格 */
    --grid-dot: rgba(58, 74, 95, 0.55);
    --grid-color: rgba(42, 53, 69, 0.35);

    --header-height: 56px;
    --status-height: 28px;
}

[data-theme="light"] {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --surface-3: #e4e7ec;
    --border: #d5d9e0;
    --border-hover: #b8bfcb;
    --text: #1a2233;
    --text-muted: #6b7385;
    --accent: #00875a;
    --accent-dim: #006644;
    --accent-glow: rgba(0, 135, 90, 0.10);
    --error: #d32f2f;
    --error-bg: rgba(211, 47, 47, 0.06);
    --warning: #e67a00;

    --body-bg-1: rgba(0, 135, 90, 0.03);
    --body-bg-2: rgba(0, 120, 100, 0.02);
    --body-bg-3: rgba(0, 80, 60, 0.01);

    --grid-dot: rgba(160, 170, 185, 0.45);
    --grid-color: rgba(180, 190, 205, 0.35);
}

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

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 工具页全屏布局 */
body.app-layout {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, var(--body-bg-1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 10%, var(--body-bg-2) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, var(--body-bg-3) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

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

/* ===== 顶栏 ===== */
.top-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.logo:hover { opacity: 1; }

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--bg);
    font-weight: 800;
    flex-shrink: 0;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text-muted);
    background: transparent;
    line-height: 1.4;
}
.btn:hover { color: var(--text); background: var(--surface-2); }
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-accent {
    color: var(--accent);
    border-color: rgba(0, 229, 160, 0.2);
    background: var(--accent-glow);
}
.btn-accent:hover {
    background: rgba(0, 229, 160, 0.18);
    color: var(--accent);
    border-color: rgba(0, 229, 160, 0.35);
}
[data-theme="light"] .btn-accent,
.btn-accent { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.btn-danger {
    color: var(--error);
    border-color: rgba(255, 107, 107, 0.22);
    background: var(--error-bg);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.16); border-color: rgba(255, 107, 107, 0.4); color: var(--error); }

.btn-icon { padding: 5px 7px; font-size: 13px; }

.btn-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.theme-toggle {
    padding: 5px 10px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.theme-toggle:hover { color: var(--accent); background: var(--accent-glow); }

/* ===== 主区域 / 面板 ===== */
.main-area {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.panel { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    min-height: 42px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.panel-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.panel-actions { display: flex; align-items: center; gap: 4px; }

/* ===== 分隔条（可拖拽调整面板宽度） ===== */
.divider {
    width: 5px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}
.divider::after {
    content: '';
    position: absolute;
    left: 1px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border);
    border-radius: 2px;
    transition: all 0.2s;
}
.divider:hover::after,
.divider.active::after {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== 状态栏 ===== */
.status-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--status-height);
    min-height: var(--status-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.status-left, .status-right { display: flex; align-items: center; gap: 16px; }
.status-left span, .status-right span { display: inline-flex; align-items: center; }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    display: inline-block;
    margin-right: 6px;
    transition: all 0.3s;
    flex-shrink: 0;
}
.status-dot.error { background: var(--error); box-shadow: 0 0 6px var(--error); }
.status-dot.rendering { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: dotPulse 0.8s infinite; }

@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== 缩放百分比标签 ===== */
.zoom-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
    font-weight: 500;
}

/* ===== 空状态提示 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    text-align: center;
    pointer-events: none;
}
.empty-state i { font-size: 44px; opacity: 0.3; }
.empty-state p { font-size: 14px; max-width: 280px; line-height: 1.6; }

/* ===== 拖拽/操作提示浮层 ===== */
.drag-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.5s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.drag-hint.hidden { opacity: 0; pointer-events: none; }
.drag-hint i { color: var(--accent); font-size: 12px; }
.drag-hint kbd {
    display: inline-block;
    background: var(--surface-3);
    border: 1px solid var(--border-hover);
    border-radius: 3px;
    padding: 0 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text);
    line-height: 18px;
}

/* ===== Toast 通知 ===== */
#toastContainer {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { background: var(--accent-glow); border: 1px solid var(--accent); color: var(--accent); }
.toast-error { background: var(--error-bg); border: 1px solid var(--error); color: var(--error); }
.toast-info { background: var(--surface-2); border: 1px solid var(--border-hover); color: var(--text-muted); }

/* ===== 落地页 / 营销页通用组件 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-header .nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.site-header nav a:hover { color: var(--text); opacity: 1; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; width: 100%; }

.section { padding: 72px 0; position: relative; }
.section-title { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; text-align: center; }
.section-subtitle {
    text-align: center; color: var(--text-muted); font-size: 16px;
    max-width: 640px; margin: 12px auto 0; line-height: 1.7;
}

/* Hero */
.hero { padding: 84px 0 64px; text-align: center; }
.hero h1 {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.1;
    margin: 0 auto;
    max-width: 880px;
}
.hero .hero-en {
    display: block;
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 0;
}
.hero p.hero-desc {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-muted);
    max-width: 660px;
    margin: 24px auto 0;
    line-height: 1.7;
}
.hero .cta-group { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }

.btn-lg {
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    border: none;
}
.btn-lg:hover { color: var(--bg); opacity: 0.92; transform: translateY(-1px); box-shadow: 0 10px 30px var(--accent-glow); }
.btn-lg.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-hover);
}
.btn-lg.btn-outline:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }

/* 工具卡片网格 */
.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin-top: 48px;
}
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}
.tool-card:hover { border-color: var(--accent); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18); transform: translateY(-4px); }
.tool-card .card-icon {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--accent-glow); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    margin-bottom: 20px;
}
.tool-card h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 6px; }
.tool-card .card-en { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.tool-card p.card-desc { color: var(--text-muted); font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
.tool-card ul.feature-list { list-style: none; margin-bottom: 24px; display: grid; gap: 9px; }
.tool-card ul.feature-list li {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 14px; color: var(--text);
}
.tool-card ul.feature-list li i { color: var(--accent); font-size: 13px; margin-top: 4px; }
.tool-card .card-link { margin-top: auto; font-weight: 600; font-size: 15px; }

/* 特性区 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 48px;
}
.feature-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 26px;
}
.feature-item .feat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--accent-glow); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 16px;
}
.feature-item h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-item p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* FAQ */
.faq-list { max-width: 820px; margin: 40px auto 0; display: grid; gap: 12px; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.faq-item summary {
    padding: 18px 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i { color: var(--accent); transition: transform 0.2s; flex-shrink: 0; }
.faq-item[open] summary i { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 22px 18px; color: var(--text-muted); font-size: 15px; line-height: 1.8; }

/* CTA 条 */
.cta-band {
    margin: 24px 0;
    padding: 48px 32px;
    border-radius: 20px;
    text-align: center;
    background:
        radial-gradient(ellipse 80% 120% at 50% 0%, var(--accent-glow), transparent 70%),
        var(--surface);
    border: 1px solid var(--border);
}
.cta-band h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.cta-band p { color: var(--text-muted); margin: 12px auto 26px; max-width: 520px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 32px;
    color: var(--text-muted);
    font-size: 14px;
}
.site-footer .footer-inner {
    display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.site-footer .footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .tool-grid-2 { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .site-header nav a.nav-link { display: none; }
    .section { padding: 56px 0; }
    .hero { padding: 56px 0 40px; }
    .btn span.btn-label { display: none; }
    .top-bar { padding: 0 12px; }
    .logo span { display: none; }
    .drag-hint { font-size: 10px; padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
