/*
 * 本文件用于给 Word 转 PDF 的上传页和任务页提供样式：顶栏、负载、选文件区域、上传进度、
 * 上传提示、说明区的字体替换表、任务状态和按钮。配色和字体用 /shared/base.css 里的变量。
 */

.topbar { border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
.topbar h1 { margin: 0; font-size: 17px; }
.topbar a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px; border-radius: 50%; color: var(--color-text-muted); }
.topbar a:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }

.layout { max-width: 640px; padding-block: 16px 40px; }
@media (min-width: 760px) {
  .layout { padding-block: 32px 48px; }
}

.card { padding: 16px; border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface); }
@media (min-width: 480px) {
  .card { padding: 24px; }
}

/* 下面的类会设 display，盖过 hidden 属性；这里让 hidden 始终生效 */
[hidden] { display: none !important; }

/* ---------- 按钮 ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.button-primary { background: var(--color-accent); color: var(--color-accent-contrast); font-weight: 600; }
.button-primary:hover { background: color-mix(in srgb, var(--color-accent) 88%, black); }
.button-secondary { border-color: var(--color-border); background: var(--color-bg); color: var(--color-text); }
.button-secondary:hover { border-color: var(--color-accent); }
.button-plain { min-height: var(--tap-min); padding: 0 8px; border: 0; background: none; color: var(--color-text-muted); font-size: 15px; text-decoration: underline; cursor: pointer; }
.button-plain:hover { color: var(--color-accent); }

/* ---------- 上传页 ---------- */

/* 负载图标：三根柱子按档位亮一到三根，低绿、中橙、高红 */
.load { --load-color: #1f9d55; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--color-text-muted); font-size: 14px; }
.load.is-medium { --load-color: #d97706; }
.load.is-high { --load-color: var(--color-accent); }
@media (prefers-color-scheme: dark) {
  .load { --load-color: #4ade80; }
  .load.is-medium { --load-color: #fbbf24; }
}
.load svg { flex: none; }
.load .is-on { fill: var(--load-color); }
.load .is-off { fill: var(--color-border); }

/*
 * 选文件区域整块可点。文件框本身盖在区域上、完全透明：
 * 键盘 Tab 能停在它上面，回车或空格打开选文件窗口，不会提交或刷新页面。
 */
.dropzone { position: relative; border: 2px dashed var(--color-border); border-radius: 16px; background: var(--color-bg); transition: border-color 0.15s, background 0.15s; }
.dropzone:hover,
.dropzone.is-dragging { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 6%, var(--color-bg)); }
.dropzone.is-busy { opacity: 0.6; pointer-events: none; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:has(.file-input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.dropzone-label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; color: var(--color-accent); text-align: center; pointer-events: none; }
.dropzone-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); font-size: 19px; font-weight: 700; }
.dropzone-hint { color: var(--color-text-muted); font-size: 14px; }
/* 手机上拖不了文件，「拖到这里」只在能用鼠标的设备上显示 */
@media (hover: none) {
  .drop-only { display: none; }
}

.wechat-tip { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--color-focus) 10%, transparent); font-size: 14px; }

.selected { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.selected #upload-button { width: 100%; min-height: 54px; border-radius: 14px; font-size: 18px; letter-spacing: 0.3em; text-indent: 0.3em; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.upload-status { margin-top: 16px; }
.upload-name { margin: 0 0 8px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: var(--color-bg); }
.progress-bar { width: 0; height: 100%; background: var(--color-accent); transition: width 0.2s; }
.upload-text { margin: 8px 0 0; color: var(--color-text-muted); font-size: 14px; }

.upload-error { margin: 16px 0 0; color: var(--color-accent); font-weight: 600; }

.upload-tips { margin: 16px 0 0; padding: 12px 14px 12px 30px; border-radius: 12px; background: var(--color-bg); color: var(--color-text-muted); font-size: 14px; }
.upload-tips li + li { margin-top: 4px; }
.upload-tips b { color: var(--color-text); }
.upload-tips a { color: var(--color-accent); }

/* ---------- 说明区的字体替换表 ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 12px; }
.fonts-table { width: 100%; max-width: 42em; border-collapse: collapse; font-size: 14px; }
.fonts-table th, .fonts-table td { padding: 8px 10px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.fonts-table th { color: var(--color-text); font-weight: 600; }
.fonts-table td:last-child { color: var(--color-text); white-space: nowrap; }

.recent { margin: 12px 0 0; font-size: 14px; }
.recent a { display: inline-flex; align-items: center; min-height: var(--tap-min); color: var(--color-accent); word-break: break-all; }

/* ---------- 任务页 ---------- */

.job-file { margin: 0 0 4px; overflow: hidden; font-size: 18px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.job-status { min-height: 120px; }
.job-state { margin: 12px 0 0; font-size: 22px; font-weight: 700; }
.job-state.is-done { color: var(--color-accent); }
.job-detail { margin: 6px 0 0; color: var(--color-text-muted); }
.job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.job-hint { margin: 12px 0 0; color: var(--color-text-muted); font-size: 14px; }
.job-countdown { margin: 16px 0 0; font-size: 14px; color: var(--color-text-muted); }
.job-countdown b { color: var(--color-text); font-variant-numeric: tabular-nums; }

/* 排队和转换中的进度条：不知道确切进度，来回滑动 */
.spinner-bar { position: relative; height: 6px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: var(--color-bg); }
.spinner-bar::after { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: inherit; background: var(--color-accent); content: ""; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.share { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.share-note { margin: 4px 0 0; color: var(--color-text-muted); font-size: 14px; }
.copy-fallback { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg); font-size: 14px; }
