/* ============================================================
   markserver — 保留的 CSS（JS 动态生成 / Tailwind 无法替代）
   ============================================================ */

/* ---- Elevation shadows (design tokens) ---- */
.elevation-1 {
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* ---- Pseudo-element arrows (Tailwind cannot do ::after content) ---- */
.multi-select-trigger::after {
  content: '▾'; float: right; margin-left: 8px; font-size: 11px; color: #a1a1aa;
}
.multi-select-trigger.open::after { content: '▴'; }

/* ---- Menu item active highlight bar (Tailwind cannot do ::after positioning) ---- */
.menu-item-active::after {
  content: ''; position: absolute; right: 0; top: 4px; bottom: 4px;
  width: 3px; background: #14b8a6; border-radius: 2px;
}

/* ---- Multi-select dropdown positioning ---- */
.multi-select-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 100;
  background: #fff; border: 1px solid #e4e4e7; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  margin-top: 4px; max-height: 420px; min-width: 340px;
  display: flex; flex-direction: column;
  width: max-content; max-width: min(90vw, 900px);
}

/* ---- Multi-select options (overrides for column layout) ---- */
.multi-select-options { overflow: hidden; padding: 0; }

/* ---- Column container ---- */
.column-container { display: flex; overflow-x: auto; overflow-y: hidden; align-items: flex-start; min-height: 200px; }

/* ---- Menu column layout ---- */
.menu-column {
  min-width: 180px; max-width: 240px; border-right: 1px solid #e4e4e7;
  padding: 4px 0; overflow-y: auto; max-height: 380px; flex-shrink: 0;
}
.menu-column:last-child { border-right: none; }

/* ---- Menu items (generated by filters.js) ---- */
.menu-item {
  display: flex; align-items: center; padding: 4px 8px; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background .1s; position: relative;
  border-radius: 4px;
}
.menu-item:hover { background: #f0fdfa; }
.menu-item .menu-arrow {
  margin-left: auto; font-size: 10px; color: #a1a1aa; flex-shrink: 0; padding-left: 8px;
}
.menu-item .tree-leaf-checkbox, .menu-item .tree-parent-checkbox {
  width: 16px; height: 16px; margin: 0 6px 0 0; flex-shrink: 0; accent-color: #14b8a6; cursor: pointer;
}
.menu-item-active { background: #ccfbf1 !important; font-weight: 600; }

/* ---- Tree checkboxes (generated by filters.js) ---- */
.tree-leaf-checkbox { width: 16px; height: 16px; margin: 0 6px 0 0; flex-shrink: 0; accent-color: #14b8a6; cursor: pointer; }
.tree-parent-checkbox { width: 16px; height: 16px; margin: 0 6px 0 0; flex-shrink: 0; accent-color: #14b8a6; cursor: pointer; }
.tree-label {
  flex: 1; padding: 3px 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; line-height: 20px;
}

/* ---- Multi-select actions (generated by filters.js) ---- */
.multi-select-actions { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid #e4e4e7; background: #fff; flex-shrink: 0; border-radius: 0 0 8px 8px; }
.multi-select-btn { flex: 1; padding: 6px 0; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; transition: background .15s; }
.multi-select-btn-apply { background: #14b8a6; color: #fff; }
.multi-select-btn-apply:hover { background: #0d9488; }
.multi-select-btn-clear { background: #f4f4f5; color: #52525b; }
.multi-select-btn-clear:hover { background: #e4e4e7; }

/* ---- Focus-visible rings for keyboard navigation (design §7.1) ---- */
.stat-update-btn:focus-visible,
.page-btn:focus-visible,
.url-icon-btn:focus-visible,
.copy-path-btn:focus-visible,
.menu-item:focus-visible,
.multi-select-btn:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 1px;
}
.multi-select-trigger:focus-visible,
select:focus-visible,
input[type="text"]:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 1px;
}

/* ---- Stat update button (positioned absolute within stat-card) ---- */
.stat-update-btn {
  position: absolute; top: 15px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; opacity: 0.55; padding: 2px; line-height: 1;
  transition: opacity .2s; border-radius: 4px;
}
.stat-update-btn:hover { opacity: 1; }
.stat-update-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- Progress bar fill animation ---- */
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, #14b8a6, #10b981);
  border-radius: 8px; transition: width .3s ease;
}

/* ---- Sort indicator (generated by table.js) ---- */
.sort-indicator {
  display: inline-block; width: 18px; text-align: center;
  font-size: 11px; color: #a1a1aa; margin-left: 2px;
}
th.sortable .sort-indicator { color: #a1a1aa; }
th.sortable.active-sort .sort-indicator { color: #14b8a6; font-weight: bold; }
thead .col-seq { color: inherit; }

/* ---- Page ellipsis (generated by table.js) ---- */
.page-ellipsis { padding: 0 4px; color: #a1a1aa; font-size: 13px; }

/* ---- Title text truncation (generated by table.js) ---- */
.col-title-text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; word-break: break-all;
}

/* ---- Copy path button (generated by table.js) ---- */
.copy-path-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px dashed #16a34a; border-radius: 4px;
  width: 24px; height: 24px; font-size: 14px; cursor: pointer; transition: all .15s;
}
.copy-path-btn:hover { background: #f0fdfa; border-style: solid; }
.copy-path-btn.copied { background: #16a34a; color: #fff; border-color: #16a34a; }

/* ---- URL icon button (generated by table.js) ---- */
.url-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 6px;
  background: transparent; color: #14b8a6; font-size: 18px;
  cursor: pointer; transition: background .15s; text-decoration: none;
}
.url-icon-btn:hover { background: #f0fdfa; }

/* ---- Table row marked state (added by operations.js) ---- */
tr.marked { background: #f0fdfa; }
tr.marked:hover { background: #ccfbf1; }

/* ---- Checkbox (generated by table.js) ---- */
.checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: #14b8a6; }

/* ---- Result items (generated by operations.js) ---- */
.result-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 4px 0; font-size: 12px; border-bottom: 1px solid #f4f4f5;
}
.result-item .r-icon { width: 18px; flex-shrink: 0; font-weight: bold; }
.result-item .r-url { color: #71717a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 350px; }
.r-success { color: #16a34a; }
.r-skip { color: #d97706; }
.r-fail { color: #dc2626; }

/* ---- Pagination (generated by table.js) ---- */
.page-info { font-size: 13px; color: #71717a; }
.page-btns { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid #d4d4d8;
  border-radius: 4px; background: #fff; color: #52525b; font-size: 13px;
  cursor: pointer; transition: all .15s; text-align: center;
}
.page-btn:hover:not(.disabled):not(.current) { background: #f4f4f5; border-color: #d4d4d8; }
.page-btn.current { background: #14b8a6; color: #fff; border-color: #14b8a6; font-weight: 600; }
.page-btn.disabled { opacity: .35; cursor: not-allowed; }

/* ---- Table cells (generated by table.js) ---- */
.col-seq { width: 45px; text-align: center; color: #a1a1aa; font-size: 12px; }
.col-check { width: 40px; text-align: center; }
.col-title { min-width: 200px; max-width: 350px; }
.col-file-type { width: 60px; text-align: center; font-size: 12px; color: #71717a; }
.col-url { max-width: 50px; text-align: center; }
.col-category { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: keep-all; }

/* ---- Table row hover (generated by table.js) ---- */
tbody tr:hover { background: #f8f9ff; }

/* ---- Count badge (generated by filters.js) ---- */
.count-badge {
  margin-left: auto; padding: 0 8px; font-size: 11px;
  background: #f4f4f5; color: #71717a; border-radius: 10px;
  flex-shrink: 0; font-family: 'Geist Mono', monospace;
  line-height: 18px;
}

/* ---- Responsive (max-width: 768px) ---- */
@media (max-width: 768px) {
  .page-btns { justify-content: center; flex-wrap: wrap; }
}
