/* =====================================================================
   主题：机甲 / MECHA —— 钢铁装甲 · 战术 HUD · 电光青+警戒橙
   作用域：html[data-theme="mecha"]
   加载顺序：在 style.css / mobile.css / fx.css 之后，确保覆盖
   ===================================================================== */

/* ---------- 1. 设计令牌 ---------- */
html[data-theme="mecha"] {
    /* 主色：电光青 */
    --primary: #00e5ff;
    --primary-2: #1de9b6;
    --primary-dark: #0091ad;
    /* 强调：警戒橙 / 热熔红 */
    --accent: #ffb300;
    --accent-2: #ff5722;
    --success: #1de9b6;
    --warning: #ffb300;
    --info: #00e5ff;

    /* 钢灰色阶 */
    --text: #dbe7ee;
    --text-light: #8596a6;
    --card: rgba(22, 30, 41, 0.86);
    --border: rgba(0, 229, 255, 0.22);
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 26px rgba(0, 229, 255, 0.38);

    --radius: 4px;
    --gradient-primary: linear-gradient(135deg, #00e5ff 0%, #1de9b6 100%);
    --gradient-deep: linear-gradient(135deg, #0091ad 0%, #00e5ff 100%);
    --gradient-accent: linear-gradient(135deg, #ffb300 0%, #ff5722 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 40, 54, 0.92) 0%, rgba(14, 19, 27, 0.92) 100%);

    /* 机甲装甲切角（clip-path） */
    --mecha-clip-sm: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px));
    --mecha-clip: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
    --mecha-clip-lg: polygon(0 22px, 22px 0, calc(100% - 22px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 22px 100%, 0 calc(100% - 22px));
}

/* ---------- 2. 全局背景：钢甲底 + 战术网格 + 扫描线 ---------- */
html[data-theme="mecha"] body {
    background:
        linear-gradient(180deg, rgba(0, 229, 255, 0.05), transparent 30%),
        radial-gradient(1200px 600px at 80% -10%, rgba(0, 229, 255, 0.12), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(255, 87, 34, 0.10), transparent 55%),
        linear-gradient(180deg, #0a0f16 0%, #0e151e 45%, #0a0f16 100%);
    background-attachment: fixed;
    color: var(--text);
}

/* 战术网格叠加（整站） */
html[data-theme="mecha"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

/* 柔和光斑改为青橙双色能量核 */
html[data-theme="mecha"] .blob:nth-child(1) { background: #00e5ff; opacity: 0.22; }
html[data-theme="mecha"] .blob:nth-child(2) { background: #1de9b6; opacity: 0.18; }
html[data-theme="mecha"] .blob:nth-child(3) { background: #ff5722; opacity: 0.14; }
html[data-theme="mecha"] .blob:nth-child(4) { background: #ffb300; opacity: 0.12; }
html[data-theme="mecha"] .blob { filter: blur(90px); }

/* 顶部滚动进度条：能量条 */
html[data-theme="mecha"] .scroll-progress {
    background: linear-gradient(90deg, #00e5ff, #ffb300, #ff5722);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
}

/* ---------- 3. 导航栏：装甲横梁 ----------
   注意：navbar 本身不能用 clip-path，否则会裁掉下钻的下拉菜单
   （.theme-menu / .sub-menu / .nav-user-menu 均为 absolute 向下展开）。
   改为把背景/毛玻璃/切角放到 ::before 伪元素，navbar 自身保持可溢出。 */
html[data-theme="mecha"] .navbar {
    background: transparent;
    clip-path: none;
    position: relative;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.4s ease;
}
html[data-theme="mecha"] .navbar.scrolled {
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 229, 255, 0.15);
}
html[data-theme="mecha"] .navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(12, 18, 26, 0.92), rgba(8, 12, 18, 0.88));
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.35);
    box-shadow: inset 0 -1px 0 rgba(0, 229, 255, 0.15);
    clip-path: var(--mecha-clip-sm);
    transition: background 0.4s ease;
}
html[data-theme="mecha"] .navbar.scrolled::before {
    background: linear-gradient(180deg, rgba(10, 15, 22, 0.97), rgba(6, 10, 15, 0.97));
}
html[data-theme="mecha"] .nav-aurora { display: none; }

html[data-theme="mecha"] .logo {
    background: linear-gradient(135deg, #00e5ff, #1de9b6 60%, #ffb300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
    text-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
}
html[data-theme="mecha"] .logo i {
    background: linear-gradient(135deg, #00e5ff, #ffb300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

/* 导航菜单：切角装甲按钮 */
html[data-theme="mecha"] .nav-menu a {
    color: #b8c6d2;
    border-radius: 0;
    clip-path: var(--mecha-clip-sm);
    background: rgba(0, 229, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.18);
}
html[data-theme="mecha"] .nav-menu a::before { background: linear-gradient(135deg, #00e5ff, #1de9b6); }
html[data-theme="mecha"] .nav-menu a:hover {
    color: #031018;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.25);
    border-color: rgba(0, 229, 255, 0.6);
}
html[data-theme="mecha"] .nav-menu a.active {
    background: linear-gradient(135deg, #00e5ff, #1de9b6);
    color: #031018;
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.6);
    border-color: transparent;
    font-weight: 700;
}

/* 子菜单：下拉装甲舱 */
html[data-theme="mecha"] .navbar .nav-menu .sub-menu {
    background: rgba(10, 16, 24, 0.97);
    border: 1px solid rgba(0, 229, 255, 0.3);
    clip-path: var(--mecha-clip-sm);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 229, 255, 0.18);
}
html[data-theme="mecha"] .navbar .nav-menu .sub-menu a {
    background: transparent;
    border: none;
    color: #c3d0da;
    clip-path: none;
}
html[data-theme="mecha"] .navbar .nav-menu .sub-menu a:hover {
    background: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
    box-shadow: none;
    transform: translateX(2px);
}
html[data-theme="mecha"] .navbar .nav-menu .sub-menu a > i { color: #00b8cc; }

/* 搜索框 */
html[data-theme="mecha"] .search-box input {
    background: rgba(10, 16, 24, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 0;
    clip-path: var(--mecha-clip-sm);
    color: #e6f1f6;
}
html[data-theme="mecha"] .search-box input:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18), 0 0 18px rgba(0, 229, 255, 0.4);
}
html[data-theme="mecha"] .search-box i { color: #00b8cc; }

/* 主题切换按钮 */
html[data-theme="mecha"] .theme-toggle {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    clip-path: var(--mecha-clip-sm);
}
html[data-theme="mecha"] .theme-toggle:hover {
    background: rgba(0, 229, 255, 0.18);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}
html[data-theme="mecha"] .nav-login,
html[data-theme="mecha"] .nav-register {
    clip-path: var(--mecha-clip-sm);
    border: 1px solid rgba(0, 229, 255, 0.3);
}
html[data-theme="mecha"] .nav-register { background: linear-gradient(135deg, #ffb300, #ff5722); color: #1a0d00; border-color: transparent; }

/* ---------- 4. 按钮：装甲战术按键 ---------- */
html[data-theme="mecha"] .btn,
html[data-theme="mecha"] .btn-primary,
html[data-theme="mecha"] .btn-ghost,
html[data-theme="mecha"] .page-btn,
html[data-theme="mecha"] .share-btn {
    border-radius: 0;
    clip-path: var(--mecha-clip-sm);
    letter-spacing: 0.08em;
    font-weight: 700;
}
html[data-theme="mecha"] .btn-primary {
    background: linear-gradient(135deg, #0091ad 0%, #00e5ff 100%);
    color: #021018;
    box-shadow: 0 6px 22px rgba(0, 229, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
html[data-theme="mecha"] .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 229, 255, 0.6), 0 0 24px rgba(29, 233, 182, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
html[data-theme="mecha"] .btn-ghost {
    color: #00e5ff;
    background-image: linear-gradient(rgba(10, 16, 24, 0.85), rgba(10, 16, 24, 0.85)),
        linear-gradient(120deg, #00e5ff, #ffb300, #ff5722);
    border: 1px solid transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
html[data-theme="mecha"] .btn-ghost:hover {
    background-image: linear-gradient(135deg, #00e5ff, #1de9b6), linear-gradient(135deg, #00e5ff, #1de9b6);
    color: #031018;
    box-shadow: 0 10px 28px rgba(0, 229, 255, 0.5);
}

/* 通用小按钮：标签 / 翻页 / 点赞 / 收藏 */
html[data-theme="mecha"] .tag,
html[data-theme="mecha"] .fav-btn,
html[data-theme="mecha"] .moment-like,
html[data-theme="mecha"] .page-btn {
    clip-path: var(--mecha-clip-sm);
    border-radius: 0;
}
html[data-theme="mecha"] .tag {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #7fe9ff;
}
html[data-theme="mecha"] .tag:hover { background: rgba(0, 229, 255, 0.18); color: #00e5ff; }
html[data-theme="mecha"] .fav-btn {
    background: rgba(10, 16, 24, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #b8c6d2;
}
html[data-theme="mecha"] .fav-btn.active {
    background: linear-gradient(135deg, #ffb300, #ff5722);
    color: #1a0d00;
    border-color: transparent;
    box-shadow: 0 0 18px rgba(255, 179, 0, 0.5);
}

/* ---------- 5. 装甲卡片：通用 ---------- */
html[data-theme="mecha"] .article-card,
html[data-theme="mecha"] .widget,
html[data-theme="mecha"] .card,
html[data-theme="mecha"] .quick-card,
html[data-theme="mecha"] .gallery-item,
html[data-theme="mecha"] .shop-card,
html[data-theme="mecha"] .life-moment,
html[data-theme="mecha"] .fav-card,
html[data-theme="mecha"] .fav-item,
html[data-theme="mecha"] .article-detail,
html[data-theme="mecha"] .tool-card,
html[data-theme="mecha"] .love-card,
html[data-theme="mecha"] .stat-card,
html[data-theme="mecha"] .detail-shop-item,
html[data-theme="mecha"] .order-item,
html[data-theme="mecha"] .message-item {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0;
    clip-path: var(--mecha-clip);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--text);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, filter 0.35s ease;
}
/* 卡片顶部装甲高光条 */
html[data-theme="mecha"] .article-card::before,
html[data-theme="mecha"] .widget::before,
html[data-theme="mecha"] .card::before,
html[data-theme="mecha"] .quick-card::before,
html[data-theme="mecha"] .shop-card::before,
html[data-theme="mecha"] .life-moment::before,
html[data-theme="mecha"] .tool-card::before,
html[data-theme="mecha"] .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 14px; right: 14px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00e5ff, #1de9b6, #ffb300, transparent);
    opacity: 0.7;
    pointer-events: none;
}
html[data-theme="mecha"] .article-card:hover,
html[data-theme="mecha"] .quick-card:hover,
html[data-theme="mecha"] .gallery-item:hover,
html[data-theme="mecha"] .shop-card:hover,
html[data-theme="mecha"] .life-moment:hover,
html[data-theme="mecha"] .fav-card:hover,
html[data-theme="mecha"] .tool-card:hover,
html[data-theme="mecha"] .stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 229, 255, 0.6);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 28px rgba(0, 229, 255, 0.28);
    filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.25));
}

/* 卡片四角 HUD 支架（用伪元素叠 L 线） */
html[data-theme="mecha"] .article-card,
html[data-theme="mecha"] .widget,
html[data-theme="mecha"] .shop-card,
html[data-theme="mecha"] .gallery-item { position: relative; }
html[data-theme="mecha"] .article-card::after,
html[data-theme="mecha"] .widget::after,
html[data-theme="mecha"] .shop-card::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(0, 229, 255, 0.08);
    pointer-events: none;
    clip-path: var(--mecha-clip-sm);
}

/* ---------- 6. 标题：HUD 战术标号 ---------- */
html[data-theme="mecha"] .section-title,
html[data-theme="mecha"] .widget-title,
html[data-theme="mecha"] .page-title,
html[data-theme="mecha"] .article-title {
    color: #eaf4f9;
    letter-spacing: 0.03em;
}
html[data-theme="mecha"] .section-title {
    position: relative;
    padding-left: 16px;
}
html[data-theme="mecha"] .section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 22px;
    background: linear-gradient(180deg, #00e5ff, #ffb300);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
}
html[data-theme="mecha"] .widget-title {
    border-bottom: 1px solid rgba(0, 229, 255, 0.25);
    padding-bottom: 10px;
}
html[data-theme="mecha"] .section-title i,
html[data-theme="mecha"] .widget-title i {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

/* 页面头（如随笔页 page-header） */
html[data-theme="mecha"] .page-header {
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(255, 87, 34, 0.1)),
        var(--gradient-card);
    border: 1px solid rgba(0, 229, 255, 0.3);
    clip-path: var(--mecha-clip-lg);
    box-shadow: var(--shadow), inset 0 0 30px rgba(0, 229, 255, 0.08);
}
html[data-theme="mecha"] .page-title { color: #eaf4f9; }
html[data-theme="mecha"] .page-subtitle { color: var(--text-light); }
html[data-theme="mecha"] .moments-stat b { color: #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }

/* ---------- 7. 随笔卡：机甲日记 ---------- */
html[data-theme="mecha"] .moment-panel {
    background: var(--gradient-card) !important;
    border: 1px solid rgba(0, 229, 255, 0.2) !important;
    border-radius: 0 !important;
    clip-path: var(--mecha-clip);
    box-shadow: var(--shadow) !important;
}
html[data-theme="mecha"] .moment-card:hover .moment-panel {
    border-color: rgba(0, 229, 255, 0.55) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 26px rgba(0,229,255,.25) !important;
}
html[data-theme="mecha"] .moment-serial {
    background: linear-gradient(135deg, #00e5ff, #1de9b6) !important;
    color: #031018 !important;
    clip-path: var(--mecha-clip-sm);
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}
html[data-theme="mecha"] .moment-date-day { color: #00e5ff; }
html[data-theme="mecha"] .moment-date-ym,
html[data-theme="mecha"] .moment-date-week { color: var(--text-light); }
html[data-theme="mecha"] .moment-text { color: #d6e3ec; }
html[data-theme="mecha"] .moment-photo {
    clip-path: var(--mecha-clip-sm);
    border: 1px solid rgba(0, 229, 255, 0.25);
}
/* 连接虚线改青色能量流 */
html[data-theme="mecha"] .moments-connectors path { stroke: rgba(0, 229, 255, 0.55); }
html[data-theme="mecha"] .moments-connectors circle.mc-dot { fill: #00e5ff; filter: drop-shadow(0 0 4px rgba(0,229,255,.8)); }

/* ---------- 8. 输入控件 ---------- */
html[data-theme="mecha"] input,
html[data-theme="mecha"] textarea,
html[data-theme="mecha"] select {
    background: rgba(10, 16, 24, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.28);
    border-radius: 0;
    color: #e6f1f6;
    clip-path: var(--mecha-clip-sm);
}
html[data-theme="mecha"] input:focus,
html[data-theme="mecha"] textarea:focus,
html[data-theme="mecha"] select:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18), 0 0 16px rgba(0, 229, 255, 0.35);
    outline: none;
}
html[data-theme="mecha"] input::placeholder,
html[data-theme="mecha"] textarea::placeholder { color: rgba(133, 150, 166, 0.75); }

/* ---------- 9. 底部：装甲底板 ---------- */
html[data-theme="mecha"] .footer {
    background: linear-gradient(180deg, rgba(8, 12, 18, 0.6), rgba(5, 8, 12, 0.95));
    border-top: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text-light);
}
html[data-theme="mecha"] .footer a:hover { color: #00e5ff; }

/* 浮动侧边按钮 */
html[data-theme="mecha"] .side-fab-btn {
    background: rgba(10, 16, 24, 0.92);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    clip-path: var(--mecha-clip-sm);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.2);
}
html[data-theme="mecha"] .side-fab-btn:hover { background: rgba(0, 229, 255, 0.15); box-shadow: 0 0 22px rgba(0, 229, 255, 0.5); }

/* ---------- 10. 主题选择面板（机甲态自身） ---------- */
html[data-theme="mecha"] .theme-menu {
    background: rgba(10, 16, 24, 0.97);
    border: 1px solid rgba(0, 229, 255, 0.4);
    clip-path: var(--mecha-clip-sm);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65), 0 0 26px rgba(0, 229, 255, 0.2);
}
html[data-theme="mecha"] .theme-menu-head { color: #00e5ff; }
html[data-theme="mecha"] .theme-menu-head span { color: var(--text-light); }
html[data-theme="mecha"] .theme-item { border-bottom: 1px solid rgba(0, 229, 255, 0.1); }
html[data-theme="mecha"] .theme-item:hover { background: rgba(0, 229, 255, 0.1); }
html[data-theme="mecha"] .theme-item.active {
    background: rgba(0, 229, 255, 0.14);
    box-shadow: inset 3px 0 0 #00e5ff;
}
html[data-theme="mecha"] .theme-item .theme-meta b { color: #eaf4f9; }
html[data-theme="mecha"] .theme-item .theme-meta em { color: var(--text-light); }

/* ---------- 11. 启动页：机甲启动序列 ---------- */
html[data-theme="mecha"] .splash {
    background: radial-gradient(circle at 50% 50%, #0c1420 0%, #05080d 80%);
}
html[data-theme="mecha"] .splash-emblem-core {
    background: linear-gradient(135deg, #00e5ff, #ffb300);
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.8), 0 0 80px rgba(255, 179, 0, 0.4);
}
html[data-theme="mecha"] .splash-title {
    background: linear-gradient(135deg, #00e5ff, #1de9b6 55%, #ffb300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html[data-theme="mecha"] .splash-percent { color: #00e5ff; }
html[data-theme="mecha"] .splash-bar i { background: linear-gradient(90deg, #00e5ff, #1de9b6, #ffb300); }

/* 加载环 */
html[data-theme="mecha"] .loader-ring { border-color: rgba(0, 229, 255, 0.2); border-top-color: #00e5ff; }

/* ---------- 12. 徽章 / 状态色 ---------- */
html[data-theme="mecha"] .status-badge,
html[data-theme="mecha"] .nav-badge,
html[data-theme="mecha"] .menu-dot { background: linear-gradient(135deg, #ff5722, #ffb300); }
html[data-theme="mecha"] .alert-success { background: rgba(29, 233, 182, 0.12); border-color: rgba(29, 233, 182, 0.4); color: #7ff0ce; }
html[data-theme="mecha"] .alert-error { background: rgba(255, 87, 34, 0.12); border-color: rgba(255, 87, 34, 0.4); color: #ffb088; }

/* 链接主色 */
html[data-theme="mecha"] a { color: #00e5ff; }
html[data-theme="mecha"] a:hover { color: #7fe9ff; }
html[data-theme="mecha"] .article-title:hover,
html[data-theme="mecha"] .hot-title:hover { color: #00e5ff; }
html[data-theme="mecha"] .detail-content strong,
html[data-theme="mecha"] blockquote { border-left-color: #00e5ff; color: #b8c6d2; }

/* ---------- 13. 移动端：保持切角但弱化 ---------- */
@media (max-width: 860px) {
    html[data-theme="mecha"] .article-card,
    html[data-theme="mecha"] .widget,
    html[data-theme="mecha"] .card,
    html[data-theme="mecha"] .moment-panel {
        clip-path: var(--mecha-clip-sm);
    }
    html[data-theme="mecha"] .page-header { clip-path: var(--mecha-clip); }
}

/* =====================================================================
   14. 首页 Hero：机甲战场背景 + HUD 扫描线 + 暗角
   ===================================================================== */
html[data-theme="mecha"] .hero {
    background-image:
        linear-gradient(180deg, rgba(6, 10, 16, 0.52) 0%, rgba(6, 10, 16, 0.38) 36%, rgba(6, 10, 16, 0.82) 100%),
        radial-gradient(ellipse at 50% 122%, rgba(0, 229, 255, 0.26), transparent 60%),
        radial-gradient(ellipse at 85% 20%, rgba(255, 87, 34, 0.14), transparent 55%),
        url('https://qly.x881.cn/boke/uploads/mecha/mecha-hero.jpg') !important;
    background-size: cover;
    background-position: center center;
}

/* 隐藏原有动漫云朵（::before 为第一朵云） */
html[data-theme="mecha"] .hero::before { display: none; }

/* 扫描线 + 暗角（复用 ::after，替换第二朵云） */
html[data-theme="mecha"] .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.06) 0 2px, transparent 2px 4px),
        radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(4, 7, 11, 0.62) 100%);
    mix-blend-mode: screen;
    animation: mechaHeroScan 9s linear infinite;
}
@keyframes mechaHeroScan {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 0 160px, 0 0; }
}

/* 隐藏可爱贴纸与草莓表情，突出机甲主题 */
html[data-theme="mecha"] .emoji-stickers,
html[data-theme="mecha"] .hero-title-emoji { display: none; }

/* Hero 文字在机甲背景上更具战术感 */
html[data-theme="mecha"] .hero-title {
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.45), 0 2px 10px rgba(0, 0, 0, 0.7);
}
html[data-theme="mecha"] .hero-title-accent {
    background: linear-gradient(135deg, #00e5ff, #1de9b6 55%, #ffb300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}
html[data-theme="mecha"] .hero-slogan { color: #b8c6d2; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }

/* 波浪分隔改钢甲深色（原 inline fill 为浅蓝，会冲突） */
html[data-theme="mecha"] .wave-divider svg path { fill: #0a0f16; }

/* =====================================================================
   15. 首页图片：装甲相框 + 能量扫描 + 悬停发光
   ===================================================================== */

/* 精选卡片封面 */
html[data-theme="mecha"] .showcase-card img {
    clip-path: var(--mecha-clip-sm);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}
/* 覆盖原主题 hover 时 scale(2.5) 的过度放大 */
html[data-theme="mecha"] .showcase-card:hover img {
    transform: scale(1.06);
    filter: saturate(1.18) contrast(1.05) drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}
/* 精选卡边框改青色 + 扫光 */
html[data-theme="mecha"] .showcase-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(0, 229, 255, 0.4);
    clip-path: var(--mecha-clip-sm);
    background: linear-gradient(115deg, transparent 28%, rgba(0, 229, 255, 0.28) 47%, rgba(29, 233, 182, 0.22) 53%, transparent 72%);
    background-size: 250% 100%;
    background-position: 200% 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}
html[data-theme="mecha"] .showcase-card:hover::after {
    opacity: 1;
    animation: mechaSweep 1.3s ease forwards;
}

/* 文章封面（background-image 容器） */
html[data-theme="mecha"] .article-cover {
    clip-path: var(--mecha-clip-sm);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08);
    transition: filter 0.4s ease, box-shadow 0.4s ease;
}
html[data-theme="mecha"] .article-card:hover .article-cover {
    filter: saturate(1.16) contrast(1.04) drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.25);
}

/* 作者头像 */
html[data-theme="mecha"] .author-avatar img {
    clip-path: var(--mecha-clip);
    border: 2px solid rgba(0, 229, 255, 0.55);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.4), inset 0 0 12px rgba(0, 229, 255, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
html[data-theme="mecha"] .author-avatar:hover img {
    transform: scale(1.05);
    box-shadow: 0 0 26px rgba(0, 229, 255, 0.6);
}

/* 生活随笔图 & 相册掠影 */
html[data-theme="mecha"] .life-moment-img,
html[data-theme="mecha"] .life-photo {
    border: 1px solid rgba(0, 229, 255, 0.32);
    clip-path: var(--mecha-clip-sm);
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.45);
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
}
html[data-theme="mecha"] .life-moment:hover .life-moment-img,
html[data-theme="mecha"] .life-photo:hover {
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3), 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 229, 255, 0.25);
    filter: saturate(1.12);
}

/* 扫光关键帧（精选卡复用） */
@keyframes mechaSweep {
    0%   { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}

/* =====================================================================
   16. 全局氛围增强：能量扫描带 + 战术网格呼吸
   ===================================================================== */
/* 战术网格呼吸脉动 */
html[data-theme="mecha"] body::before {
    animation: mechaGridPulse 6s ease-in-out infinite;
}
@keyframes mechaGridPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
}
/* 横向流动的能量扫描带（桌面端，覆盖原 body::after 网格层） */
@media (min-width: 821px) {
    html[data-theme="mecha"] body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background:
            linear-gradient(115deg, transparent 0%, transparent 42%, rgba(0, 229, 255, 0.07) 48%, rgba(29, 233, 182, 0.05) 52%, transparent 58%, transparent 100%),
            radial-gradient(ellipse 90% 55% at 50% 118%, rgba(0, 229, 255, 0.10), transparent 70%);
        background-size: 220% 100%, 100% 100%;
        background-position: -60% 0, 0 0;
        animation: mechaEnergySweep 16s linear infinite;
        -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 78%);
        mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 78%);
    }
}
@keyframes mechaEnergySweep {
    0%   { background-position: -60% 0, 0 0; }
    100% { background-position: 160% 0, 0 0; }
}

/* =====================================================================
   17. Hero 增强：HUD 四角取景框 + 战术角标 + 标题辉光呼吸
   ===================================================================== */
/* HUD 四角取景框（复用 ::before 替代原云朵；需重置云朵的尺寸/圆角/阴影） */
html[data-theme="mecha"] .hero::before {
    display: block;
    content: '';
    position: absolute;
    inset: 18px;
    width: auto;
    height: auto;
    z-index: 2;
    pointer-events: none;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.55));
    background:
        linear-gradient(#00e5ff, #00e5ff) top left / 24px 2px no-repeat,
        linear-gradient(#00e5ff, #00e5ff) top left / 2px 24px no-repeat,
        linear-gradient(#00e5ff, #00e5ff) top right / 24px 2px no-repeat,
        linear-gradient(#00e5ff, #00e5ff) top right / 2px 24px no-repeat,
        linear-gradient(#ffb300, #ffb300) bottom left / 24px 2px no-repeat,
        linear-gradient(#ffb300, #ffb300) bottom left / 2px 24px no-repeat,
        linear-gradient(#ffb300, #ffb300) bottom right / 24px 2px no-repeat,
        linear-gradient(#ffb300, #ffb300) bottom right / 2px 24px no-repeat;
    animation: mechaHudBlink 4.5s ease-in-out infinite;
}
@keyframes mechaHudBlink {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.92; }
}

/* 战术角标（hero-content 已有 position:relative / z-index:2） */
html[data-theme="mecha"] .hero-content::before {
    content: '◈ MECHA MODE  ·  机甲系统在线';
    position: absolute;
    left: 50%;
    top: -36px;
    transform: translateX(-50%);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
    white-space: nowrap;
    padding: 4px 14px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    clip-path: var(--mecha-clip-sm);
    background: rgba(6, 10, 16, 0.55);
    pointer-events: none;
    animation: mechaTagGlow 3s ease-in-out infinite;
}
@keyframes mechaTagGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
    50%      { box-shadow: 0 0 18px rgba(0, 229, 255, 0.35), inset 0 0 8px rgba(0, 229, 255, 0.15); }
}

/* 标题辉光呼吸：青↔橙 切换 */
html[data-theme="mecha"] .hero-title {
    animation: mechaTitleGlow 5s ease-in-out infinite;
}
@keyframes mechaTitleGlow {
    0%, 100% { text-shadow: 0 0 24px rgba(0, 229, 255, 0.45), 0 2px 10px rgba(0, 0, 0, 0.7); }
    50%      { text-shadow: 0 0 30px rgba(255, 179, 0, 0.4), 0 0 12px rgba(0, 229, 255, 0.6), 0 2px 10px rgba(0, 0, 0, 0.7); }
}

/* =====================================================================
   18. 卡片悬停：内部能量扫描线
   ===================================================================== */
html[data-theme="mecha"] .article-card:hover::after,
html[data-theme="mecha"] .widget:hover::after,
html[data-theme="mecha"] .shop-card:hover::after {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 255, 0.10) 50%, transparent 100%);
    background-size: 100% 220%;
    animation: mechaCardScan 1.6s linear;
}
@keyframes mechaCardScan {
    0%   { background-position: 0 -120%; }
    100% { background-position: 0 220%; }
}

/* =====================================================================
   19. 导航栏底部能量流光
   ===================================================================== */
html[data-theme="mecha"] .navbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, #00e5ff, #1de9b6, #ffb300, #ff5722, transparent);
    background-size: 200% 100%;
    animation: mechaNavFlow 6s linear infinite;
}
@keyframes mechaNavFlow {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================================
   20. 区块标题：脉冲指示灯
   ===================================================================== */
html[data-theme="mecha"] .section-title::before {
    animation: mechaTitleBarPulse 2.6s ease-in-out infinite;
}
@keyframes mechaTitleBarPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 229, 255, 0.6); opacity: 0.85; }
    50%      { box-shadow: 0 0 18px rgba(0, 229, 255, 0.95), 0 0 5px rgba(255, 179, 0, 0.6); opacity: 1; }
}

/* =====================================================================
   21. 回到顶部按钮：机甲化（保留原环形进度环，仅改外观与发光）
   ===================================================================== */
html[data-theme="mecha"] .back-to-top {
    background: rgba(10, 16, 24, 0.92);
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #00e5ff;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.22);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
html[data-theme="mecha"] .back-to-top:hover {
    background: rgba(0, 229, 255, 0.18);
    color: #7fe9ff;
    box-shadow: 0 0 26px rgba(0, 229, 255, 0.55);
    transform: translateY(-3px);
}

/* ---------- 移动端：弱化角标与取景框，避免窄屏溢出 ---------- */
@media (max-width: 600px) {
    html[data-theme="mecha"] .hero-content::before {
        font-size: 0.58rem;
        letter-spacing: 0.18em;
        top: -28px;
        padding: 3px 10px;
    }
    html[data-theme="mecha"] .hero::before { inset: 12px; }
}

/* 减少动效偏好下关闭扫描/呼吸动画 */
@media (prefers-reduced-motion: reduce) {
    html[data-theme="mecha"] .hero::after,
    html[data-theme="mecha"] .hero::before,
    html[data-theme="mecha"] .hero-content::before,
    html[data-theme="mecha"] .hero-title,
    html[data-theme="mecha"] .showcase-card:hover::after,
    html[data-theme="mecha"] body::before,
    html[data-theme="mecha"] body::after,
    html[data-theme="mecha"] .navbar::after,
    html[data-theme="mecha"] .section-title::before,
    html[data-theme="mecha"] .article-card:hover::after {
        animation: none !important;
    }
}

/* 移动端机甲主题性能优化 */
@media (pointer: coarse), (max-width: 820px) {
    html[data-theme="mecha"] .blob { filter: blur(45px); }
    html[data-theme="mecha"] .navbar::before {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    html[data-theme="mecha"] .hero-title {
        filter: none;
        animation: none;
    }
    html[data-theme="mecha"] .hero::after,
    html[data-theme="mecha"] .hero::before,
    html[data-theme="mecha"] .hero-content::before,
    html[data-theme="mecha"] body::before,
    html[data-theme="mecha"] body::after {
        animation: none;
    }
    html[data-theme="mecha"] .section-title::before,
    html[data-theme="mecha"] .navbar::after {
        animation: none;
    }
    html[data-theme="mecha"] .showcase-card:hover::after,
    html[data-theme="mecha"] .article-card:hover::after {
        animation: none;
    }
    html[data-theme="mecha"] .mecha-card,
    html[data-theme="mecha"] .mecha-panel {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

/* =====================================================================
   机甲拼接模式：精选推荐与生活图墙由同一张主图切分拼接
   悬停时保持位置不动，避免拼图错位
   ===================================================================== */
html[data-theme="mecha"] body.mecha-mosaic-active .showcase-card:hover,
html[data-theme="mecha"] body.mecha-mosaic-active .life-photo:hover {
    transform: none;
}
html[data-theme="mecha"] body.mecha-mosaic-active .showcase-card:hover,
html[data-theme="mecha"] body.mecha-mosaic-active .life-photo:hover {
    box-shadow: 0 18px 42px rgba(0, 229, 255, 0.22), 0 0 0 1px rgba(0, 229, 255, 0.38);
}
html[data-theme="mecha"] body.mecha-mosaic-active .showcase-card,
html[data-theme="mecha"] body.mecha-mosaic-active .life-photo {
    transition: box-shadow 0.35s ease, filter 0.35s ease;
}
