/* 文件在线查看 / 编辑 */
.panel [hidden] { display: none !important; }
.fv-filebar {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 12px 14px;
  background: #f7faf8; border: 1px solid var(--line); border-radius: 10px;
}
.fv-fileicon {
  flex: none; width: 42px; height: 42px; border-radius: 9px;
  display: grid; place-items: center; background: #2b5f8a; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase;
}
.fv-filemeta { flex: 1; min-width: 0; }
.fv-filemeta b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-filemeta small { color: var(--muted); font-size: 12.5px; }
.fv-clear {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.fv-clear:hover { color: var(--red); border-color: rgba(201, 71, 61, .4); }

.fv-workbench { margin-top: 16px; }
.fv-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px;
}
.fv-tabs { display: inline-flex; background: #f1f4f2; border-radius: 9px; padding: 3px; gap: 2px; }
.fv-tab {
  border: 0; background: transparent; color: var(--ink-2); font-size: 13.5px;
  padding: 7px 16px; border-radius: 7px; cursor: pointer; font-family: inherit;
}
.fv-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.fv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fv-action {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  font-family: inherit;
}
.fv-action:hover { border-color: var(--primary); color: var(--primary); }
#fvExtraLink { border-color: rgba(176, 42, 32, .35); color: #b02a20; }

.fv-preview { min-height: 60px; }
.fv-preview img.fv-img {
  display: block; max-width: 100%; max-height: 72vh; margin: 0 auto;
  border-radius: 8px; border: 1px solid #eef0ea; background: #fff;
}
.fv-preview img.fv-img.fv-original { max-height: none; max-width: none; }

.fv-toolrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fv-toolrow .fv-chip {
  font-size: 12px; color: var(--muted); background: #f4f7f5;
  border: 1px solid #e5e9e3; border-radius: 99px; padding: 3px 10px;
}

.fv-textview {
  margin: 0; padding: 16px; max-height: 70vh; overflow: auto;
  background: #fbfbf8; border: 1px solid #e8eae2; border-radius: 9px;
  font: 13px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap; word-break: break-word; color: #1f2a24;
}
.fv-textview.is-srt { background: #fffdf7; }

.fv-md {
  padding: 20px 22px; border: 1px solid #e8eae2; border-radius: 9px;
  background: #fff; max-height: 74vh; overflow: auto; color: var(--ink);
  line-height: 1.8; word-break: break-word;
}
.fv-md h1, .fv-md h2, .fv-md h3, .fv-md h4 { margin: 18px 0 10px; line-height: 1.35; }
.fv-md h1 { font-size: 26px; border-bottom: 1px solid #eceee8; padding-bottom: 8px; }
.fv-md h2 { font-size: 21px; border-bottom: 1px solid #f0f1ec; padding-bottom: 6px; }
.fv-md h3 { font-size: 17px; }
.fv-md h4 { font-size: 15px; }
.fv-md p { margin: 0 0 12px; }
.fv-md ul, .fv-md ol { margin: 0 0 12px; padding-left: 24px; }
.fv-md li { margin-bottom: 4px; }
.fv-md code {
  background: #f2f5f3; border: 1px solid #e7eae5; border-radius: 4px;
  padding: 1px 5px; font-size: .9em; font-family: Consolas, Menlo, monospace;
}
.fv-md pre { background: #f7f9f7; border: 1px solid #e7eae5; border-radius: 8px; padding: 12px 14px; overflow: auto; }
.fv-md pre code { background: none; border: 0; padding: 0; }
.fv-md blockquote {
  margin: 0 0 12px; padding: 6px 14px; border-left: 3px solid #bcd4c8;
  background: #f7faf8; color: var(--ink-2);
}
.fv-md table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13.5px; }
.fv-md th, .fv-md td { border: 1px solid #e5e8e2; padding: 7px 10px; text-align: left; }
.fv-md th { background: #f5f8f6; }
.fv-md hr { border: 0; border-top: 1px solid #e8eae2; margin: 18px 0; }
.fv-md a { text-decoration: underline; text-underline-offset: 2px; }

.fv-tablewrap {
  overflow: auto; max-height: 74vh; border: 1px solid #e5e8e2; border-radius: 9px; background: #fff;
}
.fv-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fv-table th, .fv-table td {
  border-bottom: 1px solid #eef0ea; border-right: 1px solid #f1f3ee;
  padding: 7px 10px; text-align: left; white-space: pre-wrap; vertical-align: top;
  max-width: 420px; word-break: break-word;
}
.fv-table th { position: sticky; top: 0; background: #f5f8f6; font-weight: 600; z-index: 1; }
.fv-table tr:nth-child(even) td { background: #fcfdfb; }
.fv-table td.fv-rownum, .fv-table th.fv-rownum { color: #9aa69f; background: #fafbf9; width: 1%; white-space: nowrap; }

.fv-pdfpages { display: flex; flex-direction: column; gap: 14px; align-items: center; max-height: 78vh; overflow: auto; padding: 4px; background: #f3f4ef; border-radius: 9px; }
.fv-pdfpage { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .09); border-radius: 2px; max-width: 100%; }
.fv-pdfpage canvas { display: block; max-width: 100%; height: auto; }
.fv-pdfmore { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px; }

.fv-media { text-align: center; padding: 16px 0; }
.fv-media video { max-width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }
.fv-media audio { width: min(560px, 100%); }
.fv-audio-art {
  width: 120px; height: 120px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, #2b5f8a, #176b5b);
  display: grid; place-items: center; color: #fff;
}
.fv-audio-art svg { width: 52px; height: 52px; }

.fv-notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 9px; font-size: 13px; line-height: 1.65;
  background: #fff8ec; border: 1px solid #f0dfc0; color: #75552a;
}
.fv-notice.is-ok { background: #eef7f1; border-color: #cfe6d7; color: #1d6146; }
.fv-notice.is-warn { background: #fdf0ef; border-color: #f0d2ce; color: #8d3a32; }
.fv-notice b { display: block; margin-bottom: 2px; }
.fv-notice a { color: inherit; text-decoration: underline; }
.fv-notice + .fv-notice { margin-top: 8px; }

.fv-hex {
  margin-top: 10px; font: 12px/1.75 Consolas, Menlo, monospace;
  background: #fbfbf8; border: 1px solid #e8eae2; border-radius: 8px;
  padding: 12px 14px; overflow: auto; max-height: 320px; white-space: pre;
}

.fv-office-note { margin-bottom: 10px; }
.fv-sheet-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fv-sheet-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font-size: 12.5px; padding: 5px 12px; cursor: pointer; font-family: inherit; color: var(--ink-2);
}
.fv-sheet-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.fv-slides { display: flex; flex-direction: column; gap: 12px; }
.fv-slide { border: 1px solid #e5e8e2; border-radius: 9px; padding: 14px 16px; background: #fff; }
.fv-slide h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.fv-slide p { margin: 0 0 6px; }
.fv-slide p:last-child { margin-bottom: 0; }

.fv-zip { border: 1px solid #e5e8e2; border-radius: 9px; overflow: hidden; }
.fv-zip-head, .fv-zip-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 76px; gap: 8px;
  padding: 9px 12px; font-size: 12.5px; align-items: center;
}
.fv-zip-head { background: #f5f8f6; color: var(--muted); border-bottom: 1px solid #e5e8e2; font-weight: 600; }
.fv-zip-row { border-bottom: 1px solid #f1f3ee; }
.fv-zip-row:last-child { border-bottom: 0; }
.fv-zip-row .fv-zip-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fv-zip-row .fv-zip-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-zip-row button {
  border: 1px solid var(--line); background: #fff; color: var(--primary);
  border-radius: 6px; font-size: 12px; padding: 3px 9px; cursor: pointer; font-family: inherit;
}
.fv-zip-row button:hover { border-color: var(--primary); background: var(--primary-light); }
.fv-zip-row.is-dir { color: var(--muted); }
.fv-zip-preview { margin-top: 12px; }
.fv-zip-preview .fv-zip-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; margin-bottom: 8px; color: var(--ink-2);
}

.fv-editor { border: 1px solid #e5e8e2; border-radius: 9px; overflow: hidden; background: #fff; }
.fv-editbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; background: #f6f8f5; border-bottom: 1px solid #e5e8e2;
}
.fv-stat { font-size: 12px; color: var(--muted); margin-right: auto; }
.fv-encoding { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.fv-encoding select {
  font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink-2);
}
.fv-mini, .fv-save {
  font-family: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.fv-mini:hover { border-color: var(--primary); color: var(--primary); }
.fv-save { background: var(--primary); border-color: var(--primary); color: #fff; }
.fv-save:hover { background: var(--primary-dark); }
#fvText {
  display: block; width: 100%; height: 62vh; min-height: 320px; resize: vertical;
  border: 0; outline: none; padding: 14px 16px; margin: 0;
  font: 13px/1.7 "SFMono-Regular", Consolas, Menlo, monospace;
  color: #1f2a24; background: #fff; white-space: pre; overflow: auto; tab-size: 4;
}
.fv-edittip { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }

.fv-formats { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.fv-formats summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); outline: none; }
.fv-formats summary:hover { color: var(--primary); }
.fv-format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.fv-format-grid div { background: #f8faf8; border: 1px solid #e9ece7; border-radius: 9px; padding: 12px 14px; }
.fv-format-grid b { display: block; font-size: 13px; margin-bottom: 6px; }
.fv-format-grid p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; word-break: break-word; }

@media (max-width: 900px) {
  .fv-format-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .fv-toolbar { align-items: flex-start; }
  .fv-actions { width: 100%; }
  .fv-action { flex: 1; justify-content: center; }
  .fv-fileicon { width: 38px; height: 38px; font-size: 10px; }
  .fv-zip-head, .fv-zip-row { grid-template-columns: minmax(0, 1fr) 74px 64px; }
  .fv-preview img.fv-img { max-height: 56vh; }
  #fvText { height: 56vh; }
  .fv-md { padding: 14px; }
}

/* ---------- 全屏查看 ---------- */
.fv-full-btn { border-color: #bcd4c8; color: var(--primary); }
.fv-full-btn[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.fv-full-btn[aria-pressed="true"]:hover { background: var(--primary-dark); color: #fff; }

.fv-stage:fullscreen,
.fv-stage:-webkit-full-screen {
  box-sizing: border-box;
  width: 100%; height: 100%;
  overflow: auto;
  padding: 14px clamp(14px, 3vw, 40px) 26px;
  background: #fff;
}
.fv-stage.fv-stage--full {
  position: fixed; inset: 0; z-index: 3000;
  box-sizing: border-box;
  overflow: auto;
  padding: 14px clamp(12px, 3vw, 40px) 26px;
  background: #fff;
}
.fv-stage:fullscreen .fv-toolbar,
.fv-stage:-webkit-full-screen .fv-toolbar,
.fv-stage.fv-stage--full .fv-toolbar {
  position: sticky; top: 0; z-index: 6;
  background: #fff; padding-top: 4px;
}
.fv-stage:fullscreen .fv-filebar,
.fv-stage:-webkit-full-screen .fv-filebar,
.fv-stage.fv-stage--full .fv-filebar { margin-top: 4px; }
.fv-stage:fullscreen .fv-preview .fv-md,
.fv-stage:fullscreen .fv-textview,
.fv-stage:fullscreen .fv-tablewrap,
.fv-stage:fullscreen .fv-pdfpages {
  max-height: calc(100vh - 210px);
}
.fv-stage.fv-stage--full .fv-preview .fv-md,
.fv-stage.fv-stage--full .fv-textview,
.fv-stage.fv-stage--full .fv-tablewrap,
.fv-stage.fv-stage--full .fv-pdfpages {
  max-height: calc(100vh - 210px);
}
.fv-stage:fullscreen #fvText,
.fv-stage.fv-stage--full #fvText {
  height: calc(100vh - 250px);
  min-height: 260px;
}
html.fv-fs-lock, html.fv-fs-lock body { overflow: hidden; }


