/* ======================================================================
 *  文件类工具共用样式 /file-common.css
 *  供 clipboard-viewer / folder-analyzer / hex-viewer
 *     / big-file-viewer / file-split-merge 复用
 *  依赖 home.css 全局变量 + calc-common.css，支持黑夜模式。
 * ====================================================================== */

/* ---------- 拖放区 ---------- */
.ft-drop {
    position: relative;
    display: block;
    padding: 26px 18px;
    text-align: center;
    border: 2px dashed var(--c-border);
    border-radius: 14px;
    background: var(--c-surface-soft);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}
.ft-drop:hover { border-color: var(--c-primary); }
.ft-drop.is-over {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}
.ft-drop-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.ft-drop-main { font-size: 13.5px; font-weight: 700; color: var(--c-text); }
.ft-drop-sub { margin-top: 4px; font-size: 12px; color: var(--c-text-muted); }

/* ---------- 按钮行 ---------- */
.ft-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-btns .btn { flex: 1 1 30%; min-width: 108px; }

/* ---------- 文件信息卡 ---------- */
.ft-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
}
.ft-file-ico { font-size: 20px; flex: none; }
.ft-file-main { min-width: 0; flex: 1; }
.ft-file-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ft-file-meta { font-size: 11.5px; color: var(--c-text-muted); }

/* ---------- 列表 ---------- */
.ft-list { list-style: none; margin: 0; padding: 0; }
.ft-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--c-border);
    font-size: 12.5px;
}
.ft-item:last-child { border-bottom: none; }
.ft-item-i {
    width: 20px;
    flex: none;
    text-align: center;
    font-size: 11px;
    color: var(--c-text-muted);
}
.ft-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-text);
}
.ft-item-size {
    flex: none;
    font-variant-numeric: tabular-nums;
    color: var(--c-text-sub);
    font-weight: 700;
}
.ft-item-pct {
    flex: none;
    width: 46px;
    text-align: right;
    font-size: 11.5px;
    color: var(--c-text-muted);
}

/* ---------- 占比条 ---------- */
.ft-bar {
    height: 8px;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.ft-bar > i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #0096dc, #38bdf8);
    transition: width 0.35s ease;
}

/* ---------- 进度 ---------- */
.ft-progress {
    height: 10px;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    overflow: hidden;
    margin: 10px 0;
}
.ft-progress > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #0096dc, #38bdf8);
    transition: width 0.12s linear;
}

/* ---------- 十六进制视图 ---------- */
.ft-hex {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    max-height: 460px;
    overflow: auto;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface-soft);
    padding: 10px 0;
}
.ft-hex-row { display: flex; gap: 12px; padding: 0 12px; white-space: pre; }
.ft-hex-row:hover { background: rgba(0, 150, 220, 0.08); }
.ft-hex-off { color: var(--c-text-muted); }
.ft-hex-bytes { color: var(--c-text-sub); }
.ft-hex-b b { color: #0a7fc0; font-weight: 700; }
.ft-hex-asc { color: var(--c-text-muted); }
.ft-hex-zero { color: rgba(120, 130, 145, 0.45); }

/* ---------- 预览块 ---------- */
.ft-preview {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--c-text-sub);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 380px;
    overflow: auto;
}
.ft-preview img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    margin: 0 auto;
    border-radius: 8px;
}

/* ---------- 空态 ---------- */
.ft-empty {
    padding: 22px 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--c-text-muted);
}

/* ---------- 小标签 ---------- */
.ft-chip {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    font-size: 11.5px;
    color: var(--c-text-sub);
}

@media (max-width: 620px) {
    .ft-btns .btn { flex: 1 1 100%; }
}

[data-theme="dark"] .ft-hex-b b { color: #58bdf0; }
