/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --border: #d8e0ee;
  --text: #162033;
  --muted: #61708a;
  --primary: #2f6fed;
  --primary-dark: #1e57c7;
  --danger: #d14343;
  --danger-soft: #fff1f1;
  --success: #0f9d58;
  --shadow: 0 16px 40px rgba(41, 72, 152, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
}

.sidebar-stack,
.content-stack {
  display: grid;
  gap: 24px;
  align-content: start;
}

.card {
  background: var(--card);
  border: 1px solid rgba(216, 224, 238, 0.85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h1,
.section-head h2 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero-copy,
.section-head p,
.empty-state,
.field span,
.resume-meta,
.resume-summary,
.detail-text,
.category-chip span,
.hero-meta span {
  color: var(--muted);
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.hero-meta span,
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef4ff;
  font-size: 0.92rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head p {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.result-count {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f7fc;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.stack-form,
.filter-grid {
  display: grid;
  gap: 16px;
}

.filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(47, 111, 237, 0.65);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #edf3ff;
  color: var(--primary);
}

.ghost-btn {
  background: #f4f7fc;
  color: var(--text);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
}

.category-list,
.resume-list,
.position-list {
  display: grid;
  gap: 14px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.category-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #f9fbff;
  border: 1px solid #e3ebf8;
}

.category-chip strong {
  display: block;
  margin-bottom: 4px;
}

.empty-state {
  border: 1px dashed #c9d4ea;
  border-radius: var(--radius-md);
  padding: 18px;
  background: #f9fbff;
  text-align: center;
}

.resume-card {
  border: 1px solid #e1e8f5;
  border-radius: 20px;
  background: #fff;
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.resume-card.status-passed {
  border-color: rgba(15, 157, 88, 0.35);
}

.resume-card.status-rejected {
  border-color: rgba(209, 67, 67, 0.35);
}

.resume-card.status-pending {
  border-color: rgba(47, 111, 237, 0.25);
}

.resume-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.resume-title-group {
  display: grid;
  gap: 8px;
}

.resume-title {
  margin: 0;
  font-size: 1.1rem;
}

.resume-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill.status-passed {
  background: rgba(15, 157, 88, 0.12);
  color: #0f9d58;
}

.status-pill.status-rejected {
  background: rgba(209, 67, 67, 0.12);
  color: #d14343;
}

.status-pill.status-pending {
  background: rgba(47, 111, 237, 0.12);
  color: #2f6fed;
}

.resume-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.resume-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.position-card {
  border: 1px solid #e1e8f5;
  border-radius: 20px;
  background: #fff;
  padding: 18px 20px;
  display: grid;
  gap: 16px;
}

.position-meta,
.match-meta,
.match-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.position-keyword-row,
.match-tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.keyword-pill,
.match-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f4f7fc;
  color: var(--text);
  font-size: 0.88rem;
}

.match-tag.positive {
  background: rgba(15, 157, 88, 0.12);
  color: #0f9d58;
}

.match-tag.negative {
  background: rgba(209, 67, 67, 0.12);
  color: #d14343;
}

.match-list {
  display: grid;
  gap: 12px;
}

.match-card {
  border: 1px solid #e8eef8;
  border-radius: 16px;
  background: #f9fbff;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.match-score {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.status-btn {
  border: 1px solid #d7e1f2;
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
}

.status-btn.active {
  border-color: #2f6fed;
  background: #eef4ff;
  color: #2f6fed;
}

.resume-summary,
.detail-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.resume-detail {
  border-top: 1px solid #ebf0f8;
  padding-top: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(22, 32, 51, 0.94);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  z-index: 10;
}

.hidden,
[hidden] {
  display: none !important;
}

@media only screen and (max-width: 980px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero-meta {
    justify-content: flex-start;
  }
}

.quick-tag-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #ebf0f8;
}

.compact-head {
  margin-bottom: 14px;
}

.compact-head h3 {
  margin: 0;
  font-size: 1rem;
}

.compact-head p {
  margin: 6px 0 0;
}

.quick-tag-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-tag-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
}

.quick-tag-form input:focus {
  outline: none;
  border-color: rgba(47, 111, 237, 0.65);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.empty-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-tag-item {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dce6f8;
  background: #f8fbff;
  border-radius: 999px;
  overflow: hidden;
}

.quick-tag-btn,
.quick-tag-remove {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  color: var(--text);
}

.quick-tag-btn {
  font-weight: 600;
}

.quick-tag-btn:hover {
  background: #eef4ff;
}

.quick-tag-remove {
  color: var(--danger);
  border-left: 1px solid #dce6f8;
}

.quick-tag-remove:hover {
  background: #fff1f1;
}

@media only screen and (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 100%);
    padding-top: 20px;
  }

  .card {
    border-radius: 18px;
    padding: 18px;
  }

  .filter-grid,
  .resume-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .quick-tag-form {
    grid-template-columns: 1fr;
  }

  .resume-actions,
  .action-row {
    justify-content: flex-start;
  }

  .match-head {
    flex-direction: column;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

