/* 临时文件库 · 控制台管理页（app/tmpfiles.py）。颜色只用 tokens.css 的变量（UI 门禁）。 */
[hidden] { display: none !important; }
body { background: var(--canvas); }
.tf-app { max-width: 1400px; margin: 0 auto; padding: 20px 16px 72px; color: var(--ink); }
.tf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tf-head h1 { margin: 0 0 6px; font-size: 22px; }
.tf-head p { margin: 0; max-width: 820px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tf-usage { min-width: 220px; font-size: 12px; color: var(--muted); }
.tf-usage .bar { height: 6px; background: var(--surface-sunken); border-radius: var(--radius-full); margin-top: 4px; }
.tf-usage .bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); }
.tf-usage .bar i.warn { background: var(--warning-fg); }
.tf-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tf-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tf-btn { white-space: nowrap; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; line-height: 1.4; }
.tf-btn:hover { background: var(--surface-hover); }
.tf-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.tf-btn.primary:hover { background: var(--accent-hover); }
.tf-btn.danger { color: var(--danger-fg); }
.tf-btn.small { padding: 3px 9px; font-size: 12px; }
.tf-btn:disabled { opacity: .6; cursor: default; }

.tf-soon { margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--warning-border); background: var(--warning-bg); border-radius: var(--radius-md); font-size: 13px; line-height: 1.7; }
.tf-soon b { color: var(--warning-fg); }
.tf-soon ul { margin: 4px 0 0; padding-left: 18px; }

.tf-main { display: grid; grid-template-columns: 240px 1fr; gap: 14px; margin-top: 14px; align-items: start; }
@media (max-width: 860px) { .tf-main { grid-template-columns: 1fr; } }
/* 2026-10-01 文件夹一多就比一屏高，吸顶后底下的够不着：限高、自己滚 */
.tf-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.tf-side-head { display: flex; justify-content: space-between; align-items: center; }
.tf-folders { list-style: none; margin: 10px 0 0; padding: 0; }
.tf-folders li { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.tf-folders li:hover { background: var(--surface-hover); }
.tf-folders li[aria-current="true"] { background: var(--surface-selected); font-weight: 600; }
.tf-folders li.tf-folders-sep { cursor: default; font-size: 12px; color: var(--muted); padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0; }
.tf-folders li.tf-folders-sep:hover { background: none; }
.tf-scope { margin: 6px 0 0 !important; font-size: 12px !important; color: var(--accent-soft-fg) !important; }
.tf-folders li small { display: block; color: var(--muted); font-size: 12px; font-weight: normal; }

.tf-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; min-width: 0; }
.tf-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tf-panel h2 { margin: 0; font-size: 18px; }
.tf-panel h3 { margin: 20px 0 8px; font-size: 15px; }
.tf-panel h3 small { font-weight: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }

.tf-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; margin-top: 12px; border: 2px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-sunken); cursor: pointer; text-align: center; padding: 12px; }
.tf-drop.over { border-color: var(--accent); background: var(--accent-soft-bg); }
.tf-drop input { display: none; }
.tf-drop b { font-size: 15px; color: var(--accent); }
.tf-drop span { font-size: 12px; color: var(--muted); }
.tf-drop .tf-paste { font-size: 13px; color: var(--ink-2); }
.tf-drop kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); font: 600 12px/18px var(--font-sans); color: var(--ink); }
.tf-queue { list-style: none; margin: 8px 0 0; padding: 0; }
.tf-queue li { padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.tf-queue .nm { display: flex; justify-content: space-between; gap: 8px; }
.tf-queue .st { color: var(--muted); white-space: nowrap; }
.tf-queue .st.ok { color: var(--success-fg); }
.tf-queue .st.err { color: var(--danger-fg); }
.tf-bar { height: 5px; background: var(--surface-sunken); border-radius: var(--radius-full); margin-top: 4px; }
.tf-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--radius-full); transition: width .2s; }

.tf-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tf-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-sunken); text-align: left; font-weight: 600; color: var(--ink-2); padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.tf-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tf-table td.name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tf-table td.who { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tf-table td.wrap { white-space: normal; }
.tf-table td.acts { white-space: nowrap; text-align: right; }
.tf-table td.muted, .tf-table .muted { color: var(--muted); }
.tf-table tr.soon td { background: var(--warning-bg); }
.tf-table .left.soon { color: var(--warning-fg); font-weight: 600; }
.tf-table .zero { color: var(--text-disabled); }
.tf-table.small { font-size: 12px; }
.tf-empty { color: var(--muted); text-align: center; padding: 18px 8px !important; }
.tf-src { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: var(--radius-full); background: var(--info-bg); color: var(--info-fg); margin-right: 2px; }

.tf-linkform { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 13px; }
.tf-linkform input[type=text], .tf-linkform input:not([type]) { flex: 1; min-width: 220px; padding: 6px 10px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); font: inherit; }
.tf-linkform select { font: inherit; padding: 3px 6px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); }
.tf-links { margin-top: 10px; display: grid; gap: 8px; }
.tf-link { border: 1px solid var(--accent-soft-border); background: var(--accent-soft-bg); border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px; line-height: 1.7; }
.tf-link.dead { border-color: var(--border); background: var(--surface-sunken); color: var(--muted); }
.tf-link .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.tf-link .top b { font-size: 14px; }
.tf-link code { font-family: var(--font-mono); background: var(--surface); padding: 1px 6px; border-radius: var(--radius-sm); word-break: break-all; user-select: all; }
.tf-link .pw { font-family: var(--font-mono); font-size: 15px; font-weight: 700; letter-spacing: .1em; }
.tf-tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: var(--radius-full); margin-left: 4px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); }
.tf-tag.ok { color: var(--success-fg); border-color: var(--success-border); }
.tf-tag.off { color: var(--muted); }

.tf-events, .tf-gone, .tf-rules { margin-top: 16px; }
.tf-events summary, .tf-gone summary, .tf-rules summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; }
.tf-gone, .tf-rules { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 14px; }
.tf-rules ul { margin: 4px 0 8px; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.tf-mini { width: 22px; height: 22px; object-fit: cover; border-radius: var(--radius-sm); vertical-align: middle; margin-right: 6px; background: var(--surface-sunken); }

/* 老板 10-04：可视化——数字卡、用量条、「还剩几天」条、小标题图标（零件在 shared/viz.css，这里只调位置和宽度） */
#tf-kpis .sqv-kpis { margin: 14px 0 0; }
.tf-usage .sqv-meter { margin-top: 4px; }
.tf-table td.left .sqv-meter { width: 120px; }
.tf-panel h3.tf-h { margin: 20px 0 8px; font-size: 15px; }
.tf-panel h3.tf-h small { margin-left: 6px; }
.tf-link .top .sqv-pill { margin-left: 4px; }
.tf-links .sqv-empty { padding: 16px; }
@media (max-width: 760px) { .tf-table td.left .sqv-meter { width: 84px; } }
.tf-table td.tf-empty { white-space: normal; }
.tf-empty .sqv-empty { padding: 8px; }

/* 老板 10-12：单个文件「🔗 分享」——已分享的按钮淡绿，链接卡就展开在这一行下面 */
.tf-btn.tf-shared { color: var(--success-fg); border-color: var(--success-border); }
.tf-btn.tf-shared.on { background: var(--accent-soft-bg); }
.tf-table tr.tf-share-row td { white-space: normal; background: var(--surface); padding-top: 0; }
.tf-table tr.tf-share-row .tf-link { margin: 0 0 4px; }
.tf-queue .st .tf-btn { margin-left: 6px; }

/* 老板 10-04：「我的上传或下载，能不能让我更方便地去管理」——勾选批量、链接卡开关、同事的空文件夹收起 */
.tf-table th.ck, .tf-table td.ck { width: 28px; padding-right: 0; }
.tf-table input[type=checkbox] { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--accent); }
.tf-table tr.picked td { background: var(--accent-soft-bg); }
.tf-bulk { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 13px; }
.tf-bulk.on { border-color: var(--accent-soft-border); background: var(--accent-soft-bg); position: sticky; top: 0; z-index: 3; }
.tf-bulk .tf-note { margin: 0; }
.tf-sw { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 9px 1px 6px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; user-select: none; }
.tf-sw:hover { border-color: var(--border-strong); }
.tf-sw.on { color: var(--success-fg); border-color: var(--success-border); }
.tf-sw input { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.tf-link .top .tf-btn.small { margin-left: 6px; padding: 1px 8px; }
.tf-folders li.tf-folders-more { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.tf-folders li.idle { padding: 5px 10px 5px 18px; font-size: 13px; color: var(--ink-2); }
.tf-folders li.idle small { font-size: 11px; }
/* 窄一点的屏（侧栏 + 1400 宽窗口）表格比面板宽 100 多 px，右边「再留 / 删除」被挤出去：谁传的、还剩两列收窄，悬停看全 */
@media (max-width: 1300px) {
  .tf-table td.who { max-width: 110px; }
  .tf-table td.name { max-width: 240px; }
  .tf-table td.left .sqv-meter { width: 80px; }
  .tf-table td.acts .tf-btn.small { padding: 3px 6px; }
}
/* 窄窗口（≤860，文件夹栏挪到上面一列）：文件夹栏别再吸顶，不然往下滚会盖住文件表；表里收掉「上传时间」「下载次数」两列（悬停文件名、看记录都还有） */
@media (max-width: 860px) {
  .tf-side { position: static; max-height: none; }
  .tf-table:not(.small) th:nth-child(5), .tf-table:not(.small) td:nth-child(5),
  .tf-table:not(.small) th:nth-child(7), .tf-table:not(.small) td:nth-child(7) { display: none; }
  .tf-table td.name { max-width: 160px; }
  .tf-table td.who { max-width: 90px; }
}
/* 手机（≤640）：只留 勾选 · 文件名 · 大小 · 按钮，按钮放不下就折到第二行（不让整页左右滑） */
@media (max-width: 640px) {
  .tf-table:not(.small) th:nth-child(4), .tf-table:not(.small) td:nth-child(4),
  .tf-table:not(.small) th:nth-child(6), .tf-table:not(.small) td:nth-child(6) { display: none; }
  .tf-table td.name { max-width: 120px; }
  .tf-table td.acts { white-space: normal; }
  .tf-table td.acts .tf-btn.small { margin: 2px 0; }
  .tf-table td.acts button[data-extend] { display: none; }   /* 手机上「再留」用勾选后上面那条，行里省一个按钮 */
}
