/* Modern Resume Theme (A4-friendly)
   - Single-column flow + grid sections (avoid long blank sidebar)
   - No external font dependency; uses system font stack
*/

:root {
  --bg: #0b1220;
  --paper: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --chip: #eef2ff;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --accent: #06b6d4;
  --shadow: 0 20px 45px rgba(2, 6, 23, 0.18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% 10%, rgba(37, 99, 235, 0.18), transparent 55%),
              radial-gradient(900px 600px at 95% 15%, rgba(6, 182, 212, 0.14), transparent 55%),
              var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* A4 paper */
.resume-page {
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto 40px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header */
.resume-header {
  padding: 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(6, 182, 212, 0.10));
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #fff;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 0;
}

.title {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
}

.contact-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #0b1220;
  font-size: 11px;
  line-height: 1;
}

.contact-pill i { color: var(--primary); }

/* Content */
.content {
  padding: 18px 20px 20px;
}

.section {
  margin-top: 14px;
}
.section:first-child { margin-top: 0; }


.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  margin: 0 0 8px;
  letter-spacing: 0.2px;
}

.section-title i { color: var(--primary); }

.small { font-size: 11px; color: var(--muted); }

/* Cards */
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.card + .card { margin-top: 10px; }

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.item-title {
  font-weight: 850;
  font-size: 13px;
  margin: 0;
  color: #0b1220;
}

.item-subtitle {
  font-weight: 850;
  font-size: 12px;
  margin: 0;
  color: #0b1220;
}

.item-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.item-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
}

.item-content {
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

/* Lists */
.list {
  margin: 0;
  padding-left: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* Keep lists snug inside cards */
.card .list {
  margin-top: 2px;
}

.list li { margin: 6px 0; }

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

/* Grid blocks (to avoid huge blank areas) */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
  align-items: stretch;
}

/* Make cards in grid look balanced (e.g., 教育背景 vs 个人信息) */
.grid-2 .card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 110px;
  margin-top: 0;
}

.grid-2 .card .item-head {
  margin-bottom: 6px;
}

.grid-2 .card .item-sub {
  margin-top: 0;
}

@media (max-width: 860px) {
  .resume-page {
    width: 100%;
    border-radius: 0;
    margin: 0;
  }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  html, body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .resume-page {
    width: auto;
    min-height: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

	.contact-row {
	  margin-top: 12px;
	  display: flex;
	  flex-wrap: wrap;
	  gap: 8px 10px;
	}

	.contact-pill {
	  display: inline-flex;
	  align-items: center;
	  gap: 8px;
	  padding: 7px 10px;
	  border-radius: 999px;
	  background: rgba(255, 255, 255, 0.78);
	  border: 1px solid rgba(37, 99, 235, 0.16);
	  color: #0b1220;
	  font-size: 11px;
	  line-height: 1;
	}
	
	.contact-pill i { color: var(--primary); }

  /* Ensure grids keep their layout on print */
  .grid-2 {
    grid-template-columns: 1fr 1fr !important;
  }

  a { text-decoration: none !important; }

  /* Important: avoid large blank space caused by preventing breaks.
     Allow cards to break if needed; only protect headings. */
  .section-title,
  .item-head {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card {
    break-inside: auto;
    page-break-inside: auto;
  }

  /* tighter spacing for print to reduce unnecessary whitespace */
  .content { padding: 14px 16px 16px; }
  .section { margin-top: 10px; }
  .card { padding: 10px; }
  .list li { margin: 4px 0; }
}

