/* ==========================================================================
   小工具合集插件样式
   命名空间：.fzm-tools-nav-*（前台导航栏下拉） / .ft-*（工具页面）
   ========================================================================== */

:root {
    --ft-primary: #2f6fed;
    --ft-primary-dark: #1f56c4;
    --ft-primary-light: #eaf1ff;
    --ft-success: #16a34a;
    --ft-danger: #dc2626;
    --ft-warning: #d97706;
    --ft-bg: #f5f7fb;
    --ft-card-bg: #ffffff;
    --ft-text: #1f2733;
    --ft-text-sec: #5b6574;
    --ft-border: #e3e8f0;
    --ft-shadow: 0 2px 10px rgba(30, 50, 90, 0.06);
    --ft-radius: 10px;
    --ft-header-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ft-bg: #12161d;
        --ft-card-bg: #1c2230;
        --ft-text: #e6ebf3;
        --ft-text-sec: #9aa6b8;
        --ft-border: #2b3444;
        --ft-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
        --ft-header-bg: #181e29;
        --ft-primary-light: rgba(47, 111, 237, 0.16);
    }
}

/* ========== 前台导航栏下拉 ========== */

.fzm-tools-nav {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 顶级链接：复用主题 .nav-link 外观（颜色/内边距/悬停下划线由主题定义），这里仅补充弱布局 */
.fzm-tools-nav-link {
    white-space: nowrap;
}

/* 下拉面板：复用主题 .dropdown-menu 外观（边框/圆角/阴影/悬浮展开由主题与 Bootstrap 定义），仅补充多项滚动能力 */
.fzm-tools-nav-menu {
    min-width: 224px;
    max-width: 320px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

/* 无 Bootstrap 下拉悬停规则的主题兜底：悬停显示 */
.fzm-tools-nav:hover > .fzm-tools-nav-menu {
    display: block;
}

/* 下拉项：复用主题 .dropdown-item 外观，仅补充图标对齐 */
.fzm-tools-nav-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.fzm-tools-nav-item .dropdown-emoji {
    flex: none;
}

/* 头部「全部小工具」项 */
.fzm-tools-nav-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    margin-bottom: 4px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #2f6fed;
    background: var(--ft-primary-light, #eaf1ff);
}

.fzm-tools-nav-head:hover {
    background-color: rgba(47, 111, 237, 0.14);
    color: #1f56c4;
}

/* 移动端：导航收起后，下拉改为静态展开 */
@media (max-width: 991.98px) {
    .fzm-tools-nav-menu {
        position: static;
        display: none;
        max-height: none;
        margin: 4px 0 8px;
    }
    .fzm-tools-nav.is-open .fzm-tools-nav-menu {
        display: block;
    }
}

/* ========== 工具页面基础 ========== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--ft-bg);
    color: var(--ft-text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

.ft-container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部栏 */
.ft-header {
    background: var(--ft-header-bg);
    border-bottom: 1px solid var(--ft-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ft-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.ft-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ft-text);
    text-decoration: none;
}

.ft-logo:hover {
    text-decoration: none;
}

.ft-logo-icon {
    font-size: 1.3rem;
}

.ft-topnav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ft-topnav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--ft-text-sec);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ft-topnav-link:hover {
    color: var(--ft-primary);
    background: var(--ft-primary-light);
    text-decoration: none;
}

.ft-topnav-link.is-active {
    color: #fff;
    background: var(--ft-primary);
}

/* 面包屑 */
.ft-breadcrumb {
    padding: 20px 0 4px;
    font-size: 0.88rem;
    color: var(--ft-text-sec);
}

.ft-breadcrumb a {
    color: var(--ft-text-sec);
}

.ft-breadcrumb a:hover {
    color: var(--ft-primary);
    text-decoration: none;
}

.ft-sep {
    margin: 0 7px;
    color: var(--ft-border);
}

.ft-current {
    color: var(--ft-text);
    font-weight: 500;
}

/* 页面标题区 */
.ft-page-head {
    padding: 10px 0 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ft-page-head-main {
    min-width: 0;
    flex: 1 1 260px;
}

.ft-page-head-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 8px;
    border: 1px solid var(--ft-primary);
    background: var(--ft-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ft-page-head-btn:hover {
    opacity: 0.88;
    background: var(--ft-primary);
    color: #fff;
    text-decoration: none;
}

.ft-page-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}

.ft-page-desc {
    margin: 0;
    color: var(--ft-text-sec);
    font-size: 0.98rem;
    max-width: 720px;
}

/* 主内容卡片 */
.ft-tool {
    background: var(--ft-card-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    box-shadow: var(--ft-shadow);
    padding: 26px;
    margin-bottom: 28px;
}

/* ========== 表单控件 ========== */

.ft-field {
    margin-bottom: 18px;
}

.ft-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.93rem;
}

.ft-label .ft-tip {
    font-weight: 400;
    color: var(--ft-text-sec);
    margin-left: 6px;
    font-size: 0.82rem;
}

.ft-input,
.ft-textarea,
.ft-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ft-border);
    border-radius: 8px;
    background: var(--ft-card-bg);
    color: var(--ft-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ft-input:focus,
.ft-textarea:focus,
.ft-select:focus {
    outline: none;
    border-color: var(--ft-primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.ft-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.ft-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ft-input-group .ft-field {
    flex: 1 1 180px;
    margin-bottom: 0;
}

.ft-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ft-inline input[type="checkbox"],
.ft-inline input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ft-primary);
    cursor: pointer;
}

.ft-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 4px;
}

/* ========== 双功能选项卡切换 ========== */
.ft-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--ft-bg);
    border: 1px solid var(--ft-border);
    border-radius: 11px;
}

.ft-tab {
    position: relative;
    cursor: pointer;
}

.ft-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ft-tab-label {
    display: block;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ft-text-sec);
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ft-tab-label:hover {
    color: var(--ft-primary);
}

.ft-tab input[type="radio"]:checked + .ft-tab-label {
    background: var(--ft-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(47, 111, 237, 0.35);
}

/* 选项卡下说明 */
.ft-tab-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--ft-text-sec);
}

/* ========== Emoji 大全 ========== */
.ft-em-cats {
    margin-top: 4px;
}

.ft-em-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.ft-em-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    border: 1px solid var(--ft-border);
    border-radius: 10px;
    background: var(--ft-bg);
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.ft-em-cell:hover {
    border-color: var(--ft-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(47, 111, 237, 0.14);
}

.ft-em-cell.copied {
    border-color: var(--ft-primary);
    background: var(--ft-primary-light);
}

.ft-em-cell .em {
    font-size: 2rem;
    line-height: 1.2;
}

.ft-em-cell .em-name {
    font-size: 0.76rem;
    color: var(--ft-text-sec);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-em-empty {
    margin-top: 24px;
    padding: 30px;
    text-align: center;
    color: var(--ft-text-sec);
    font-size: 0.9rem;
    border: 1px dashed var(--ft-border);
    border-radius: 10px;
}

/* Emoji 搜索框：清空按钮 */
.ft-search {
    position: relative;
}

.ft-search .ft-input {
    padding-right: 44px;
}

.ft-search-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: var(--ft-border);
    color: var(--ft-text-sec);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
    display: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ft-search.has-text .ft-search-clear {
    display: inline-flex;
}

.ft-search-clear:hover {
    background: var(--ft-primary);
    color: #fff;
}

/* Emoji 常用搜索推荐 */
.ft-em-sugg {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ft-em-sugg-label {
    font-size: 0.85rem;
    color: var(--ft-text-sec);
    white-space: nowrap;
}

.ft-em-sugg-chip {
    padding: 4px 13px;
    border: 1px solid var(--ft-border);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--ft-text-sec);
    background: var(--ft-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}

.ft-em-sugg-chip:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.ft-em-sugg-chip.active {
    background: var(--ft-primary-light);
    border-color: var(--ft-primary);
    color: var(--ft-primary);
    font-weight: 600;
}

/* Emoji 数量结果 */
.ft-em-count {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 0.88rem;
    color: var(--ft-text-sec);
}

.ft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    line-height: 1.4;
    background: none;
    color: inherit;
    font-family: inherit;
}

.ft-btn-primary {
    background: var(--ft-primary);
    color: #fff;
}

.ft-btn-primary:hover {
    background: var(--ft-primary-dark);
    opacity: 0.98;
}

.ft-btn-outline {
    border-color: var(--ft-border);
    background: var(--ft-card-bg);
    color: var(--ft-text);
}

.ft-btn-outline:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.ft-btn-ghost {
    border-color: transparent;
    color: var(--ft-text-sec);
    padding: 8px 14px;
}

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

.ft-btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.ft-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ========== 结果区 ========== */

.ft-result {
    display: none;
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: var(--ft-radius);
    background: var(--ft-primary-light);
    border: 1px solid rgba(47, 111, 237, 0.25);
    word-break: break-all;
}

.ft-result.show {
    display: block;
}

.ft-result-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ft-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* 结果区「复制结果」按钮 */
.ft-copy-btn {
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 12px;
    border: 1px solid rgba(47, 111, 237, 0.5);
    border-radius: 6px;
    background: transparent;
    color: var(--ft-primary);
    cursor: pointer;
    flex: none;
    line-height: 1.6;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ft-copy-btn:hover {
    background: var(--ft-primary);
    color: #fff;
}

.ft-result-box {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ft-text);
    line-height: 1.7;
}

.ft-result-box .ft-mono {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 0.95em;
    word-break: break-all;
}

.ft-result-sub {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--ft-text-sec);
}

.ft-result-error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
}

.ft-result-error .ft-result-box {
    color: var(--ft-danger);
}

.ft-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--ft-text-sec);
}

/* 数据行/表格 */
.ft-kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.ft-kv-item {
    padding: 14px 16px;
    border: 1px solid var(--ft-border);
    border-radius: 8px;
    background: var(--ft-bg);
}

.ft-kv-label {
    font-size: 0.82rem;
    color: var(--ft-text-sec);
    margin-bottom: 6px;
}

.ft-kv-value {
    font-size: 1.02rem;
    font-weight: 600;
    word-break: break-all;
}

.ft-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.ft-table th,
.ft-table td {
    padding: 10px 12px;
    border: 1px solid var(--ft-border);
    text-align: left;
}

.ft-table th {
    background: var(--ft-bg);
    font-weight: 600;
    white-space: nowrap;
}

.ft-table tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.012);
}

/* 徽章 */
.ft-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--ft-primary-light);
    color: var(--ft-primary);
}

.ft-badge-success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--ft-success);
}

.ft-badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--ft-danger);
}

/* 复制按钮 toast */
.ft-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: #1f2733;
    color: #fff;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

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

/* ========== 返回顶部 ========== */
.ft-backtop {
    position: fixed;
    right: 22px;
    bottom: 30px;
    z-index: 1500;
    width: 42px;
    height: 42px;
    border: 1px solid var(--ft-border);
    border-radius: 50%;
    background: var(--ft-card-bg);
    color: var(--ft-text-sec);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.15s ease, color 0.15s ease;
    box-shadow: 0 6px 18px rgba(20, 40, 80, 0.15);
}

.ft-backtop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ft-backtop:hover {
    background: var(--ft-primary);
    border-color: var(--ft-primary);
    color: #fff;
}

/* ========== 单位换算（百度风格） ========== */
.ft-unit-value-input {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 12px 14px;
}

.ft-unit-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.ft-unit-cat {
    flex: 1 1 auto;
    min-width: 84px;
    padding: 8px 12px;
    border: 1px solid var(--ft-border);
    border-radius: 8px;
    background: var(--ft-card-bg);
    color: var(--ft-text-sec);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    text-align: center;
}

.ft-unit-cat:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.ft-unit-cat.is-active {
    background: var(--ft-primary);
    border-color: var(--ft-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(47, 111, 237, 0.25);
}

.ft-unit-conv {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 16px;
}

.ft-unit-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ft-unit-eq {
    flex: none;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--ft-text-sec);
    padding-bottom: 38px;
    user-select: none;
}

.ft-unit-out {
    background: var(--ft-primary-light);
    color: var(--ft-primary);
    font-weight: 700;
}

.ft-unit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ft-unit-caption {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--ft-border);
    color: var(--ft-text-sec);
    font-size: 0.88rem;
    word-break: break-all;
}

@media (max-width: 560px) {
    .ft-unit-conv {
        flex-wrap: wrap;
        gap: 8px;
    }
    .ft-unit-side {
        flex: 1 1 100%;
    }
    .ft-unit-eq {
        align-self: center;
        transform: rotate(90deg);
        padding-bottom: 0;
        margin: -6px 0;
    }
}

/* ========== 日期推算差值结果表格 ========== */
.ft-diff-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2px 0;
    font-weight: 400;
}

.ft-diff-table caption {
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
    color: var(--ft-text);
    padding-bottom: 8px;
}

.ft-diff-table th,
.ft-diff-table td {
    padding: 7px 12px;
    border: 1px solid var(--ft-border);
    background: var(--ft-bg);
    font-size: 0.92rem;
    vertical-align: middle;
}

.ft-diff-table th {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ft-text-sec);
    font-weight: 700;
    font-size: 0.9rem;
    text-align: left;
    white-space: nowrap;
}

.ft-diff-table td:first-child {
    width: 1%;
    color: var(--ft-text-sec);
    font-weight: 600;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.015);
}

.ft-diff-table tr:last-child td {
    border-bottom: 1px solid var(--ft-border);
}

/* 日期差值结果：信息表与范围对比表分离 */
.ft-cmp-table {
    margin-top: 10px;
}

.ft-info-table td:last-child {
    width: 99%;
}

.ft-cmp-table th,
.ft-cmp-table td {
    white-space: nowrap;
}

.ft-cmp-table th:first-child,
.ft-cmp-table td:first-child {
    width: 1%;
    white-space: nowrap;
}

/* ========== 首页工具卡片 ========== */

.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    padding-bottom: 30px;
}

.ft-card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--ft-card-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    box-shadow: var(--ft-shadow);
    padding: 20px 20px 54px;
    color: var(--ft-text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ft-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(30, 60, 120, 0.12);
    border-color: var(--ft-primary);
    text-decoration: none;
}

.ft-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.ft-card-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.ft-card-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ft-text-sec);
    line-height: 1.6;
}

.ft-card-more {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 16px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ft-primary);
}

/* 分类标题 */
.ft-cat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.12rem;
    font-weight: 700;
    margin: 8px 0 14px;
}

.ft-cat-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ft-border);
}

/* 页脚 */
.ft-footer {
    margin-top: auto;
    padding: 22px 0;
    border-top: 1px solid var(--ft-border);
    color: var(--ft-text-sec);
    font-size: 0.85rem;
    text-align: center;
}

.ft-footer-sep {
    margin: 0 8px;
    color: var(--ft-border);
}

.ft-footer-icp {
    margin-top: 6px;
    font-size: 0.82rem;
}

.ft-footer-icp .ft-footer-link {
    color: var(--ft-text-sec);
}

.ft-footer-link {
    color: var(--ft-text-sec);
    text-decoration: none;
}

.ft-footer-link:hover {
    color: var(--ft-primary);
    text-decoration: underline;
}

/* ========== 免责声明 / 法律说明页 ========== */
.ft-legal h2 {
    font-size: 1.08rem;
    margin: 26px 0 10px;
    color: var(--ft-text);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ft-border);
}

.ft-legal h2:first-child {
    margin-top: 0;
}

.ft-legal p {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--ft-text);
}

.ft-legal .ft-legal-meta {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--ft-border);
    font-size: 0.84rem;
    color: var(--ft-text-sec);
}

/* ========== 逐项复制（小按钮） ========== */
.ft-copy-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 10px;
    margin-left: 8px;
    border: 1px solid var(--ft-border);
    border-radius: 6px;
    background: var(--ft-card-bg);
    color: var(--ft-text-sec);
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.5;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ft-copy-mini:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
    background: var(--ft-primary-light);
}

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

/* ========== 日期选择控件 ========== */
.fzm-date-wrap {
    position: relative;
    width: 100%;
}

.fzm-date-wrap .fzm-date-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1rem;
    z-index: 1;
}

.fzm-date-wrap .ft-input {
    padding-right: 38px;
    cursor: pointer;
}

.fzm-date-wrap .ft-input:read-only {
    cursor: pointer;
}

.fzm-dp {
    position: fixed;
    z-index: 3000;
    width: 282px;
    background: var(--ft-card-bg);
    border: 1px solid var(--ft-border);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(20, 40, 80, 0.2);
    padding: 12px;
    font-size: 0.88rem;
    color: var(--ft-text);
    user-select: none;
}

.fzm-dp-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.fzm-dp-nav {
    flex: none;
    width: 30px;
    height: 30px;
    border: 1px solid var(--ft-border);
    background: var(--ft-bg);
    border-radius: 7px;
    color: var(--ft-text-sec);
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1;
    padding: 0;
}

.fzm-dp-nav:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.fzm-dp-title {
    flex: 1;
    height: 30px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    color: var(--ft-text);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
    white-space: nowrap;
}

.fzm-dp-title:hover {
    background: var(--ft-primary-light);
    color: var(--ft-primary);
}

.fzm-dp-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: var(--ft-text-sec);
    font-size: 0.76rem;
    margin-bottom: 4px;
}

.fzm-dp-week span {
    padding: 4px 0;
}

.fzm-dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.fzm-dp-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    color: var(--ft-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    padding: 0;
}

.fzm-dp-cell:hover {
    background: var(--ft-primary-light);
    color: var(--ft-primary);
}

.fzm-dp-cell.is-today {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
    font-weight: 700;
}

.fzm-dp-cell.is-selected {
    background: var(--ft-primary);
    color: #fff;
    font-weight: 700;
}

.fzm-dp-grid12 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px 0 8px;
}

.fzm-dp-grid12 .fzm-dp-cell {
    height: 40px;
}

.fzm-dp-foot {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--ft-border);
    padding-top: 8px;
}

.fzm-dp-act {
    flex: 1;
    height: 30px;
    border: 1px solid var(--ft-border);
    background: var(--ft-bg);
    border-radius: 7px;
    color: var(--ft-text-sec);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0 8px;
}

.fzm-dp-act:hover {
    border-color: var(--ft-primary);
    color: var(--ft-primary);
}

.fzm-dp-yearjump {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.fzm-dp-yearin {
    flex: 1;
    height: 30px;
    border: 1px solid var(--ft-border);
    border-radius: 7px;
    background: var(--ft-card-bg);
    color: var(--ft-text);
    padding: 0 8px;
    font-family: inherit;
    font-size: 0.85rem;
    min-width: 0;
}

.fzm-dp-yearin:focus {
    outline: none;
    border-color: var(--ft-primary);
}

.fzm-dp-yearjump .fzm-dp-act {
    flex: none;
    padding: 0 14px;
}

/* ========== 详细计算过程（折叠） ========== */
.ft-detail-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--ft-border);
}

.ft-detail-toggle-btn {
    width: auto;
}

.ft-detail {
    margin-top: 10px;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--ft-border);
    border-radius: 8px;
    background: var(--ft-bg);
    font-size: 0.85rem;
}

.ft-detail-legend {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--ft-border);
    font-size: 0.78rem;
    color: var(--ft-text-sec);
    background: var(--ft-card-bg);
    border-radius: 8px 8px 0 0;
}

.ft-lg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.ft-lg::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.ft-lg-workday::before {
    background: #16a34a;
}

.ft-lg-weekend::before {
    background: #94a3b8;
}

.ft-lg-holiday::before {
    background: #dc2626;
}

.ft-lg-makeup::before {
    background: #d97706;
}

.ft-detail-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 5px 10px;
    border-bottom: 1px solid var(--ft-border);
}

.ft-detail-row:last-child {
    border-bottom: none;
}

.ft-detail-step {
    flex: none;
    min-width: 96px;
    color: var(--ft-text-sec);
    white-space: nowrap;
}

/* 日期推算详细过程 - 类型配色 */
.ft-detail-row-workday {
    background: rgba(22, 163, 74, 0.06);
}

.ft-detail-row-weekend {
    opacity: 0.62;
    background: rgba(148, 163, 184, 0.10);
}

.ft-detail-row-holiday {
    background: rgba(220, 38, 38, 0.07);
}

.ft-detail-row-makeup {
    background: rgba(217, 119, 6, 0.09);
}

.ft-detail-row-result {
    background: var(--ft-primary-light);
    opacity: 1;
    font-weight: 600;
}

.ft-detail-row-result .ft-detail-step {
    color: var(--ft-primary);
}

/* 兼容旧类名 */
.ft-detail-row-ok .ft-detail-step {
    color: var(--ft-primary);
}

.ft-detail-row-skip {
    opacity: 0.55;
}

.ft-detail-skip {
    padding: 8px 10px;
    color: var(--ft-text-sec);
    font-size: 0.82rem;
}

/* 徽章补充 */
.ft-badge-weekend {
    background: rgba(148, 163, 184, 0.18);
    color: #64748b;
}

.ft-badge-makeup {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

/* 响应式 */
@media (max-width: 767px) {
    .ft-page-title {
        font-size: 1.4rem;
    }
    .ft-tool {
        padding: 18px;
    }
    .ft-header-inner {
        min-height: 54px;
    }
    .ft-topnav-link {
        padding: 5px 10px;
        font-size: 0.86rem;
    }
    .ft-grid {
        grid-template-columns: 1fr;
    }
}
