*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f7f8;
  --bg-card: #fff;
  --bg-elevated: #f0f0f2;
  --bg-hover: #eaeaec;
  --border: #e5e5e7;
  --border-light: #d4d4d8;
  --text: #111;
  --text-secondary: #666;
  --text-muted: #999;
  --accent: #111;
  --accent-hover: #333;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --red: #dc2626;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* 主内容外壳：撑满视口高度，便于页脚贴底；与固定遮罩分离，避免参与 flex 占位 */
.page-wrap {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Nav ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topnav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: contain;
}
.brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.3px;
}
.brand-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  margin-left: 2px;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all .15s;
}
.topnav-links a:hover { color: var(--text); background: var(--bg-elevated); }
.topnav-links a.active { color: var(--text); background: var(--bg-elevated); font-weight: 600; }
.topnav-links a.btn-download {
  background: var(--text);
  color: #fff;
  font-weight: 600;
  margin-left: 10px;
}
.topnav-links a.btn-download:hover {
  background: var(--accent-hover);
  color: #fff;
}
.topnav-links a svg { width: 15px; height: 15px; }

/* ---- Hero Banner ---- */
.hero {
  text-align: center;
  padding: 48px 24px 36px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #111;
}
.hero p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ---- Container ---- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  flex: 1 1 auto;
  width: 100%;
}

/* ---- Site footer (ICP) ---- */
.site-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 28px;
  text-align: center;
  flex-shrink: 0;
}
.site-footer-line {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-footer-line a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer-line a:hover {
  color: var(--text-secondary);
}

/* ---- Extension Tip ---- */
.ext-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 24px;
  transition: all .3s;
}
.ext-tip.connected {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}
.ext-tip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
.ext-tip.connected .dot {
  background: #22c55e;
  animation: none;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #111;
  background: #fafafa;
}
.upload-zone .icon-upload {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  color: #999;
}
.upload-zone:hover .icon-upload,
.upload-zone.drag-over .icon-upload { color: #111; }
.upload-zone h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}
.upload-zone p {
  font-size: 13px;
  color: var(--text-secondary);
}
.upload-zone .browse-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 28px;
  background: #111;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
}
.upload-zone .browse-btn:hover { background: #333; }
.upload-zone input[type=file] { display: none; }

/* ---- List Header ---- */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 16px;
}
.list-header h2 {
  font-size: 15px;
  font-weight: 600;
}
.list-header .count {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
  font-size: 13px;
}
.list-actions {
  display: flex;
  gap: 8px;
}
.list-actions button {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.list-actions button:hover {
  border-color: #111;
  color: #111;
}
.list-actions .btn-clear:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fef2f2;
}

/* ---- Resume List ---- */
.resume-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Resume Row ---- */
.resume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
}
.resume-row:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-light);
}
.resume-row.is-error {
  background: #fef2f2;
  border-color: #fecaca;
}

.row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.row-badge.pdf { background: #111; }
.row-badge.docx { background: #2563eb; }
.row-badge.txt { background: #7c3aed; }

.row-info {
  flex: 1;
  min-width: 0;
}
.row-filename {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-size {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.row-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 160px;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #111;
  border-radius: 2px;
  transition: width .15s ease;
  width: 0;
}
.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

.status-waiting {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.status-error {
  font-size: 12px;
  color: var(--red);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-preview:hover {
  border-color: #111;
  color: #111;
}
.btn-preview svg {
  width: 14px;
  height: 14px;
}

.row-remove {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all .15s;
  flex-shrink: 0;
}
.row-remove:hover { background: #fef2f2; color: var(--red); }

/* ---- Loading Overlay ---- */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Confirm Dialog ---- */
body.modal-open { overflow: hidden; }
.confirm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  flex: none;
}
.confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.confirm-dialog {
  width: min(420px, calc(100vw - 24px));
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 16px 16px 14px;
  transform: translateY(6px) scale(.98);
  transition: transform .18s ease;
}
.confirm-overlay.show .confirm-dialog {
  transform: translateY(0) scale(1);
}
.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}
.confirm-message {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 14px;
  white-space: pre-line;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-btn {
  min-width: 88px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.confirm-btn.cancel {
  background: #f3f4f6;
  color: #222;
  border-color: #e5e7eb;
}
.confirm-btn.cancel:hover {
  background: #e5e7eb;
}
.confirm-btn.confirm {
  background: #1677ff;
  color: #fff;
}
.confirm-btn.confirm:hover {
  background: #0958d9;
}

/* ==================== */
/* Guide Page           */
/* ==================== */
.guide-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  flex: 1 1 auto;
  width: 100%;
}
.guide-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}
.guide-page .guide-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}
.guide-page h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 36px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-page h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.guide-page h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.guide-page h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 10px;
}
.guide-page p, .guide-page li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.step-list { display: flex; flex-direction: column; gap: 10px; }
.step-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
}
.step-item:hover { border-color: var(--border-light); }
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-body { flex: 1; }
.step-body strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 3px;
}
.step-body span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.guide-page code {
  display: inline;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  font-size: 12px;
  color: #111;
}
.guide-page pre {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 10px 0;
  overflow-x: auto;
}
.guide-page pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #111;
}
.tip-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #f8f8ff;
  border: 1px solid #e0e0f0;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}
.tip-box .tip-icon { flex-shrink: 0; font-size: 15px; }
.warn-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  margin: 14px 0;
  font-size: 13px;
  color: var(--amber);
  line-height: 1.7;
}
.warn-box .tip-icon { flex-shrink: 0; font-size: 15px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-footer { padding: 0 14px 24px; }
  .site-footer-line { font-size: 11px; }
  .container { padding: 20px 14px 60px; }
  .upload-zone { padding: 36px 16px; }
  .topnav-inner { padding: 0 14px; }
  .brand-text { font-size: 13px; }
  .guide-page { padding: 28px 14px 60px; }
  .resume-row { gap: 8px; padding: 10px 12px; }
  .row-badge { width: 30px; height: 30px; font-size: 10px; }
  .progress-wrap { width: 100px; }
  .row-filename { font-size: 13px; }
}

/* ---- Tabs ---- */
.guide-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.guide-tab {
  padding: 12px 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.guide-tab:hover {
  color: var(--text);
}
.guide-tab.active {
  color: #111;
  border-bottom-color: #111;
}
.guide-tab-content {
  display: none;
  animation: fadeIn .3s ease;
}
.guide-tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
