/* NetTools 全局组件样式。
   所有颜色来自 theme.css 的设计令牌，此处不出现十六进制色值。 */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-page);
}

body {
    transition: background var(--t), color var(--t);
}

h1:focus {
    outline: none;
}

h1 {
    font-size: 1.4rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin: 0 0 0.35rem;
}

.page-desc {
    color: var(--text-2);
    margin: 0 0 1.35rem;
    font-size: 0.9rem;
}

/* ---------- 图标 ---------- */

.icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- 侧边导航条目 ----------
   注意：这些规则必须放在全局样式表中。NavLink 渲染出的 <a> 只带
   NavLink 自身的属性，不会获得 NavMenu.razor.css 的 scope 属性，
   因此 scoped 文件中的 .nav-item 规则会被浏览器直接丢弃。 */

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--t), color var(--t);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 500;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -0.7rem;
    top: 50%;
    width: 3px;
    height: 16px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
    transform: translateY(-50%);
}

/* ---------- 顶栏分类栏与弹出菜单 ----------
   与导航条目同理，必须放在全局样式表：CategoryTabs 渲染出的 <a> 不带任何
   scoped 属性，scoped 文件里的规则会被浏览器直接丢弃。 */

.catbar {
    flex-shrink: 0;
    padding: 0 1.75rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.cat-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
    max-width: 1180px;
}

.cat-tab {
    position: relative;
}

.cat-tab-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 40px;
    padding: 0 0.8rem;
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color var(--t), border-color var(--t);
}

.cat-tab:hover .cat-tab-link,
.cat-tab:focus-within .cat-tab-link {
    color: var(--text);
}

.cat-tab.active .cat-tab-link {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.cat-tab-link .nav-icon {
    color: var(--text-3);
}

.cat-tab.active .cat-tab-link .nav-icon {
    color: var(--brand);
}

/* 弹出层：鼠标悬浮与键盘聚焦都能展开，不依赖 JS。 */
.cat-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 25;
    display: none;
    min-width: 260px;
    padding: 0.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.cat-tab:hover .cat-menu,
.cat-tab:focus-within .cat-menu {
    display: block;
}

.cat-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background var(--t);
}

.cat-menu-item:hover {
    background: var(--bg-hover);
}

.cat-menu-item .nav-icon {
    margin-top: 0.15rem;
    color: var(--brand);
}

.cat-menu-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cat-menu-text strong {
    font-size: 0.88rem;
    font-weight: 600;
}

.cat-menu-text small {
    font-size: 0.78rem;
    line-height: 1.35;
    color: color-mix(in srgb, var(--text) 58%, transparent);
}

/* 窄屏改用侧栏抽屉导航，分类栏让位给内容。 */
@media (max-width: 900px) {
    .catbar {
        display: none;
    }
}

/* ---------- 卡片 ---------- */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.9rem;
}

.card.err {
    border-color: var(--err);
    background: var(--err-soft);
    color: var(--err);
    font-weight: 500;
}

/* ---------- 表单布局 ---------- */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field > label {
    font-size: 0.8rem;
    color: var(--text-2);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    min-width: 0;
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

textarea {
    width: 100%;
    font-family: Consolas, "Cascadia Mono", monospace;
    resize: vertical;
    line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ---------- 按钮 ---------- */

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--text-inv);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}

button:hover:not(:disabled) {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

button:active:not(:disabled) {
    background: var(--brand-active);
    border-color: var(--brand-active);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

button.secondary {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}

button.secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

button.secondary:active:not(:disabled) {
    background: var(--bg-hover);
}

button.danger {
    background: var(--err);
    border-color: var(--err);
}

button.danger:hover:not(:disabled) {
    filter: brightness(0.92);
    background: var(--err);
    border-color: var(--err);
}

button.btn-sm {
    padding: 0.22rem 0.6rem;
    font-size: 0.8rem;
}

/* 顶部栏等处的纯图标按钮 */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-2);
    box-shadow: none;
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
}

.icon-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.icon-btn:active:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text);
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* 主题切换：两枚图标常驻 DOM，按当前主题显隐 */
.theme-toggle .i-sun,
.theme-toggle .i-moon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="dark"] .theme-toggle .i-sun,
html[data-theme="light"] .theme-toggle .i-moon {
    display: none;
}

/* ---------- 标签页（pill 式） ---------- */

.tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tab {
    padding: 0.4rem 0.95rem;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-2);
    font-size: 0.88rem;
    font-weight: 400;
    box-shadow: none;
}

.tab:hover:not(:disabled) {
    background: var(--bg-hover);
    border: none;
    color: var(--text);
}

.tab:active:not(:disabled) {
    background: var(--bg-hover);
    border: none;
}

.tab.active {
    background: var(--bg-surface);
    color: var(--brand);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.tab.active:hover:not(:disabled),
.tab.active:active:not(:disabled) {
    background: var(--bg-surface);
    color: var(--brand);
}

/* ---------- 表格 ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    background: var(--bg-soft);
    white-space: nowrap;
}

th:first-child {
    border-top-left-radius: var(--radius-sm);
}

th:last-child {
    border-top-right-radius: var(--radius-sm);
}

tbody tr:nth-child(even) {
    background: var(--bg-soft);
}

tbody tr:hover {
    background: var(--bg-hover);
}

/* ---------- 文本与状态 ---------- */

.mono {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.83rem;
    word-break: break-all;
}

.muted {
    color: var(--text-2);
}

.ok {
    color: var(--ok);
    font-weight: 600;
}

.err {
    color: var(--err);
    font-weight: 600;
}

.text-danger {
    color: var(--err);
}

.text-success {
    color: var(--ok);
}

.text-warning {
    color: var(--warn);
}

.text-muted {
    color: var(--text-2);
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 500;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-2);
}

.badge.ok {
    background: var(--ok-soft);
    border-color: transparent;
    color: var(--ok);
}

.badge.err {
    background: var(--err-soft);
    border-color: transparent;
    color: var(--err);
}

/* ---------- 结果块 ---------- */

.result {
    margin-top: 0.9rem;
    padding: 0.8rem 0.95rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.83rem;
    line-height: 1.6;
    max-height: 420px;
    overflow: auto;
}

.result.err {
    background: var(--err-soft);
    border-color: var(--err-soft);
}

/* ---------- 进度 ---------- */

.progress-track {
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin: 0.6rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-hover));
    border-radius: var(--radius-pill);
    transition: width 0.15s linear;
}

/* ---------- 布局辅助 ---------- */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---------- 访问统计数值 ---------- */

.stat-value {
    font-size: 1.75rem;
    font-weight: 650;
    color: var(--brand);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.empty {
    color: var(--text-2);
    font-size: 0.9rem;
    padding: 1.1rem 0;
    text-align: center;
}

.gate-msg {
    color: var(--warn);
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
}

.ms-xs {
    margin-left: 0.3rem;
}

.mt-0 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ---------- 加载动画 ---------- */

.spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 0.35rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 错误提示 ---------- */

.blazor-error-boundary {
    background: var(--err);
    padding: 1rem 1.1rem;
    color: var(--text-inv);
    border-radius: var(--radius);
}

/* 框架自带未处理异常提示条。用 token 而非硬编码色值：
   底色取 --bg-surface（浅色主题为白、深色主题为深灰）保证不透明、盖住下方正文，
   文字取 --warn（浅色为深琥珀、深色为亮琥珀）在两套主题下对比度都达标。 */
#blazor-error-ui {
    background: var(--bg-surface);
    color: var(--warn);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.65rem 3rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: inherit;
    margin-left: 0.4rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.85rem;
    top: 0.55rem;
}

/* ---------- 文件上传与选择列表（PDF 工具） ---------- */

input[type="file"] {
    max-width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-2);
    font-size: 0.86rem;
    font-family: inherit;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 0.6rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    font-size: 0.86rem;
}

.file-order {
    flex-shrink: 0;
    width: 1.6rem;
    text-align: center;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    flex-shrink: 0;
    color: var(--text-2);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.file-actions {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.25rem;
}

.pdf-empty {
    margin: 0;
    font-size: 0.86rem;
}

.pdf-status {
    font-size: 0.86rem;
    color: var(--text-2);
}

.pdf-status.ok {
    color: var(--ok);
    font-weight: 500;
}

.pdf-status.err {
    color: var(--err);
    font-weight: 500;
}

.pdf-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.pdf-download {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--text-inv);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background var(--t), border-color var(--t);
}

.pdf-download:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.pdf-result-meta {
    font-size: 0.82rem;
}

/* ---------- 广告位 ----------
   这些元素由 AdBanner 组件渲染在 MainLayout 中，组件级 scoped 样式不会
   作用到它们，因此规则必须放在全局样式表。没有广告时组件整块不渲染，
   页面不会留下空位。 */

.ad-zone {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* 4 个广告位按挂载点分别定位。用 data-position 属性选择器而非结构选择器：
   页脚广告挂在 .content-scroll 内（.main 的孙子节点），结构选择器容易失配。 */

/* 顶部通栏：分类栏之下、滚动容器之上，flex-shrink:0 保证常驻不滚动 */
.ad-zone[data-position="top-banner"] {
    flex-shrink: 0;
    padding: 0.8rem 1.75rem 0;
}

/* 内容区顶部 / 底部 */
.ad-zone[data-position="content-top"] {
    margin-bottom: 1.35rem;
}

.ad-zone[data-position="content-bottom"] {
    margin-top: 1.5rem;
}

/* 页脚上方 */
.ad-zone[data-position="footer"] {
    padding: 0 1.75rem 1.25rem;
}

.ad-slot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.25rem 3.8rem 1.25rem 1.15rem;
    border: 1px solid var(--brand);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    /* 用主色与卡片底色混合出实打实的靛蓝底，深浅主题各自成立 */
    background: linear-gradient(100deg,
        color-mix(in srgb, var(--brand) 15%, var(--bg-surface)),
        color-mix(in srgb, var(--brand) 4%, var(--bg-surface)) 70%);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 2px 14px var(--brand-ring);
    transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

a.ad-slot:hover {
    box-shadow: 0 6px 22px var(--brand-ring);
    transform: translateY(-2px);
}

a.ad-slot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* 未配置链接时不做成可点击的样子 */
.ad-slot:not([href]) {
    cursor: default;
}

.ad-tag {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.05em;
}

.ad-image {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
}

.ad-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ad-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.ad-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.86rem;
    color: var(--text-2);
}

/* 行动按钮：只在配置了跳转链接时出现 */
.ad-cta {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: var(--text-inv);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px var(--brand-ring);
    transition: background var(--t), box-shadow var(--t);
}

a.ad-slot:hover .ad-cta {
    background: var(--brand-hover);
    box-shadow: 0 3px 14px var(--brand-ring);
}

/* 首次载入时按 3 下，把注意力引到按钮上，之后自动停止 */
@media (prefers-reduced-motion: no-preference) {
    a.ad-slot .ad-cta {
        animation: ad-attention 1.6s ease-in-out 3;
    }
}

@keyframes ad-attention {
    0%, 100% {
        box-shadow: 0 2px 10px var(--brand-ring);
    }
    50% {
        box-shadow: 0 2px 10px var(--brand-ring), 0 0 0 6px var(--brand-ring);
    }
}

@media (max-width: 900px) {
    .ad-zone[data-position="top-banner"] {
        padding: 0.7rem 1rem 0;
    }

    .ad-zone[data-position="footer"] {
        padding: 0 1rem 1rem;
    }
}

/* ---------- 关于本站 ---------- */

.about-list {
    margin: 0.7rem 0 0;
    padding-left: 1.15rem;
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.8;
}

.about-list li + li {
    margin-top: 0.3rem;
}

.about-list strong {
    color: var(--text);
    font-weight: 600;
}

/* 联系二维码 */
.qr-box {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    margin-top: 1.05rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.qr-img {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    object-fit: contain;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.qr-tip {
    min-width: 0;
}

.qr-label {
    margin: 0 0 0.3rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.qr-hint {
    margin: 0;
    font-size: 0.83rem;
    color: var(--text-2);
}

@media (max-width: 560px) {
    .qr-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- 复选框行 ---------- */

.check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

.check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

/* ---------- UUID 列表 ---------- */

.uuid-list {
    margin-top: 0.9rem;
    padding: 0.8rem 0.95rem;
    max-height: 360px;
    overflow: auto;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    line-height: 1.9;
    user-select: all;
}

/* ---------- 文本对比 ---------- */

.diff-stat {
    display: inline-flex;
    gap: 0.5rem;
    margin-left: 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    vertical-align: middle;
}

.diff-stat-add {
    color: var(--ok);
}

.diff-stat-del {
    color: var(--err);
}

.diff-stat-chg {
    color: var(--warn);
}

.diff-view {
    margin-top: 0.5rem;
    max-height: 560px;
    overflow: auto;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.83rem;
    line-height: 1.6;
}

.diff-line {
    display: flex;
    align-items: flex-start;
    min-width: max-content;
}

.diff-line.same {
    color: var(--text-2);
}

.diff-line.added {
    background: color-mix(in srgb, var(--ok) 14%, transparent);
}

.diff-line.removed {
    background: color-mix(in srgb, var(--err) 14%, transparent);
}

.diff-ln {
    flex-shrink: 0;
    width: 3.6rem;
    padding: 0 0.6rem;
    text-align: right;
    color: var(--text-3);
    background: color-mix(in srgb, var(--bg-hover) 60%, transparent);
    border-right: 1px solid var(--border);
    user-select: none;
    font-variant-numeric: tabular-nums;
}

.diff-text {
    flex: 1;
    padding: 0 0.75rem;
    /* 必须保留前导空格与制表符，否则缩进被折叠、左右行对不齐 */
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-seg-add {
    background: color-mix(in srgb, var(--ok) 32%, transparent);
    color: var(--ok);
    border-radius: 2px;
}

.diff-seg-del {
    background: color-mix(in srgb, var(--err) 32%, transparent);
    color: var(--err);
    border-radius: 2px;
}

.diff-seg-same {
    color: inherit;
}

/* ---------- 键值表（WHOIS 等结构化结果） ---------- */

.kv th {
    background: transparent;
    color: var(--text-2);
    font-weight: 600;
    white-space: nowrap;
}

.kv td {
    color: var(--text);
}

.whois-raw-title {
    margin: 1.2rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-2);
}

/* ---------- 提示条（警告 / 说明） ---------- */

.card.warn {
    border-color: var(--warn);
    background: var(--warn-soft);
    color: var(--warn);
}

.card.warn strong {
    display: block;
    margin-bottom: 0.35rem;
}

.warn-text {
    margin: 0;
    color: var(--text-2);
    font-size: 0.88rem;
    line-height: 1.7;
}

.warn-list {
    margin: 0.4rem 0 0;
    padding-left: 1.2rem;
    color: var(--text-2);
    font-size: 0.88rem;
    line-height: 1.8;
}

.warn-list code {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.82rem;
    background: var(--bg-soft);
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-sm);
}

.hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-2);
}

.result.ok {
    background: var(--ok-soft);
    border-color: var(--ok-soft);
}

/* ---------- 二维码 ---------- */

.qr-stage {
    margin-top: 1rem;
}

.qr-host {
    display: inline-block;
    padding: 0.75rem;
    background: var(--qr-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.qr-host:empty {
    display: none;
}

.qr-host svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---------- JWT 解析面板 ---------- */

.jwt-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.9rem;
}

.jwt-title {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-bottom: 0.3rem;
}

.jwt-table {
    max-height: 260px;
    overflow: auto;
}

.jwt-times {
    margin-top: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}

/* ---------- 输入框 + 按钮组合 ---------- */

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-group input {
    flex: 1;
}

@media (max-width: 768px) {
    .jwt-panels {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-wrap: wrap;
    }
}

/* ---------- 首页：热门工具 / 最新文章 ---------- */

.hot-tools {
    margin-bottom: 1.35rem;
}

.hot-tools-title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: var(--text-2);
}

.hot-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hot-tool {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.hot-tool:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.hot-tool-name {
    font-weight: 500;
}

.hot-tool-count {
    color: var(--text-2);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- 结果区复制按钮 ---------- */

.copy-btn {
    align-self: flex-start;
    margin-top: 0.6rem;
    padding: 0.22rem 0.7rem;
    font-size: 0.8rem;
    background: var(--bg-surface);
    color: var(--text-2);
    border-color: var(--border-strong);
    box-shadow: none;
}

.copy-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.copy-btn:active:not(:disabled) {
    background: var(--bg-hover);
}

/* ---------- 博客：列表 ---------- */

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.blog-item {
    display: flex;
    gap: 1rem;
    padding: 1.05rem 1.2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.blog-item:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.blog-item-cover {
    flex-shrink: 0;
    width: 132px;
    height: 88px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.blog-item-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-item-body {
    flex: 1;
    min-width: 0;
}

.blog-item-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

.blog-item-title a {
    color: var(--text);
    text-decoration: none;
}

.blog-item-title a:hover {
    color: var(--brand);
}

.blog-item-summary {
    margin: 0 0 0.55rem;
    color: var(--text-2);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* ---------- 博客：日期与标签 ---------- */

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-3);
    font-size: 0.8rem;
}

.blog-tag {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.75rem;
    text-decoration: none;
}

.blog-tag:hover {
    text-decoration: underline;
}

.blog-cover {
    display: block;
    width: 100%;
    height: auto;
    margin: 0.6rem 0 1rem;
    border-radius: var(--radius);
}

.blog-contact p {
    margin: 0;
}

/* ---------- 博客：分页 ---------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background var(--t), border-color var(--t), color var(--t);
}

.pager-btn:hover {
    background: var(--bg-hover);
    border-color: var(--brand);
    color: var(--brand);
}

.pager-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pager-btn.disabled:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.pager-info {
    color: var(--text-2);
    font-size: 0.82rem;
}

/* ---------- 博客：正文排版 ---------- */

.prose {
    color: var(--text);
    line-height: 1.75;
    word-wrap: break-word;
}

.prose > *:first-child {
    margin-top: 0;
}

.prose > *:last-child {
    margin-bottom: 0;
}

.prose h2 {
    font-size: 1.2rem;
    font-weight: 620;
    margin: 1.7rem 0 0.7rem;
}

.prose h3 {
    font-size: 1.06rem;
    font-weight: 600;
    margin: 1.35rem 0 0.6rem;
}

.prose h4 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 1.1rem 0 0.5rem;
}

.prose p {
    margin: 0 0 0.9rem;
}

.prose ul,
.prose ol {
    margin: 0 0 0.9rem;
    padding-left: 1.4rem;
}

.prose li {
    margin: 0.25rem 0;
}

.prose a {
    color: var(--brand);
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

.prose code {
    padding: 0.12rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.86em;
}

.prose pre {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    overflow-x: auto;
    line-height: 1.6;
}

.prose pre code {
    padding: 0;
    border: none;
    background: none;
    font-size: 0.84rem;
}

.prose blockquote {
    margin: 0 0 1rem;
    padding: 0.45rem 0.95rem;
    border-left: 3px solid var(--brand);
    background: var(--bg-soft);
    color: var(--text-2);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.prose table {
    margin: 0 0 1rem;
}

.prose hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .blog-item {
        flex-direction: column;
    }

    .blog-item-cover {
        width: 100%;
        height: 150px;
    }
}

/* ---------- 分类聚合页：分组区块与工具卡片 ---------- */

.group-section {
    margin-bottom: 1.6rem;
}

.group-section h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.group-section h2 a {
    color: var(--text);
    text-decoration: none;
}

.group-section h2 a:hover {
    color: var(--brand);
}

.group-blurb {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    color: var(--text-2);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.7rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 0.95rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.tool-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.tool-card-icon {
    margin-bottom: 0.15rem;
    color: var(--brand);
}

.tool-card-title {
    font-size: 0.94rem;
    font-weight: 600;
}

.tool-card-blurb {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-2);
}

/* ---------- 常见问题 ---------- */

.faq {
    margin-top: 1.6rem;
}

.faq h2 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
}

.faq-item {
    margin-bottom: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item summary {
    padding: 0.7rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    /* 去掉浏览器默认的三角标记，改用右侧的自绘符号 */
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "＋";
    float: right;
    font-weight: 400;
    color: var(--text-3);
}

.faq-item[open] summary::after {
    content: "－";
}

.faq-item summary:hover {
    background: var(--bg-hover);
}

.faq-answer {
    padding: 0 0.95rem 0.85rem;
    font-size: 0.87rem;
    line-height: 1.7;
    color: var(--text-2);
}

/* ---------- 相关工具内链 ---------- */

.related-tools {
    margin-top: 1.6rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.related-tools h2 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.related-list a {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
}

.related-list a:hover {
    text-decoration: underline;
}

.related-list small {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-2);
}

.related-back {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
}

.related-back a {
    color: var(--brand);
    text-decoration: none;
}

.related-back a:hover {
    text-decoration: underline;
}