/* =========================================================================
   MailABC 工具箱 —— 外壳样式（左侧导航 + 右侧主区）
   本文件在 tools.css 之后加载，负责覆盖旧页面的整体布局规则，
   并补充工具箱外壳独有的组件。
   体量上整体偏紧凑：基准字号 14px，表单控件 0.875rem。
   ========================================================================= */

:root {
    --primary-color: #00a67c;
    --primary-hover: #008a67;
    --primary-soft: #e9f8f3;
    --primary-line: #b8e6d6;
    --secondary-color: #6b7280;
    --background-color: #f5f8f7;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --border-strong: #d8dee9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --sidebar-w: 214px;
    --topbar-h: 52px;
    --radius-md: 6px;
    --radius-lg: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 24px -10px rgba(16, 24, 40, .18);
}

/* ---------------------------------------------------------------- 基础覆盖 */

body {
    display: block;
    padding: 0;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-main);
    font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ---------------------------------------------------------------- 侧边导航 */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--border-color);
    z-index: 60;
    transition: transform .25s ease;
}

/* 品牌区只保留文字：用渐变文字代替原有的图标方块，
   颜色顺着深绿→品牌绿→青绿走，和主色同族但不抢导航的注意力。
   高度必须钉死成 --topbar-h：以前靠上下 padding 撑，实际只有 48.5px，
   于是品牌区的下边框和顶栏的下边框差着几像素，两条横线对不齐。 */
.brand {
    display: flex;
    align-items: center;
    flex: none;
    height: var(--topbar-h);
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.005em;
    line-height: 1.3;
    color: #00a67c;
    background-image: linear-gradient(100deg, #008a67 0%, #00a67c 55%, #14b8a6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    transition: filter .2s ease;
}

.brand:hover {
    filter: brightness(1.15) saturate(1.1);
}

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 9px 20px;
    scrollbar-width: thin;
    scrollbar-color: #dbe4e1 transparent;
}

.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-thumb {
    background: #dbe4e1;
    border-radius: 3px;
}

/* 一级入口：与工具项同宽同高，加粗 + 下方细线与分组列表分开 */
.nav-home {
    font-weight: 600;
    color: #2f3b52;
}

.nav-divider {
    height: 1px;
    margin: 9px 9px 1px;
    background: #edf3f1;
}

.nav-home,
.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.5;
    color: #43506a;
    transition: background-color .15s, color .15s;
}

/* 图标统一 16px 槽位，保证所有文字左边缘成一条线 */
.nav-home i,
.nav-item i {
    width: 16px;
    flex: 0 0 16px;
    text-align: center;
    font-size: 12px;
    color: #9aa5b4;
    transition: color .15s;
}

.nav-item:hover {
    background: #f2f7f5;
    color: #1f2937;
}

.nav-home:hover i,
.nav-item:hover i {
    color: var(--primary-color);
}

.nav-home.active,
.nav-item.active {
    background: var(--primary-soft);
    color: #00805f;
    font-weight: 600;
}

.nav-home.active i,
.nav-item.active i {
    color: var(--primary-color);
}

.nav-group {
    margin-top: 4px;
}

/* 分组只做小标题，不带图标，靠字重/字号/留白分层 */
.nav-group-title {
    padding: 13px 9px 5px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    color: #8b95a8;
    line-height: 1.4;
}

.sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .38);
    z-index: 55;
}

/* ---------------------------------------------------------------- 主区域 */

.app-body {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 26px;
    margin: 0;
    text-align: left;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.nav-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 7px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.crumbs a {
    color: var(--text-secondary);
}

.crumbs a:hover {
    color: var(--primary-color);
}

.crumbs a:last-of-type {
    color: var(--text-main);
    font-weight: 500;
}

.crumbs .sep {
    color: #cbd5e1;
}

.topbar-link {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.topbar-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-line);
    background: var(--primary-soft);
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 22px 26px 44px;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 26px 22px;
    text-align: center;
    color: #9ca3af;
    font-size: 12.5px;
    margin: 0;
}

.site-footer p {
    margin: 2px 0;
}

/* ---------------------------------------------------------------- 页头 */

.page-head {
    margin-bottom: 16px;
}

.page-head h1 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 6px;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.35;
    color: var(--text-main);
}

.page-head h1 i {
    font-size: 1.05rem;
    color: var(--primary-color);
}

.page-sub {
    margin: 0;
    font-size: .84rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.page-sub a {
    color: var(--primary-color);
}

.page-sub a:hover {
    text-decoration: underline;
}

.page-sub .dot {
    margin: 0 6px;
    color: #cbd5e1;
}

/* ---------------------------------------------------------------- 卡片微调 */

.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 18px 20px;
    margin-bottom: 14px;
    animation: fadeIn .25s ease-out;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.result-card h3,
.info-card h3 {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 11px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 7px;
}

.result-card h3 i,
.info-card h3 i {
    color: var(--primary-color);
    font-size: .88rem;
}

/* DKIM 生成页的说明句：旧样式带 max-width:600px + margin:0 auto，
   短句在宽卡片里被挤到中间，左边空出一大块，看起来像样式没生效。 */
.result-card .description {
    max-width: none;
    margin: 0 0 10px;
    text-align: left;
    font-size: .82rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 信头分析页用了可折叠标题条（.card-header / .toggle-header）。旧样式给标题条
   1rem 上下内边距，整行近 56px；而 h3 又叠了上面那条 border-bottom，
   于是标题文字下面多出一条线。这里收成 36px 左右的标题条，靠底色分层、不画线。 */
.result-card .card-header {
    padding: 8px 14px;
    background: #f4f8f7;
    border-bottom: none;
}

.result-card .card-header h3 {
    margin: 0;
    padding: 0;
    border-bottom: none;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.4;
    color: #334155;
}

.result-card .card-header .arrow-icon {
    font-size: .76rem;
    color: #94a3b8;
}

.toggle-header {
    padding: 8px 14px;
    background: #f4f8f7;
    border-bottom: none;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    color: #334155;
}

.toggle-header>span i {
    color: var(--primary-color);
    margin-right: 5px;
}

.toggle-btn {
    font-size: .78rem;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
}

label {
    font-size: .78rem;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: .01em;
}

input[type="text"],
input[type="email"],
select,
textarea {
    border-color: var(--border-strong);
    border-radius: var(--radius-md);
    font-size: .875rem;
    background-color: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 166, 124, .14);
    outline: none;
}

.btn-primary {
    border-radius: var(--radius-md);
    background-color: var(--primary-color);
    font-size: .875rem;
    font-weight: 600;
    padding: .58rem;
    box-shadow: 0 1px 2px rgba(0, 166, 124, .3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    border-radius: var(--radius-md);
    font-size: .875rem;
    padding: .58rem;
}

.help-text {
    font-size: .74rem;
    color: #9ca3af;
    margin-top: 4px;
}

.captcha-img {
    border-radius: var(--radius-md);
}

.code-block-wrapper {
    background: #0f172a;
    border-radius: var(--radius-md);
    padding: .8rem .9rem;
}

/* 根节点本身就是一个 ul.spf-tree，tools.css 里的 ".spf-tree ul" 选不中它，
   会残留默认列表圆点，这里补一条针对根 ul 的规则。
   必须限定为"直接子元素"，否则权重与 tools.css 的 ".spf-tree ul" 相同，
   会把每一层嵌套的 20px 缩进一起清零，树就变成平铺的了。 */
.tree-container>ul.spf-tree {
    list-style: none;
    margin: 0;
    padding-left: 0;
    border-left: none;
}

/* ---------------------------------------------------------------- 工具箱首页 */

.hero {
    background: linear-gradient(135deg, #006e57 0%, #00a67c 55%, #17b8a0 100%);
    border-radius: 12px;
    padding: 26px 26px 24px;
    color: #fff;
    margin-bottom: 22px;
    box-shadow: 0 14px 30px -18px rgba(0, 166, 124, .55);
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 10px;
    color: #fff;
}

.hero p {
    margin: 0;
    font-size: .875rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, .88);
    max-width: 760px;
}

.home-group {
    margin-bottom: 22px;
}

.home-group h2,
.tool-notes h2,
.related h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: #374151;
    margin: 0 0 10px;
}

.home-group h2 i {
    color: var(--primary-color);
    font-size: .8rem;
}

/* 每组工具 1~2 个，用固定两列避免 auto-fill 多出一条空轨道、
   在右侧留出一整块空白。 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color .18s, box-shadow .18s, transform .18s;
}

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

.tool-card-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.tool-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tool-card-body strong {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-main);
}

.tool-card-body span {
    font-size: .77rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tool-card-arrow {
    margin-left: auto;
    align-self: center;
    font-size: .7rem;
    color: #cbd5e1;
    transition: color .18s, transform .18s;
}

.tool-card:hover .tool-card-arrow {
    color: var(--primary-color);
    transform: translateX(2px);
}

/* ---------------------------------------------------------------- 工具页底部 */

.tool-notes {
    margin-top: 22px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.tool-notes ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.tool-notes li {
    position: relative;
    padding-left: 20px;
    font-size: .82rem;
    line-height: 1.7;
    color: #4b5563;
}

.tool-notes li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    font-size: .68rem;
    color: var(--success-color);
}

.related {
    margin-top: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 9px;
}

.related-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color .18s, background-color .18s;
}

.related-card:hover {
    border-color: var(--primary-line);
    background: #fbfdfc;
}

.related-card>i {
    margin-top: 3px;
    font-size: .78rem;
    color: var(--primary-color);
}

.related-card div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.related-card strong {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-main);
}

.related-card span {
    font-size: .74rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================================================================
   工具页细节覆盖 —— 以下规则针对 tools.css 里各工具自带的高体量样式，
   统一收窄字号、行高与内边距，保证 8 个工具看起来是同一套密度。
   ========================================================================= */

/* --- 表单 --- */

.form-group {
    margin-bottom: 1rem;
}

.form-group>label,
.form-group>label[for] {
    display: inline-block;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
select {
    padding: .5rem .75rem .5rem 2.3rem;
    line-height: 1.4;
}

/* 无前置图标的输入框（验证码、域名等）不应留出图标位 */
#captcha,
.captcha-group input[type="text"] {
    padding: .5rem .65rem;
}

.input-icon {
    left: .85rem;
    font-size: .8rem;
}

.select-arrow {
    right: .85rem;
    font-size: .7rem;
}

textarea {
    padding: .7rem .8rem;
    line-height: 1.6;
    resize: vertical;
}

/* 信头分析的多行输入区，原高 200px 过高 */
.large-textarea {
    height: 132px;
    min-height: 100px;
    padding: .7rem .8rem;
    font-size: .82rem;
    line-height: 1.55;
}

.help-text {
    margin-left: 0;
    line-height: 1.55;
}

/* --- 单选 / 多选 --- */

.radio-group {
    gap: 1.4rem;
    margin-top: .25rem;
}

.radio-label {
    gap: .4rem;
    font-size: .85rem;
}

.checkbox-group {
    gap: .4rem;
    margin-top: .3rem;
}

.checkbox-label {
    gap: .5rem;
    font-size: .85rem;
    line-height: 1.6;
    align-items: flex-start;
}

input[type="radio"] {
    width: 1em;
    height: 1em;
    margin: 0;
}

input[type="checkbox"] {
    width: 1em;
    height: 1em;
    margin: .16rem 0 0;
    flex: 0 0 auto;
}

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

.button-group {
    gap: .75rem;
    justify-content: flex-start;
}

.btn-primary,
.btn-secondary {
    padding: .55rem 1.1rem;
    gap: .4rem;
}

/* 并列按钮不必各占一半，按内容宽度即可 */
.button-group .btn-primary,
.button-group .btn-secondary {
    width: auto;
    min-width: 150px;
}

button {
    font-size: .875rem;
}

/* --- 结果表格 / 代码块 --- */

.data-table {
    font-size: .8rem;
}

.data-table th,
.data-table td {
    padding: .5rem .7rem;
    line-height: 1.55;
}

/* DKIM / DMARC 标签卡片原本 1rem 内边距，纵向堆叠后整页过长 */
.tags-container {
    gap: .5rem;
}

.tag-item {
    padding: .55rem .7rem;
}

.tag-name {
    font-size: .85rem;
    margin-bottom: .2rem;
}

.tag-value {
    font-size: .82rem;
    padding: .25rem .45rem;
    margin-bottom: .25rem;
}

.tag-description {
    font-size: .8rem;
    line-height: 1.6;
}

/* SPF 解析树 */
.tree-container {
    padding: 1rem;
}

.spf-node {
    font-size: .8rem;
    padding: 3px 7px;
}

.spf-tree li {
    margin: 4px 0;
}

#recordOutput,
.record-container {
    font-size: .82rem;
    line-height: 1.6;
}

.copy-btn {
    width: 26px;
    height: 26px;
    font-size: .78rem;
}

.alert {
    padding: .65rem 1rem;
    font-size: .82rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
}

/* 结构不完整提示：比 error 弱一档——任务成功了，但结果可能缺项。
   用琥珀色而不是红色，避免用户以为"操作失败"。 */
.alert-warn {
    background-color: #fffaeb;
    color: #92400e;
    border-left: 4px solid #d97706;
}

/* 概要表里的结构异常行跟着一起走琥珀色，扫一眼就能和普通说明区分开 */
.data-table tr.is-warn td {
    color: #92400e;
    background-color: #fffcf5;
}

/* --- 选项说明 --- */

.info-content {
    gap: .85rem;
}

.info-item {
    grid-template-columns: 68px 1fr;
    gap: .8rem;
    align-items: start;
}

/* 标签原来是 1rem + .5rem 内边距的方形盒子，比正文首行高出一截，
   与右侧说明文字看起来不在一条线上；收成一行高的胶囊。 */
.info-tag {
    font-size: .74rem;
    line-height: 1.5;
    padding: .12rem .3rem;
    border-radius: 5px;
    background: #e9f8f3;
    border-color: #c6ebde;
    color: #007f5f;
    letter-spacing: .01em;
}

.info-desc {
    font-size: .82rem;
    line-height: 1.7;
    color: #4b5563;
}

.info-desc p {
    margin: 0 0 .3rem;
}

.info-desc p:last-child {
    margin-bottom: 0;
}

/* tools.css 把 .info-desc strong 设成了 display:block，导致「标签词」整段换行、
   紧跟其后的冒号被挤到下一行行首。这里还原成行内元素。 */
.info-desc strong {
    display: inline;
    margin-bottom: 0;
    color: var(--text-main);
    font-weight: 600;
}

.info-desc code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: .95em;
    background: #ecf3f1;
    color: #334155;
    padding: .05rem .28rem;
    border-radius: 4px;
}

.info-list {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    display: grid;
    gap: .12rem;
}

.info-list li {
    position: relative;
    padding-left: .85rem;
}

.info-list li::before {
    content: "";
    position: absolute;
    left: .25rem;
    top: .72em;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* ---------------------------------------------------------------- EML 解析（MIME 结构） */

/* 结构树复用 tools.css 里 .spf-tree / .spf-node 那一套（层级缩进、左侧竖线、
   节点配色都已具备），这里只补 MIME 页独有的部分。 */
.mime-node {
    /* .spf-node 是 inline-flex 但没有 gap，徽章与类型文字会挤在一起；
       折叠箭头自带 margin-right，这里一并归零，统一用 gap 控制间距。 */
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 3px 8px;
}

.mime-node .spf-toggle {
    margin-right: 0;
    flex: none;
}

.mime-node:hover {
    background: var(--primary-soft);
}

.mime-node.selected {
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px var(--primary-line);
}

.mime-badge {
    display: inline-block;
    padding: 0 .35rem;
    border-radius: 3px;
    font-size: .68rem;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: .01em;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.mime-badge.is-text { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.mime-badge.is-html { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.mime-badge.is-attach { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.mime-badge.is-inline { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

/* tools.css 里层级竖线是 #e2e8f0，压在这个浅色底上几乎看不见。
   MIME 树的重点就是层级关系，这里单独加深一档。 */
.mime-tree .spf-tree ul {
    border-left-color: #d5dfe9;
}

.mime-meta {
    font-size: .75rem;
    color: var(--text-secondary);
}

/* 概要表 / 节点详情表的左侧标签列 */
.attr-label {
    width: 130px;
    color: var(--text-secondary);
    vertical-align: top;
}

/* 标题条右侧的操作区：按钮 + 折叠箭头排一行，按钮靠箭头左边 */
.header-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex: none;
}

.header-actions .btn-mini {
    padding: .18rem .5rem;
    font-size: .72rem;
}

/* 顶部轻提示：固定定位，页面滚到哪里都看得见 */
.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 90;
    max-width: min(92vw, 420px);
    padding: .5rem .9rem;
    font-size: .8125rem;
    line-height: 1.5;
    color: #fff;
    background: rgba(30, 41, 59, .94);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.toast.toast-in {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: .9rem 0 .35rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 区块标题右侧的按钮组（如"加载完整原文 + 复制原文"） */
.section-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: none;
}

/* .btn-mini 自带 display，若只写 .hidden 会被它的 display 覆盖掉 */
.btn-mini.hidden {
    display: none;
}

.raw-block {
    margin: 0;
    padding: .6rem .75rem;
    max-height: 320px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    line-height: 1.55;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
}

.progress-track {
    height: 4px;
    margin-top: .6rem;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--primary-color);
    transition: width .15s linear;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    font-size: .75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-mini:hover {
    color: var(--primary-color);
    border-color: var(--primary-line);
}

.button-group.compact {
    margin-bottom: .5rem;
}

input[type="file"] {
    width: 100%;
    padding: .4rem .5rem;
    font-size: .8125rem;
    color: var(--text-secondary);
    background: #fff;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
}

input[type="file"]::file-selector-button {
    margin-right: .6rem;
    padding: .3rem .7rem;
    font-size: .78rem;
    color: var(--primary-color);
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.full-headers-table td {
    vertical-align: top;
}

.full-headers-table td:nth-child(3) {
    word-break: break-word;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-mask.show {
        display: block;
    }

    .app-body {
        margin-left: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 18px 16px 40px;
    }
}

@media (max-width: 768px) {
    /* tools.css 在 768 以下把验证码组改成竖排，画布和输入框各占一行、
       下面还跟着按钮，显得很散。二者总宽不到 260px，手机上完全可以并排。 */
    .captcha-group {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .captcha-group .captcha-img {
        flex: 0 0 auto;
    }

    .captcha-group input[type="text"] {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        padding: .5rem .65rem;
    }
}

@media (max-width: 600px) {
    .page-head h1 {
        font-size: 1.14rem;
        gap: 8px;
    }

    .page-head h1 i {
        font-size: .95rem;
    }

    .hero {
        padding: 22px 18px;
        border-radius: 11px;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .card {
        padding: 15px 16px;
    }

    .tool-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    .topbar-link {
        display: none;
    }

    .crumbs {
        font-size: 12px;
    }

    /* 移动端保持 16px 以免 iOS 聚焦时自动放大 */
    input[type="text"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px;
    }

    .info-item {
        grid-template-columns: 60px 1fr;
        gap: .6rem;
    }

    .large-textarea {
        height: 120px;
    }

    /* 满宽只该给表单里的主/次按钮：手机上点着舒服。
       折叠箭头（.toggle-btn）和标题条上的迷你按钮（.btn-mini）也在 button 之列，
       被拉成 100% 后箭头不再贴右，还会把左边的标题挤成一条窄缝。 */
    button,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: 0;
    }

    .toggle-btn,
    .btn-mini {
        width: auto;
        min-width: 0;
        flex: none;
    }

    /* 「邮件概要」右侧要放「复制信头」「用信头分析工具深度分析」两个长标签，
       窄屏一行放不下。让标题条允许换行、操作区换行后仍右对齐，标题就不会被逐字挤断。 */
    .result-card .card-header {
        flex-wrap: wrap;
        row-gap: .4rem;
    }

    .result-card .card-header h3 {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: auto;
    }

    .button-group {
        flex-direction: column;
    }
}
