/* ============================================================
   ICMaster 站点样式
   约定：能用 MudBlazor 工具类（间距 / flex / 颜色等）的场合，
   不在此新增样式；此处只收录 MudBlazor 工具类无法覆盖的样式
   （渐变、背景纹理、伪元素、等宽字体栈、悬浮动效等）。
   ============================================================ */

/* ------------------------------------------------------------
   0. 设计令牌
   ------------------------------------------------------------ */
:root {
    --ic-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'SFMono-Regular', 'Liberation Mono', monospace;

    /* 品牌渐变与墨色面板（不随主题切换，Hero / Console 固定深色） */
    --ic-ink: #0d1b2e;
    --ic-ink-2: #12294a;
    --ic-ink-3: #1d3f74;
    --ic-amber: #f0a92b;

    /* 卡片悬浮阴影 */
    --ic-lift-shadow: 0 14px 32px -14px rgba(15, 23, 42, .28), 0 2px 6px -2px rgba(15, 23, 42, .10);
}

html[data-icmaster-dark='true'] {
    /* ---- 防闪烁背景：与 ICMasterTheme.DarkBackground 保持一致 ---- */
    background-color: #0b0e14;
    --ic-lift-shadow: 0 14px 32px -14px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------
   1. 首屏墨色面板（Hero）：网格纹理 + 径向光晕 + 渐变文字
   ------------------------------------------------------------ */
.hero-panel {
    position: relative;
    overflow: hidden;
    color: #eaf1fb;
    background: linear-gradient(140deg, var(--ic-ink) 0%, var(--ic-ink-2) 48%, var(--ic-ink-3) 100%);
}

html[data-icmaster-dark='true'] .hero-panel {
    background: linear-gradient(140deg, #070a10 0%, #0b1220 50%, #10203a 100%);
}

/* 细网格纹理：营造仪器面板 / 坐标纸质感 */
.hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(160deg, #000 0%, rgba(0, 0, 0, .35) 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(160deg, #000 0%, rgba(0, 0, 0, .35) 60%, transparent 100%);
}

/* 径向光晕：右上主色、左下琥珀色 */
.hero-glow-a,
.hero-glow-b {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(8px);
}

.hero-glow-a {
    right: -140px;
    top: -160px;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(90, 159, 255, .40) 0%, rgba(90, 159, 255, 0) 68%);
}

.hero-glow-b {
    left: -120px;
    bottom: -180px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(240, 169, 43, .22) 0%, rgba(240, 169, 43, 0) 70%);
}

/* 面板内所有内容需在纹理之上 */
.hero-body {
    position: relative;
    z-index: 1;
}

.hero-title {
    background: linear-gradient(100deg, #ffffff 0%, #d8e7ff 55%, var(--ic-amber) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* 首屏主标题：视觉重心，随视口缩放，避免大屏上显得单薄 */
    font-size: clamp(2.1rem, 4.2vw, 3rem);
    line-height: 1.14;
    letter-spacing: -.02em;
}

.hero-lead {
    color: rgba(226, 236, 250, .82);
}

/* 首屏分隔线：覆盖 MudDivider 的默认主题色，保证在墨色面板上可见 */
.hero-panel .hero-rule {
    border-color: rgba(255, 255, 255, .14);
}

/* 顶栏：与内容区之间用一条细分割线收边，替代阴影 */
.appbar-shell {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* 侧栏分组小标签 */
.nav-group-label {
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
}

/* 侧栏计数徽标：压缩高度，避免撑开导航项 */
.nav-count-chip {
    height: 20px !important;
    font-size: .7rem !important;
}

.nav-count-chip .mud-chip-content {
    padding: 0 6px;
}

/* ------------------------------------------------------------
   2. 控制台卡片：模拟软件彩色收发日志
   ------------------------------------------------------------ */
.console-card {
    background: rgba(6, 11, 20, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    overflow: hidden;
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.console-line {
    font-family: var(--ic-mono);
    font-size: .78rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 日志着色：状态黑 / 发送蓝 / 接收绿 / 错误红（与软件一致） */
.l-sys { color: #9fb0c6; }
.l-tx  { color: #6cb6ff; }
.l-rx  { color: #56d364; }
.l-err { color: #ff7b72; }

/* ------------------------------------------------------------
   3. 通用视觉组件
   ------------------------------------------------------------ */

/* 小节引导标签（首屏与分节标题上方的小号彩色标签） */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mud-palette-primary);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

/* 图标砖：插件卡片 / 特性卡片的方形渐变图标容器。
   渐变写死品牌深蓝，不引用 --mud-palette-primary/secondary——
   暗色主题下这两个变量会变成浅蓝，白图标将失去对比度。 */
.icon-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(140deg, #2a72d4, #12447f);
    box-shadow: 0 6px 14px -8px rgba(18, 68, 127, .7);
}

.icon-tile-lg {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

/* 品牌标识：包住 img，用浅色底衬托以便任意主题下都可识别 */
.brand-icon-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    box-shadow: 0 2px 8px -4px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .06);
}

html[data-icmaster-dark='true'] .brand-icon-tile {
    background: #ffffff;
    box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
}

/* AppBar 下载按钮：主色实心 + 白色文字，两套主题下都极高对比 */
.appbar-download-btn {
    background-color: var(--mud-palette-primary) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px -4px rgba(29, 95, 191, .55) !important;
}

.appbar-download-btn:hover {
    filter: brightness(1.08);
}

/* 墨色面板（hero-panel）上的主要按钮：
   默认 Filled Primary 在深色面板上几乎不可见（蓝色背景接近面板色），
   强制改为白底深蓝字，保证高对比 */
.hero-panel .mud-button-filled.mud-button-filled-primary,
.hero-panel .btn-primary-on-dark {
    background-color: #ffffff !important;
    color: var(--mud-palette-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .55) !important;
}

.hero-panel .mud-button-filled.mud-button-filled-primary:hover {
    background-color: #f0f4fb !important;
}

/* 墨色面板上的次要按钮：边框与文字完全不透明的纯白 */
.hero-panel .mud-button-outlined {
    border-color: rgba(255, 255, 255, .85) !important;
    color: #ffffff !important;
    border-width: 2px !important;
}

.hero-panel .mud-button-outlined:hover {
    background-color: rgba(255, 255, 255, .10) !important;
    border-color: #ffffff !important;
}

/* 渐变 CTA 横幅上的主按钮：强制白底 + 深色文字，两套主题下都高对比 */
.cta-gradient .cta-primary-btn {
    background-color: #ffffff !important;
    color: var(--mud-palette-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .55) !important;
}

.cta-gradient .cta-primary-btn:hover {
    background-color: #f0f4fb !important;
}

/* 渐变 CTA 横幅上的次要按钮：纯白边框 + 纯白文字，hover 时填充白底 */
.cta-gradient .cta-secondary-btn {
    border-color: #ffffff !important;
    border-width: 2px !important;
    color: #ffffff !important;
    background-color: transparent !important;
}

.cta-gradient .cta-secondary-btn:hover {
    background-color: rgba(255, 255, 255, .15) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* 墨色面板（hero-panel / cta-gradient）上的胶囊标签：
   加强背景与边框透明度，避免在深色背景上几乎隐形 */
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .32);
    background: rgba(255, 255, 255, .12);
    color: #eaf1fb;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .10);
    color: #eaf1fb;
    font-size: .75rem;
}

/* 可悬浮抬升的卡片：用于插件卡片与内容卡片 */
.ic-lift {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ic-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--ic-lift-shadow);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 42%, transparent);
}

/* 左侧主色强调块：用于「缘起 / 由来 / 版本说明」这类叙事段落，
   加一层极淡主色底把它从普通卡片里区分出来。 */
.accent-block {
    border-left: 4px solid var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
}

/* 淡色底板：用于把一段内容从页面背景中托起 */
.soft-panel {
    background: color-mix(in srgb, var(--mud-palette-primary) 5%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 16%, transparent);
}

html[data-icmaster-dark='true'] .soft-panel {
    background: color-mix(in srgb, var(--mud-palette-primary) 9%, var(--mud-palette-surface));
    border-color: color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
}

/* 渐变 CTA 横幅。
   渐变写死品牌深蓝：横幅内始终是白字与白底按钮，
   若跟随主题变量，暗色模式下主色变浅蓝，白字与白按钮都会失去对比度。 */
.cta-gradient {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #0f3e7e, #1d5fbf 55%, #0e7490);
    color: #fff;
    text-align: center;
}

.cta-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .10) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(120deg, #000, transparent 85%);
    -webkit-mask-image: linear-gradient(120deg, #000, transparent 85%);
}

/* CTA 横幅内容层：压在网格纹理之上（MudBlazor 的 .d-flex 自带 !important，不受影响） */
.cta-body {
    position: relative;
    z-index: 1;
}

/* 等宽字体：报文、参数、字段等技术内容 */
.mono { font-family: var(--ic-mono); }

/* 行内键帽：界面上的按钮 / 参数名 */
.kbd {
    font-family: var(--ic-mono);
    font-size: .8em;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 6%, transparent);
}

/* 行高（MudBlazor 无对应工具类） */
.lh-18 { line-height: 1.8; }
.lh-19 { line-height: 1.9; }
.lh-2  { line-height: 2; }

/* 字重（MudBlazor 无对应工具类） */
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* 透明度（MudBlazor 无对应工具类） */
.opacity-50 { opacity: .5; }
.opacity-70 { opacity: .7; }
.opacity-85 { opacity: .85; }

/* 统计大数字 */
.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

/* 全高容器 */
.min-vh-100 { min-height: 100vh; }

/* 最大宽度限制（正文可读性） */
.maxw-520 { max-width: 520px; }
.maxw-780 { max-width: 780px; }
.maxw-820 { max-width: 820px; }

/* ------------------------------------------------------------
   4. 界面截图画廊与占位画布
   ------------------------------------------------------------ */

/* 截图占位画布（虚线边框 + 渐变底） */
.placeholder-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-style: dashed;
    border-width: 2px;
    border-color: var(--mud-palette-lines-default);
    background: linear-gradient(160deg, var(--mud-palette-surface) 0%, transparent 100%);
}

.screenshot-frame  { display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--mud-palette-background); }
.screenshot-main   { width: 100%; max-height: 460px; cursor: zoom-in; }
.screenshot-thumb-frame { width: 96px; height: 60px; overflow: hidden; cursor: pointer; flex-shrink: 0; }
.screenshot-thumb  { width: 100%; height: 100%; display: block; border-radius: 4px; }
.screenshot-thumb-active { box-shadow: 0 0 0 2px var(--mud-palette-primary); }

/* ------------------------------------------------------------
   5. 页脚
   ------------------------------------------------------------ */
.footer {
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* 页脚二维码卡片：白底保证扫码识别，圆角细边框与全站一致 */
.footer-qr {
    width: 92px;
    height: 92px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--mud-palette-lines-default);
    background: #fff;
}

/* 页脚公网安备图标：与正文同高、保持原生宽高比 */
.footer-beian-icon {
    height: 14px;
    width: auto;
}

/* ------------------------------------------------------------
   6. Blazor 框架保留样式
   ------------------------------------------------------------ */

/* Blazor 错误提示条（WASM 运行时未处理异常时显示） */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
