/* 本地工具 / 随手记 页面样式（工具箱对齐新增） */

/* hidden 属性必须真正隐藏：display 类样式会覆盖 UA 的 [hidden] 规则 */
[hidden] {
  display: none !important;
}

.tool-hero {
  margin-bottom: 28px;
}

.tool-hero h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 8px;
}

.tool-hero .lead {
  color: var(--muted);
  line-height: 1.7;
}

.tool-panel {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(20, 20, 20, 0.04);
}

.t-field {
  margin-bottom: 18px;
}

.t-label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.t-input,
.t-textarea,
.t-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font: inherit;
}

.t-textarea {
  min-height: 140px;
  resize: vertical;
}

.t-textarea-tall {
  min-height: 380px;
}

.t-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.t-row-split {
  justify-content: space-between;
}

.t-row-end {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.t-btn,
.t-btn-ghost {
  display: inline-block;
  border: 1px solid var(--text);
  border-radius: 999px;
  padding: 10px 22px;
  font: inherit;
  cursor: pointer;
  background: var(--text);
  color: var(--bg);
}

.t-btn-ghost {
  background: transparent;
  color: var(--text);
}

.t-btn:disabled,
.t-btn-ghost:disabled {
  opacity: 0.4;
  cursor: default;
}

.t-block {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  margin-bottom: 18px;
}

.t-link {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.t-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  cursor: pointer;
}

.t-tip {
  color: var(--muted);
  font-size: 0.88rem;
}

.t-muted {
  color: var(--muted);
}

.t-note {
  margin-top: 14px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.t-section {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 24px 0 12px;
}

.t-summary {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.t-preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.t-preset {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font: inherit;
}

.t-preset.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.t-margin-row {
  display: flex;
  gap: 10px;
}

.t-margin {
  flex: 1;
}

.t-canvas-box {
  margin-top: 22px;
}

.t-tag-sample {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  vertical-align: 1px;
}

/* 二维码两种版本横排并列、内容居中（宽屏并排，窄屏单列） */
.qr-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.qr-results .t-canvas-box {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-results .t-label {
  text-align: center;
}

.qr-results .t-canvas {
  margin: 2px auto 14px;
  max-width: 100%;
  height: auto;
}

/* 两格等高（网格默认拉齐），下载按钮沉底——两版二维码高矮不一时按钮仍在同一水平线 */
.qr-results .t-btn-ghost {
  margin-top: auto;
}

/* —— 拖拽选文件区（OCR 同款视觉），图片压缩 / Word 排版共用（绑定脚本 tools/js/dropzone.js）—— */
.tp-dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--bg, transparent);
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 156px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  cursor: pointer;
}

.tp-dropzone.is-dragover {
  border-color: var(--btn-accent-border, var(--accent));
  background: var(--accent-soft, rgba(0, 0, 0, 0.04));
}

.tp-dropzone:focus-visible {
  outline: 2px solid var(--btn-accent-border, var(--accent));
  outline-offset: 2px;
}

.tp-dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  width: 100%;
}

.tp-dropzone__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, rgba(0, 0, 0, 0.06));
  color: var(--accent-hover, var(--accent));
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.tp-dropzone__title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.tp-dropzone__pick {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-hover, var(--accent));
  text-decoration: underline;
  cursor: pointer;
}

.tp-dropzone__pick:hover {
  color: var(--accent-hover);
}

.tp-dropzone__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tp-dropzone__hint strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

/* —— 简历：左表单 + 右 A4 实时预览（所见即所得）—— */
.tp-work--form-preview {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.rv-preview-col {
  position: sticky;
  top: 84px;
  align-self: start;
}

.rv-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rv-sheet-frame {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eceef2;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.rv-sheet {
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  padding: 25.4mm 31.75mm;
  background: #fff;
  transform-origin: top left;
  font-family: "Times New Roman", "宋体", "Songti SC", "SimSun", serif;
  font-size: 12pt;
  line-height: 1.5;
  color: #111;
}

.rv-sheet .rv-name {
  margin: 0;
  font-size: 20pt;
  font-weight: 700;
}

.rv-sheet .rv-title {
  margin: 0;
}

.rv-sheet .rv-contact {
  margin: 0 0 6pt;
  color: #555;
}

.rv-sheet h2 {
  margin: 12pt 0 6pt;
  font-size: 14pt;
  font-weight: 700;
}

.rv-sheet .rv-p {
  margin: 0 0 6pt;
}

.rv-sheet .rv-period {
  margin: 0 0 3pt;
  color: #555;
}

.rv-sheet ul {
  margin: 0 0 6pt;
  padding-left: 1.5em;
}

.rv-sheet li {
  margin-bottom: 3pt;
}

.rv-sheet .rv-sheet-empty {
  color: var(--muted);
  font-family: inherit;
  text-align: center;
  margin-top: 40%;
}

.rv-export-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

@media (max-width: 1024px) {
  .tp-work--form-preview {
    grid-template-columns: 1fr;
  }

  .rv-preview-col {
    position: static;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  body * {
    visibility: hidden;
  }

  .rv-sheet,
  .rv-sheet * {
    visibility: visible;
  }

  .rv-sheet-frame {
    position: absolute;
    left: 0;
    top: 0;
    width: auto !important;
    height: auto !important;
    border: none;
    box-shadow: none;
    background: #fff;
  }

  .rv-sheet {
    transform: none !important;
  }
}

.t-canvas {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  max-width: 100%;
  margin-bottom: 10px;
}

.t-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

.t-preview-img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.t-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.t-card-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.t-card-row .t-input {
  flex: 1;
}

.t-remove {
  border: none;
  background: none;
  color: var(--danger, #b3261e);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

/* 随手记主从布局（master-detail）：左列表 + 右编辑，未选中显示引导占位 */
.notes-wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: 520px;
}

.notes-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-side-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
}

.notes-list-empty {
  margin: 0;
  padding: 20px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  text-align: center;
}

.notes-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.notes-item.active {
  border-color: var(--text);
}

.notes-item .notes-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.notes-item .notes-time {
  font-size: 0.78rem;
  color: var(--muted);
}

.notes-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.notes-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.notes-editor .t-row {
  margin-bottom: 14px;
}

.notes-editor .t-textarea-tall {
  flex: 1;
  min-height: 360px;
}

.notes-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
}

.notes-placeholder h2 {
  margin: 0;
  font-size: 1.15rem;
}

.notes-placeholder-icon {
  width: 46px;
  height: 46px;
  color: var(--muted);
}

.notes-placeholder .t-btn {
  width: auto;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .t-compare {
    grid-template-columns: 1fr;
  }

  .notes-wrap {
    grid-template-columns: 1fr;
  }
}
