/* Group files: a dense file-manager list with a 320px detail panel.
   Scoped to .gfiles-*; only existing global tokens are consumed. */
.group-frame #group-files::before { --icon: url('/honghub/assets/vendor/tabler/folders.svg?v=d73d59753b58a5724d017a4e67a0b98fdf4134ba356100ba21e5bef961f43cf2'); }

.gfiles-dialog {
  --gf-accent: #18765B;
  --gf-accent-hover: #11634C;
  --gf-accent-soft: #E7F2EC;
  --gf-selected: #E8F5EE;
  --gf-ink: #16241C;
  --gf-ink-2: #3D4A43;
  --gf-muted: #5F6B64;
  --gf-line: #DFE5E1;
  --gf-line-strong: #CBD8D0;
  --gf-surface: #FFFFFF;
  --gf-subtle: #F7F8F6;
  --gf-hover: #EDF1ED;
  --gf-danger: #A33A32;
  --gf-danger-soft: #FBEFED;
  --gf-warn: #8A5A10;
  --gf-warn-soft: #FBF3E2;
  width: min(960px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--gf-line);
  border-radius: 10px;
  background: var(--gf-surface);
  color: var(--gf-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 22px;
  box-shadow: 0 16px 48px rgb(35 37 31 / 16%);
  overflow: hidden;
  box-sizing: border-box;
}
.gfiles-dialog[open] { display: flex; flex-direction: column; }
.gfiles-dialog::backdrop { background: rgb(24 22 18 / 32%); }
.gfiles-dialog *,
.gfiles-dialog *::before,
.gfiles-dialog *::after { box-sizing: border-box; }
.gfiles-dialog [hidden] { display: none !important; }
.gfiles-dialog svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.gfiles-dialog :focus-visible { outline: 2px solid var(--gf-accent); outline-offset: 2px; }
.gfiles-dialog button { font: inherit; cursor: pointer; }
.gfiles-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- panel chrome */
.gfiles-header {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px; padding: 0 24px;
  border-bottom: 1px solid var(--gf-line);
  background: var(--gf-surface);
  flex: none;
}
.gfiles-heading { min-width: 0; flex: 1; }
.gfiles-heading h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0; }
.gfiles-subtitle { margin: 0; font-size: 12px; line-height: 18px; color: var(--gf-muted); }
.gfiles-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.gfiles-primary,
.gfiles-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 0 14px; border-radius: 6px;
  font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap;
}
.gfiles-primary { border: 1px solid var(--gf-accent); background: var(--gf-accent); color: #FFFFFF; }
.gfiles-primary:hover:not(:disabled) { background: var(--gf-accent-hover); border-color: var(--gf-accent-hover); }
.gfiles-primary:disabled { opacity: .5; cursor: not-allowed; }
.gfiles-secondary { border: 1px solid var(--gf-line-strong); background: var(--gf-surface); color: var(--gf-ink); font-weight: 500; }
.gfiles-secondary:hover:not(:disabled) { background: var(--gf-hover); }
.gfiles-icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--gf-muted); font-size: 18px; line-height: 1;
}
.gfiles-icon-button:hover { background: var(--gf-hover); color: var(--gf-ink); }
.gfiles-icon-button svg { width: 16px; height: 16px; }

.gfiles-toolbar {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; padding: 0 24px;
  border-bottom: 1px solid var(--gf-line);
  background: var(--gf-surface);
  flex: none;
}
.gfiles-search {
  display: flex; align-items: center; gap: 6px;
  width: 280px; max-width: 100%; height: 32px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--gf-line-strong); border-radius: 6px;
  background: var(--gf-surface);
  flex: none;
}
.gfiles-search:focus-within { border-color: var(--gf-accent); }
.gfiles-search-icon { display: inline-flex; color: var(--gf-muted); }
.gfiles-search-icon svg { width: 16px; height: 16px; }
.gfiles-search input {
  width: 100%; min-width: 0; height: 30px; padding: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--gf-ink); font: inherit; font-size: 13px;
}
.gfiles-search input::-webkit-search-cancel-button { appearance: none; }
.gfiles-search input::placeholder { color: var(--gf-muted); opacity: 1; }
.gfiles-search-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--gf-muted); font-size: 16px; line-height: 1;
}
.gfiles-search-clear:hover { background: var(--gf-hover); color: var(--gf-ink); }
.gfiles-chips {
  display: flex; align-items: center; gap: 20px;
  min-width: 0; flex: 1;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.gfiles-chips::-webkit-scrollbar { display: none; }
.gfiles-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  height: 54px; padding: 0; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--gf-muted); font-size: 13px; line-height: 20px;
  white-space: nowrap; flex: none;
}
.gfiles-chip:hover { color: var(--gf-ink); }
.gfiles-chip[aria-pressed="true"] { color: var(--gf-ink); border-bottom-color: var(--gf-accent); font-weight: 600; }
.gfiles-chip[aria-disabled="true"] { color: #6B766F; cursor: default; }
.gfiles-chip[aria-disabled="true"]:hover { color: #6B766F; }
.gfiles-chip-count { font-size: 11px; font-weight: 400; color: var(--gf-muted); font-variant-numeric: tabular-nums; }
.gfiles-chip[aria-pressed="true"] .gfiles-chip-count { color: var(--gf-ink-2); }
.gfiles-chip[aria-disabled="true"] .gfiles-chip-count { color: #7C8780; }
.gfiles-sort { flex: none; margin-left: auto; }
.gfiles-sort select {
  height: 32px; padding: 0 26px 0 10px;
  border: 1px solid var(--gf-line-strong); border-radius: 6px;
  background: var(--gf-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%235F6B64' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  color: var(--gf-ink); font: inherit; font-size: 13px;
  appearance: none; cursor: pointer;
}
.gfiles-sync {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; margin: 0; padding: 0 24px;
  border-bottom: 1px solid var(--gf-line);
  background: var(--gf-surface);
  color: var(--gf-muted); font-size: 12px; line-height: 18px;
  flex: none;
}
.gfiles-sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gf-accent); flex: none; }
.gfiles-sync[data-state="warn"] { color: var(--gf-warn); }
.gfiles-sync[data-state="warn"] .gfiles-sync-dot { background: var(--gf-warn); }
.gfiles-sync[data-state="busy"] .gfiles-sync-dot { background: var(--gf-warn); }
.gfiles-sync[data-state="error"] { color: var(--gf-danger); }
.gfiles-sync[data-state="error"] .gfiles-sync-dot { background: var(--gf-danger); }

/* ------------------------------------------------------------------- body */
.gfiles-body { display: flex; min-height: 0; flex: 1; position: relative; }
.gfiles-listpane { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; }
.gfiles-pool {
  flex: none; padding: 0 24px;
  background: var(--gf-accent-soft);
  border-bottom: 1px solid var(--gf-line);
}
.gfiles-pool .gfiles-pool-row {
  height: 48px; min-height: 48px; padding: 0 16px;
  border-bottom: 0; background: transparent;
}
.gfiles-pool .gfiles-pool-row:hover { background: rgb(255 255 255 / 45%); }
.gfiles-pool .gfiles-pool-row.is-selected { background: rgb(255 255 255 / 60%); box-shadow: inset 3px 0 0 var(--gf-accent); }
.gfiles-pool .gfiles-pool-row .gfiles-row-actions { opacity: 1; }
.gfiles-pool .gfiles-pool-row .gfiles-row-download { display: none; }
.gfiles-pool-note { flex: none; font-size: 12px; color: var(--gf-warn); }
.gfiles-pool .gfiles-secondary { min-height: 28px; padding: 0 10px; font-size: 12px; }

.gfiles-error {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0; padding: 10px 24px;
  background: var(--gf-danger-soft); color: var(--gf-danger);
  font-size: 12px; line-height: 18px;
  border-bottom: 1px solid var(--gf-line);
  flex: none;
}
.gfiles-error [data-gfiles-error-text] { flex: 1; min-width: 0; }
.gfiles-error .gfiles-text-button { flex: none; color: var(--gf-danger); font-weight: 600; }
.gfiles-list {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 24px 8px;
  flex: 1;
}
.gfiles-row {
  display: flex; align-items: center; gap: 12px;
  height: 52px; min-height: 52px; padding: 0 16px;
  border-bottom: 1px solid var(--gf-line);
  background: var(--gf-surface);
  color: var(--gf-ink);
  outline-offset: -2px;
  cursor: default;
}
.gfiles-row:hover { background: var(--gf-hover); }
.gfiles-row.is-selected { background: var(--gf-selected); color: var(--gf-ink); box-shadow: inset 3px 0 0 var(--gf-accent); }
.gfiles-row.is-selected:hover { background: var(--gf-selected); }
.gfiles-type-icon { display: inline-flex; color: var(--gf-muted); flex: none; }
.gfiles-row.is-selected .gfiles-type-icon { color: var(--gf-accent); }
.gfiles-main { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; gap: 1px; }
.gfiles-name {
  display: block; max-width: 100%;
  font-size: 14px; line-height: 20px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gfiles-meta {
  display: block; min-width: 0;
  color: var(--gf-muted); font-size: 12px; line-height: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gfiles-time { flex: none; min-width: 76px; text-align: right; color: var(--gf-muted); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.gfiles-row-actions { display: flex; align-items: center; gap: 2px; flex: none; opacity: 0; }
.gfiles-row:hover .gfiles-row-actions,
.gfiles-row:focus-within .gfiles-row-actions,
.gfiles-row.is-selected .gfiles-row-actions { opacity: 1; }
.gfiles-row-download {
  height: 28px; padding: 0 8px; border: 0; border-radius: 5px;
  background: transparent; color: var(--gf-accent); font-size: 12px; font-weight: 600;
}
.gfiles-row-download:hover { background: rgb(24 118 91 / 10%); }
.gfiles-row .gfiles-icon-button { width: 28px; height: 28px; color: var(--gf-muted); }

.gfiles-skeleton-row {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 16px; border-bottom: 1px solid var(--gf-line);
}
.gfiles-skeleton-row span { display: block; height: 10px; border-radius: 4px; background: var(--gf-hover); animation: gfiles-pulse 1.4s ease-in-out infinite; }
.gfiles-skeleton-row span:first-child { width: 18px; height: 18px; border-radius: 4px; }
.gfiles-skeleton-row span:last-child { width: min(46%, 320px); }
@keyframes gfiles-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .gfiles-skeleton-row span { animation: none; } }

.gfiles-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 260px; padding: 40px 24px; text-align: center;
  color: var(--gf-muted);
}
.gfiles-empty-icon { display: inline-flex; color: var(--gf-muted); }
.gfiles-empty-icon svg { width: 24px; height: 24px; }
.gfiles-empty b { color: var(--gf-ink); font-size: 14px; font-weight: 600; }
.gfiles-empty p { margin: 0 0 10px; font-size: 12px; line-height: 18px; max-width: 520px; }
.gfiles-empty-error .gfiles-empty-icon { color: var(--gf-danger); }
.gfiles-empty-error b { color: var(--gf-danger); }

/* ----------------------------------------------------------------- detail */
.gfiles-detail {
  display: flex; flex-direction: column;
  width: 320px; min-width: 0; min-height: 0;
  border-left: 1px solid var(--gf-line);
  background: var(--gf-surface);
  flex: none;
}
.gfiles-detail-empty { padding: 40px 20px; color: var(--gf-muted); font-size: 13px; text-align: center; }
.gfiles-detail-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--gf-line); background: var(--gf-surface); flex: none; }
.gfiles-detail-bar { display: flex; align-items: flex-start; gap: 6px; }
.gfiles-detail-back { display: none; width: 28px; height: 28px; margin: 0 0 0 -6px; }
.gfiles-detail-title {
  margin: 0; min-width: 0; flex: 1;
  font-size: 16px; line-height: 24px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.gfiles-detail-sub { margin: 4px 0 0; color: var(--gf-muted); font-size: 12px; line-height: 18px; }
.gfiles-detail-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.gfiles-detail-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 24px; flex: 1; }
.gfiles-detail-meta { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 10px; margin: 0; }
.gfiles-detail-meta > div { display: contents; }
.gfiles-detail-meta dt { color: var(--gf-muted); font-size: 12px; line-height: 18px; }
.gfiles-detail-meta dd { margin: 0; color: var(--gf-ink); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gfiles-detail-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gf-line); }
.gfiles-detail-section h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 600; }
.gfiles-section-count { color: var(--gf-muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.gfiles-versions { margin: 0; padding: 0; list-style: none; }
.gfiles-versions li { display: flex; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--gf-line); }
.gfiles-versions li:last-child { border-bottom: 0; }
.gfiles-version-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gf-line-strong); flex: none; }
.gfiles-versions li.is-current .gfiles-version-dot { background: var(--gf-accent); }
.gfiles-version-number { flex: none; width: 36px; color: var(--gf-ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.gfiles-versions time { min-width: 0; flex: 1; color: var(--gf-muted); font-size: 12px; line-height: 18px; }
.gfiles-version-download { width: 28px; height: 28px; }
.gfiles-version-skeleton { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.gfiles-version-skeleton span { display: block; height: 12px; border-radius: 4px; background: var(--gf-hover); animation: gfiles-pulse 1.4s ease-in-out infinite; }
.gfiles-version-skeleton span:nth-child(2) { width: 82%; }
.gfiles-version-skeleton span:nth-child(3) { width: 64%; }
.gfiles-verify-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gfiles-verify { display: inline-flex; align-items: center; gap: 5px; color: var(--gf-muted); font-size: 12px; line-height: 18px; }
.gfiles-verify-icon { display: inline-flex; }
.gfiles-verify-icon svg { width: 14px; height: 14px; }
.gfiles-verify.is-checking { color: var(--gf-warn); }
.gfiles-verify.is-pass { color: var(--gf-accent-hover); font-weight: 600; }
.gfiles-verify.is-fail { color: var(--gf-danger); font-weight: 500; }
.gfiles-text-button {
  padding: 0 2px; border: 0; background: transparent;
  color: var(--gf-accent); font-size: 12px; line-height: 18px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
}
.gfiles-text-button:hover { color: var(--gf-accent-hover); }
.gfiles-hash { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.gfiles-hash code {
  display: block; min-width: 0; flex: 1; padding: 5px 8px;
  border-radius: 4px; background: var(--gf-subtle);
  color: var(--gf-ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gfiles-permission {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 16px 0 0; padding: 8px 10px; border-radius: 6px;
  background: var(--gf-subtle); color: var(--gf-muted);
  font-size: 12px; line-height: 18px;
}
.gfiles-permission-icon { display: inline-flex; padding-top: 1px; }
.gfiles-permission-icon svg { width: 14px; height: 14px; }
.gfiles-inline-error { color: var(--gf-muted); font-size: 12px; line-height: 18px; }
.gfiles-inline-error p { margin: 0 0 4px; }
.gfiles-muted { color: var(--gf-muted); font-size: 12px; line-height: 18px; }

/* ------------------------------------------------------------------- menu */
.gfiles-menu {
  position: fixed; z-index: 40;
  width: 220px; max-height: min(360px, calc(100dvh - 24px));
  overflow-y: auto; padding: 8px;
  border: 1px solid var(--gf-line); border-radius: 8px;
  background: var(--gf-surface); color: var(--gf-ink);
  box-shadow: 0 8px 24px rgb(35 37 31 / 10%);
}
.gfiles-menu button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; min-height: 32px; padding: 6px 10px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--gf-ink); font-size: 13px; line-height: 20px; text-align: left;
}
.gfiles-menu button:hover,
.gfiles-menu button:focus-visible { background: var(--gf-hover); outline: 0; }
.gfiles-menu button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.gfiles-menu button[aria-disabled="true"]:hover { background: transparent; }
.gfiles-menu button small { color: var(--gf-muted); font-size: 11px; line-height: 16px; font-weight: 400; }
.gfiles-menu-sep { height: 1px; margin: 6px 4px; background: var(--gf-line); }

/* ---------------------------------------------------------------- footer */
.gfiles-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 0 24px;
  border-top: 1px solid var(--gf-line);
  background: var(--gf-surface);
  color: var(--gf-muted); font-size: 12px; line-height: 18px;
  flex: none;
}
.gfiles-footer [data-gfiles-total] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.gfiles-dialog.is-dragging .gfiles-listpane { outline: 2px dashed var(--gf-accent); outline-offset: -6px; background: var(--gf-accent-soft); }

/* --------------------------------------------------------- drawer / narrow */
.gfiles-dialog[data-layout="overlay"] .gfiles-detail {
  position: absolute; inset: 0 0 0 auto; z-index: 3;
  width: min(360px, 100%);
  border-left: 1px solid var(--gf-line);
  box-shadow: -12px 0 32px rgb(35 37 31 / 10%);
}
.gfiles-dialog[data-layout="overlay"] .gfiles-detail-back { display: inline-flex; }
.gfiles-dialog[data-layout="overlay"] .gfiles-listpane { width: 100%; }
.gfiles-dialog[data-layout="split"] .gfiles-detail-back { display: none; }

@media (max-width: 911px) {
  .gfiles-detail { border-left: 0; }
}
@media (max-width: 760px) {
  .gfiles-dialog {
    width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh;
    margin: 0; border: 0; border-radius: 0;
  }
  .gfiles-header { padding: 0 16px; min-height: 64px; }
  .gfiles-toolbar { min-height: 56px; padding: 8px 16px; flex-wrap: wrap; gap: 8px 12px; }
  .gfiles-search { width: auto; flex: 1 1 100%; }
  .gfiles-chips { order: 3; flex: 1 1 100%; }
  .gfiles-chip { height: 36px; }
  .gfiles-sort { order: 2; margin-left: 0; }
  .gfiles-sync { padding: 0 16px; }
  .gfiles-pool { padding: 0 16px; }
  .gfiles-list { padding: 0 16px 8px; }
  .gfiles-row { padding: 0 10px; gap: 10px; }
  .gfiles-time { min-width: 64px; }
  .gfiles-row-actions { opacity: 1; }
  .gfiles-row-download { padding: 0 4px; }
  .gfiles-footer { padding: 0 16px; }
  .gfiles-dialog[data-layout="overlay"] .gfiles-detail { width: 100%; box-shadow: none; }
}
@media (max-height: 560px) {
  .gfiles-dialog { height: calc(100dvh - 16px); }
  .gfiles-header { min-height: 56px; }
  .gfiles-toolbar { min-height: 48px; }
  .gfiles-sync { min-height: 34px; }
}