/* ============================================
   律师简历 PDF 模板样式
   支持 3 种风格：Classic、Modern、Elegant
   ============================================ */

/* ========== 通用样式 ========== */
.resume-template {
  position: absolute;
  left: -9999px; /* 隐藏在屏幕外 */
  top: 0;
  background: #ffffff;
}

.resume-page {
  width: 210mm;
  min-height: 297mm;
  padding: 20mm;
  background: #ffffff;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  font-size: 11pt;
  line-height: 1.6;
  box-sizing: border-box;
}

.resume-page * {
  box-sizing: border-box;
}

.resume-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-title {
  font-size: 16pt;
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c3e50;
}

.section-content {
  font-size: 11pt;
  line-height: 1.8;
  color: #555;
}

.resume-description {
  text-align: justify;
}

.resume-description p {
  margin-bottom: 8px;
}

.resume-description .resume-profile-block {
  margin-bottom: 10px;
}

.resume-description .resume-profile-subtitle {
  margin: 0 0 6px;
  font-size: 11pt;
  font-weight: 700;
  color: #2f4858;
}

.resume-description .resume-profile-list {
  margin: 0;
  padding-left: 16px;
}

.resume-description .resume-profile-list li {
  margin: 0 0 3px;
}

.qrcode-canvas {
  display: block;
}

.qrcode-hint {
  font-size: 8pt;
  color: #999;
  text-align: center;
  margin-top: 5px;
}

/* ========== Classic 经典商务风格 ========== */
.resume-classic .resume-header {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #2c3e50;
}

.resume-classic .resume-photo-wrapper {
  width: 35mm;
  height: 45mm;
  flex-shrink: 0;
  border: 1px solid #ddd;
  overflow: hidden;
}

.resume-classic .resume-header-info {
  flex: 1;
}

.resume-classic .resume-name {
  font-size: 24pt;
  font-weight: bold;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.resume-classic .resume-title {
  font-size: 14pt;
  color: #555;
  margin: 0 0 15px 0;
  font-weight: 500;
}

.resume-classic .resume-contact {
  margin-top: 10px;
}

.resume-classic .resume-contact p {
  margin: 5px 0;
  font-size: 11pt;
  color: #666;
}

.resume-classic .resume-contact .label {
  font-weight: 600;
  color: #2c3e50;
}

.resume-classic .resume-page {
  display: flex;
  flex-direction: column;
}

.resume-classic .resume-section {
  margin-bottom: 20px;
}

.resume-classic .section-title {
  color: #2c3e50;
  border-left: 3px solid #2c3e50;
  padding-left: 10px;
}

.resume-classic .resume-footer {
  position: static;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.resume-classic .footer-left {
  flex: 1;
}

.resume-classic .watermark {
  font-size: 12pt;
  font-weight: bold;
  color: #2c3e50;
  margin: 0 0 3px 0;
}

.resume-classic .website {
  font-size: 9pt;
  color: #999;
  margin: 0;
}

.resume-classic .footer-right {
  text-align: center;
}

/* ========== Modern 现代简约风格 ========== */
.resume-modern .resume-page {
  display: flex;
  padding: 0;
  gap: 0;
}

.resume-modern .resume-sidebar {
  width: 70mm;
  background: #478066;
  color: #fff;
  padding: 20mm 15mm;
  flex-shrink: 0;
}

.resume-modern .resume-photo-wrapper {
  width: 40mm;
  height: 40mm;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 3px solid #fff;
}

.resume-modern .sidebar-section {
  margin-bottom: 20px;
}

.resume-modern .sidebar-section h3 {
  font-size: 12pt;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: #ecf0f1;
  border-bottom: 2px solid #5a9d7e;
  padding-bottom: 5px;
}

.resume-modern .contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10pt;
  margin-bottom: 8px;
}

.resume-modern .icon {
  font-size: 14pt;
}

.resume-modern .language-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 9pt;
}

.resume-modern .qrcode-canvas {
  margin: 0 auto;
}

.resume-modern .qrcode-hint {
  color: #ecf0f1;
}

.resume-modern .resume-main {
  flex: 1;
  padding: 20mm;
  background: #fff;
  position: relative;
}

.resume-modern .resume-name {
  font-size: 26pt;
  font-weight: bold;
  color: #478066;
  margin: 0 0 8px 0;
}

.resume-modern .resume-title {
  font-size: 14pt;
  color: #7f8c8d;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #81b89e;
}

.resume-modern .resume-section {
  margin-bottom: 20px;
}

.resume-modern .section-title {
  font-size: 14pt;
  font-weight: bold;
  color: #478066;
  margin-bottom: 10px;
  position: relative;
  padding-left: 15px;
}

.resume-modern .section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: #5a9d7e;
}

.resume-modern .resume-footer {
  position: static;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.resume-modern .watermark {
  font-size: 9pt;
  color: #95a5a6;
  text-align: center;
  margin: 0;
}

/* ========== Elegant 优雅律师风格 ========== */
.resume-elegant .resume-decoration {
  height: 5mm;
  background: linear-gradient(90deg, #5a9d7e 0%, #81b89e 50%, #5a9d7e 100%);
}

.resume-elegant .resume-page {
  display: flex;
  flex-direction: column;
}

.resume-elegant .resume-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
}

.resume-elegant .header-left {
  flex: 1;
}

.resume-elegant .resume-name {
  font-size: 28pt;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

.resume-elegant .resume-title {
  font-size: 13pt;
  color: #5a9d7e;
  margin: 0 0 15px 0;
  font-weight: 500;
}

.resume-elegant .header-divider {
  width: 80px;
  height: 2px;
  background: #5a9d7e;
  margin: 15px 0;
}

.resume-elegant .resume-contact p {
  margin: 8px 0;
  font-size: 10pt;
  color: #666;
}

.resume-elegant .resume-contact strong {
  color: #5a9d7e;
  font-weight: 600;
}

.resume-elegant .header-right {
  flex-shrink: 0;
}

.resume-elegant .resume-photo-wrapper {
  width: 38mm;
  height: 50mm;
  overflow: hidden;
  border: 3px solid #5a9d7e;
  box-shadow: 0 4px 12px rgba(90, 157, 126, 0.2);
}

.resume-elegant .resume-section {
  margin-bottom: 22px;
}

.resume-elegant .section-title-wrapper {
  margin-bottom: 12px;
}

.resume-elegant .section-title {
  font-size: 15pt;
  font-weight: bold;
  color: #2c2c2c;
  margin: 0 0 5px 0;
  display: inline-block;
}

.resume-elegant .title-line {
  width: 50px;
  height: 2px;
  background: #5a9d7e;
}

.resume-elegant .resume-footer {
  position: static;
  margin-top: auto;
  padding-top: 15px;
  border-top: 2px solid #5a9d7e;
}

.resume-elegant .footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-elegant .footer-left {
  flex: 1;
}

.resume-elegant .watermark {
  font-size: 12pt;
  font-weight: bold;
  color: #2c2c2c;
  margin: 0 0 3px 0;
}

.resume-elegant .website {
  font-size: 9pt;
  color: #999;
  margin: 0;
}

.resume-elegant .footer-right {
  text-align: center;
}

/* ========== Executive 高管精英风格 ========== */
.resume-executive .resume-page {
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 右上角绿色装饰 */
.resume-executive .resume-page::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #5a9d7e 0%, #81b89e 100%);
  opacity: 0.08;
  border-radius: 0 0 0 100%;
}

.resume-executive .resume-header {
  background: linear-gradient(135deg, #478066 0%, #5a9d7e 100%);
  color: white;
  padding: 25mm 20mm;
  margin: -20mm -20mm 20mm -20mm;
  position: relative;
  overflow: hidden;
}

/* 头部装饰条 */
.resume-executive .resume-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #81b89e 0%, #5a9d7e 50%, #81b89e 100%);
}

/* 头部底部渐变 */
.resume-executive .resume-header::after {
  content: '';
  position: absolute;
  bottom: -10mm;
  left: 0;
  right: 0;
  height: 10mm;
  background: linear-gradient(to bottom, rgba(71, 128, 102, 0.15), transparent);
}

.resume-executive .resume-photo-wrapper {
  width: 40mm;
  height: 50mm;
  border: 4px solid #81b89e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 2px white;
  float: left;
  margin-right: 20px;
  overflow: hidden;
  border-radius: 4px;
}

.resume-executive .resume-header-info {
  overflow: hidden;
  padding-top: 5px;
}

.resume-executive .resume-name {
  font-size: 30pt;
  font-weight: 700;
  color: white;
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

.resume-executive .resume-title {
  font-size: 15pt;
  color: #81b89e;
  margin: 0 0 20px 0;
  font-weight: 600;
  letter-spacing: 2px;
}

.resume-executive .resume-contact {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.resume-executive .resume-contact p {
  margin: 10px 0;
  font-size: 11pt;
  color: white;
  display: flex;
  align-items: center;
}

.resume-executive .resume-contact .label {
  font-weight: 600;
  color: #81b89e;
  min-width: 80px;
}

.resume-executive .resume-section {
  margin-bottom: 25px;
  position: relative;
  padding: 15px;
  background: linear-gradient(to right, rgba(90, 157, 126, 0.02) 0%, transparent 100%);
  border-radius: 6px;
}

.resume-executive .section-title {
  font-size: 18pt;
  font-weight: 700;
  color: #478066;
  margin: 0 0 15px 0;
  padding: 0 0 10px 0;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #478066 0%, #81b89e 100%);
  border-image-slice: 1;
  position: relative;
}

/* 标题前的装饰点 */
.resume-executive .section-title::before {
  content: '◆';
  color: #5a9d7e;
  margin-right: 10px;
  font-size: 14pt;
}

.resume-executive .section-content {
  font-size: 11pt;
  line-height: 1.8;
  color: #333;
}

.resume-executive .resume-description ul {
  list-style: none;
  padding-left: 0;
}

.resume-executive .resume-description li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}

.resume-executive .resume-description li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #5a9d7e;
  font-weight: bold;
}

.resume-executive .resume-description strong {
  color: #478066;
  font-weight: 600;
}

.resume-executive .resume-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 2px solid #5a9d7e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-executive .watermark {
  font-size: 13pt;
  font-weight: 700;
  color: #478066;
  margin: 0 0 3px 0;
}

.resume-executive .website {
  font-size: 10pt;
  color: #666;
  margin: 0;
}

/* ========== Professional 专业律师风格 ========== */
.resume-professional .resume-page {
  border-top: 8px solid #5a9d7e;
  padding-top: 25mm;
  display: flex;
  flex-direction: column;
}

.resume-professional .resume-header {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  position: relative;
}

.resume-professional .resume-header::before {
  content: '';
  position: absolute;
  top: -25mm;
  left: 0;
  width: 8mm;
  height: 30mm;
  background: linear-gradient(to bottom, #478066, #5a9d7e);
}

.resume-professional .resume-photo-wrapper {
  width: 36mm;
  height: 48mm;
  flex-shrink: 0;
  border: 3px solid #5a9d7e;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(90, 157, 126, 0.2);
}

.resume-professional .resume-header-info {
  flex: 1;
}

.resume-professional .resume-name {
  font-size: 26pt;
  font-weight: 700;
  color: #478066;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.resume-professional .resume-title {
  font-size: 13pt;
  color: #5a9d7e;
  margin: 0 0 15px 0;
  font-weight: 600;
  background: linear-gradient(to right, rgba(90, 157, 126, 0.1), transparent);
  padding: 5px 10px;
  display: inline-block;
}

.resume-professional .resume-contact {
  margin-top: 10px;
}

.resume-professional .resume-contact p {
  margin: 8px 0;
  font-size: 11pt;
  color: #666;
  display: flex;
  align-items: center;
}

.resume-professional .resume-contact .label {
  font-weight: 600;
  color: #478066;
  min-width: 80px;
}

.resume-professional .resume-section {
  margin-bottom: 20px;
}

.resume-professional .section-title {
  font-size: 15pt;
  font-weight: bold;
  color: #478066;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: linear-gradient(to right, rgba(90, 157, 126, 0.1) 0%, transparent 100%);
  border-left: 4px solid #5a9d7e;
}

.resume-professional .section-content {
  padding-left: 15px;
}

.resume-professional .resume-description ul {
  list-style: none;
  padding-left: 0;
}

.resume-professional .resume-description li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 5px;
}

.resume-professional .resume-description li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #5a9d7e;
  font-weight: bold;
}

.resume-professional .resume-footer {
  position: static;
  margin-top: auto;
  padding-top: 15px;
  border-top: 2px solid #5a9d7e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-professional .footer-left {
  flex: 1;
}

.resume-professional .watermark {
  font-size: 12pt;
  font-weight: bold;
  color: #478066;
  margin: 0 0 3px 0;
}

.resume-professional .website {
  font-size: 9pt;
  color: #999;
  margin: 0;
}

.resume-professional .footer-right {
  text-align: center;
}

/* ========== Word0320 参考模板风格 ========== */
.resume-word0320 .resume-page {
  position: relative;
  overflow: visible;
  height: auto;
  min-height: 297mm;
  padding: 22mm 18mm 22mm 48mm;
  display: flex;
  flex-direction: column;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: #1f1f1f;
  line-height: 1.625;
  font-weight: 400;
}

.resume-word0320 .resume-word0320-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 42mm;
  height: 100%;
  background: url('../images/resume-word0320/bg-wave.jpg') left top / 42mm 297mm repeat-y;
  z-index: 0;
}

.resume-word0320 .resume-word0320-logo {
  position: absolute;
  top: 10mm;
  right: 14mm;
  width: 46mm;
  z-index: 2;
}

.resume-word0320 .resume-word0320-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.resume-word0320 .resume-header,
.resume-word0320 .resume-main,
.resume-word0320 .resume-footer {
  position: relative;
  z-index: 1;
}

.resume-word0320 .resume-header {
  display: flex;
  align-items: flex-start;
  gap: 8mm;
  margin: 8mm 0 48px;
}

.resume-word0320 .resume-photo-wrapper {
  width: 28mm;
  height: 42mm;
  border: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.resume-word0320 .resume-photo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.resume-word0320 .resume-word0320-header-info {
  padding-right: 44mm;
  border-left: 2px solid rgba(120, 175, 150, 0.38);
  padding-left: 5mm;
}

.resume-word0320 .resume-name {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #5ca88a;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.resume-word0320 .resume-word0320-firm {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #66ad90;
  line-height: 1.5;
}

.resume-word0320 .resume-title {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 400;
  color: #74b49b;
  line-height: 1.5;
}

.resume-word0320 .resume-title .resume-role-line {
  display: block;
  white-space: nowrap;
}

.resume-word0320 .resume-word0320-email {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: #1f1f1f;
  line-height: 1.25;
}

.resume-word0320 .resume-word0320-en {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #84bea8;
  line-height: 1.25;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.resume-word0320 .resume-main {
  margin-top: 0;
}

.resume-word0320 .resume-description {
  font-size: 16px;
  color: #1f1f1f;
  text-align: justify;
  line-height: 1.625;
  font-weight: 400;
}

.resume-word0320 .resume-description p {
  margin: 0 0 10px;
}

.resume-word0320 .resume-description .resume-profile-block {
  margin: 0 0 28px;
}

.resume-word0320 .resume-description .resume-profile-block--bio {
  margin: 0 0 48px;
}

.resume-word0320 .resume-description .resume-profile-subtitle {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1f1f1f;
  line-height: 1.5;
}

.resume-word0320 .resume-description .resume-profile-plus-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resume-word0320 .resume-description .resume-profile-block--business p,
.resume-word0320 .resume-description .resume-profile-block--business .resume-profile-list,
.resume-word0320 .resume-description .resume-profile-block--business .resume-profile-list li {
  color: #78af96;
}

.resume-word0320 .resume-description .resume-profile-plus-list li {
  margin: 0;
  padding-left: 16px;
  text-indent: 0;
  line-height: 1.5;
  font-size: 16px;
  font-weight: 400;
  position: relative;
}

.resume-word0320 .resume-description .resume-profile-plus-list li::before {
  content: '+';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
}

.resume-word0320 .resume-description .resume-profile-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.resume-word0320 .resume-description .resume-profile-list li {
  margin: 0 0 4px;
  padding-left: 18px;
  line-height: 1.5;
  font-size: 16px;
  font-weight: 400;
  position: relative;
}

.resume-word0320 .resume-description .resume-profile-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
}

.resume-word0320 .resume-footer {
  margin-top: auto;
  padding-top: 48px;
  color: #78af96;
}

.resume-word0320 .resume-footer p {
  margin: 1px 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.resume-word0320 .resume-footer .watermark,
.resume-word0320 .resume-footer .website {
  font-size: 14px;
  font-weight: 700;
}

/* 内容过长时的压缩布局（导出前由 JS 自动添加） */
.resume-word0320.is-compact .resume-description {
  font-size: 16px;
  line-height: 1.6;
}

.resume-word0320.is-compact .resume-description p {
  margin: 0 0 8px;
}

.resume-word0320.is-compact .resume-description .resume-profile-block {
  margin: 0 0 20px;
}

.resume-word0320.is-compact .resume-description .resume-profile-block--bio {
  margin: 0 0 28px;
}

.resume-word0320.is-compact .resume-description .resume-profile-subtitle {
  margin: 0 0 6px;
  font-size: 18px;
}

.resume-word0320.is-compact .resume-description .resume-profile-plus-list {
  margin: 0;
  padding: 0;
}

.resume-word0320.is-compact .resume-description .resume-profile-plus-list li {
  margin: 0;
  padding-left: 14px;
  line-height: 1.45;
  font-size: 16px;
}

.resume-word0320.is-compact .resume-description .resume-profile-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.resume-word0320.is-compact .resume-description .resume-profile-list li {
  display: block;
  margin: 0 0 3px;
  padding-left: 18px;
  line-height: 1.45;
  font-size: 16px;
  position: relative;
}

.resume-word0320.is-compact .resume-description .resume-profile-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
}

.resume-word0320.is-compact .resume-footer {
  padding-top: 20px;
}

.resume-word0320.is-tight .resume-description {
  font-size: 15px;
  line-height: 1.5;
}

.resume-word0320.is-tight .resume-description p {
  margin: 0 0 6px;
}

.resume-word0320.is-tight .resume-description .resume-profile-block {
  margin: 0 0 14px;
}

.resume-word0320.is-tight .resume-description .resume-profile-block--bio {
  margin: 0 0 18px;
}

.resume-word0320.is-tight .resume-description .resume-profile-subtitle {
  font-size: 17px;
}

.resume-word0320.is-tight .resume-description .resume-profile-plus-list li,
.resume-word0320.is-tight .resume-description .resume-profile-list li {
  font-size: 15px;
}

.resume-word0320.is-tight .resume-footer {
  padding-top: 12px;
}

/* ========== 打印优化 ========== */
@media print {
  .resume-template {
    position: static !important;
    left: auto !important;
  }

  .resume-page {
    page-break-after: always;
  }

  @page {
    size: A4;
    margin: 0;
  }
}

/* ========== 预览窗口 ========== */
.resume-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  background: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

.preview-title {
  font-size: 18px;
  font-weight: 400;
  color: #2c2c2c;
  margin: 0;
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.btn-preview {
  padding: 10px 25px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-preview-download {
  background: #5a9d7e;
  color: #fff;
  border-color: #5a9d7e;
}

.btn-preview-download:hover {
  background: #4b8369;
  border-color: #4b8369;
}

.btn-preview-change {
  background: #fff;
  color: #2c2c2c;
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-preview-change:hover {
  background: #f6f6f6;
}

.btn-preview-close {
  background: #fff;
  color: #2c2c2c;
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-preview-close:hover {
  background: #f6f6f6;
}

.preview-content {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px;
  background: #1a1a1a;
}

.preview-content::-webkit-scrollbar {
  width: 12px;
}

.preview-content::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.preview-content::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 6px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

.preview-page-wrapper {
  background: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transform-origin: top center;
  max-width: 210mm;
  margin: 0 auto;
}

/* 确保预览中的模板样式正确 */
.preview-page-wrapper .resume-template {
  display: block !important;
  position: static !important;
  left: auto !important;
}

.preview-page-wrapper .resume-page {
  width: 210mm;
  min-height: 297mm;
  padding: 20mm;
  background: #ffffff;
  box-sizing: border-box;
}

.preview-zoom-controls {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  gap: 10px;
  z-index: 10002;
}

.btn-zoom {
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14pt;
  font-weight: bold;
  color: #333;
  transition: all 0.3s;
}

.btn-zoom:hover {
  background: #5a9d7e;
  color: white;
}

.zoom-level {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  font-size: 11pt;
  color: #666;
  font-weight: bold;
}

/* ========== 模板选择器 UI（仿 Word 模板库）========== */
.resume-template-selector {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 10000;
  display: flex;
  overflow: hidden;
}

/* 左侧边栏 */
.template-selector-sidebar {
  width: 260px;
  background: #f5f7fa;
  border-right: 1px solid #e4e7ed;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.selector-logo {
  padding: 30px 20px 20px;
  border-bottom: 1px solid #e4e7ed;
}

.selector-logo h2 {
  margin: 0 0 5px 0;
  font-size: 18pt;
  color: #5a9d7e;
  font-weight: 700;
}

.selector-logo p {
  margin: 0;
  font-size: 10pt;
  color: #909399;
}


.category-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.category-item {
  padding: 12px 20px;
  margin: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11pt;
  color: #606266;
}

.category-item:hover {
  background: #e6e8eb;
}

.category-item.active {
  background: #5a9d7e;
  color: white;
  font-weight: 600;
}

.category-item .count {
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9pt;
  font-weight: 600;
}

.category-item.active .count {
  background: rgba(255,255,255,0.3);
}

.selector-footer {
  padding: 20px;
  border-top: 1px solid #e4e7ed;
}

.btn-cancel-sidebar {
  width: 100%;
  padding: 12px;
  background: #909399;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11pt;
  transition: all 0.3s;
}

.btn-cancel-sidebar:hover {
  background: #7f8c8d;
}

/* 右侧主内容区 */
.template-selector-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.selector-header {
  padding: 30px 40px 20px;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.current-category-title {
  margin: 0;
  font-size: 22pt;
  font-weight: 700;
  color: #303133;
}

.selector-search {
  flex-shrink: 0;
}

.search-input {
  padding: 10px 15px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 11pt;
  width: 250px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #5a9d7e;
  box-shadow: 0 0 0 2px rgba(90, 157, 126, 0.1);
}

/* 模板网格 */
.template-grid {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  align-content: start;
}

/* 模板卡片 */
.template-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.template-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1), 0 1px 8px rgba(0,0,0,0.08);
  transform: translateY(-6px);
  border-color: #5a9d7e;
}

.template-preview {
  height: 180px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.preview-placeholder {
  text-align: center;
  padding: 30px 20px;
  width: 100%;
}

.placeholder-icon {
  font-size: 50pt;
  opacity: 0.2;
  margin-bottom: 12px;
  display: block;
  line-height: 1;
}

.placeholder-text {
  font-size: 11pt;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.template-info {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.template-title {
  margin: 0;
  font-size: 15pt;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  line-height: 1.3;
}

.template-badge {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 9pt;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

.template-description {
  margin: 0;
  font-size: 10pt;
  color: #6b7280;
  line-height: 1.5;
  flex: 1;
  min-height: 36px;
}

.template-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.feature-tag {
  padding: 5px 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 9pt;
  color: #6b7280;
  font-weight: 500;
}

/* 滚动条美化 */
.template-grid::-webkit-scrollbar,
.category-nav::-webkit-scrollbar {
  width: 8px;
}

.template-grid::-webkit-scrollbar-track,
.category-nav::-webkit-scrollbar-track {
  background: #f5f7fa;
}

.template-grid::-webkit-scrollbar-thumb,
.category-nav::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 4px;
}

.template-grid::-webkit-scrollbar-thumb:hover,
.category-nav::-webkit-scrollbar-thumb:hover {
  background: #909399;
}

.selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

/* 生成按钮样式 */
.btn-generate-resume {
  display: inline-block;
  padding: 12px 30px;
  background: #5a9d7e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12pt;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  margin: 10px 5px;
}

.btn-generate-resume:hover {
  background: #478066;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90,157,126,0.3);
}

.btn-generate-resume:active {
  transform: translateY(0);
}

.btn-generate-resume:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 加载动画 */
.resume-generating {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  padding: 30px 50px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 10001;
  text-align: center;
}

.resume-generating .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #5a9d7e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.resume-generating p {
  margin: 0;
  font-size: 12pt;
  color: #333;
}

/* ========== 模板选择器高级版重绘 ========== */
.resume-template-selector {
  background: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

.template-selector-sidebar {
  width: 252px;
  background: #ffffff;
  border-right: 1px solid rgba(44, 44, 44, 0.08);
}

.selector-logo {
  padding: 24px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.selector-logo h2 {
  font-size: 20px;
  font-weight: 400;
  color: #2c2c2c;
}

.selector-logo p {
  color: #8d8d8d;
  font-size: 13px;
}

.selector-sidebar-search {
  padding: 0 18px 8px;
}

.template-selector-sidebar .search-input {
  width: 100%;
}

.category-nav {
  padding: 8px 10px 16px;
}

.category-item {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 0;
  font-size: 14px;
  color: #4a4a4a;
  border: 1px solid transparent;
  font-weight: 300;
}

.category-item:hover {
  background: rgba(90, 157, 126, 0.06);
}

.category-item.active {
  background: rgba(90, 157, 126, 0.12);
  color: #2c2c2c;
  border-color: rgba(90, 157, 126, 0.35);
  border-left: 2px solid #5a9d7e;
}

.category-item .count {
  background: rgba(90, 157, 126, 0.14);
  color: #5a9d7e;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.selector-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-cancel-sidebar {
  border-radius: 0;
  background: #ffffff;
  border: 1px solid rgba(44, 44, 44, 0.16);
  color: #2c2c2c;
  font-size: 14px;
}

.btn-cancel-sidebar:hover {
  background: #f5f5f5;
}

.template-selector-main {
  background: transparent;
}

.selector-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(31, 43, 56, 0.12);
  background: #f8f9fb;
}

.selector-header-tools {
  display: flex !important;
  align-items: center;
  gap: 10px;
  justify-content: flex-end !important;
  margin-top: 0 !important;
  width: auto;
}

.current-category-title {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #1f2b38;
}

.search-input {
  height: 40px;
  width: 260px;
  border-radius: 0;
  border: 1px solid rgba(69, 93, 114, 0.24);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  font-weight: 300;
}

.selector-header .btn-selector-exit {
  margin-left: auto !important;
}

.search-input:focus {
  border-color: #5a9d7e;
  box-shadow: 0 0 0 3px rgba(90, 157, 126, 0.14);
}

.btn-selector-exit {
  height: 40px;
  padding: 0 16px;
  border-radius: 0;
  border: 1px solid rgba(74, 96, 114, 0.24);
  background: rgba(255, 255, 255, 0.95);
  color: #2b3d4b;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-selector-exit:hover {
  background: #f5f8fb;
}

.template-grid {
  padding: 22px 26px;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.template-card {
  min-height: 372px;
  border-radius: 0;
  border: 1px solid rgba(86, 110, 130, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  box-shadow: 0 12px 30px rgba(37, 55, 70, 0.08);
  overflow: hidden;
}

.template-card:hover {
  transform: translateY(-4px);
  border-color: rgba(90, 157, 126, 0.58);
  box-shadow: 0 18px 34px rgba(34, 52, 68, 0.14);
}

.template-preview {
  height: 172px;
  padding: 16px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf3f8 100%);
  border-top: none !important;
  border-bottom: 1px solid rgba(40, 62, 79, 0.12);
}

.template-preview-sketch {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 1px solid rgba(47, 67, 83, 0.14);
  background: #fff;
}

.template-preview-sketch .sketch-main {
  padding: 12px;
}

.template-preview-sketch .sketch-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(72, 85, 95, 0.16);
  margin-bottom: 9px;
}

.template-preview-sketch .sketch-line--lg {
  width: 70%;
  height: 10px;
  border-radius: 3px;
  background: var(--tpl-accent);
  opacity: 0.92;
}

.template-preview-sketch .sketch-line--short {
  width: 46%;
}

.template-preview-sketch--sidebar .sketch-sidebar {
  width: 30%;
  background: var(--tpl-accent);
  opacity: 0.25;
}

.template-preview-sketch--elegant .sketch-topbar {
  height: 9px;
}

.template-preview-sketch--executive .sketch-hero {
  height: 30%;
}

.template-info {
  padding: 16px 16px 18px;
  gap: 10px;
  display: flex;
  flex-direction: column;
}

.template-header {
  align-items: flex-start;
}

.template-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #1f2933;
}

.template-badge {
  padding: 7px 14px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f7fffb !important;
  background: linear-gradient(135deg, #5b987b 0%, #4c896d 100%) !important;
  box-shadow: 0 6px 12px rgba(76, 137, 109, 0.28);
}

.template-description {
  margin: 4px 0 8px;
  font-size: 15px;
  line-height: 1.55;
  color: #435363;
  font-weight: 300;
}

.template-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feature-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 0;
  border: 1px solid rgba(88, 129, 112, 0.24);
  background: linear-gradient(180deg, #f9fdfb 0%, #f3faf6 100%);
  color: #52636f;
  font-size: 13px;
  font-weight: 300;
}

.preview-header {
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid rgba(40, 62, 79, 0.14);
}

.preview-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2b38;
}

.preview-content {
  background: radial-gradient(900px 540px at 50% -5%, #f6f8fb 0%, #edf2f6 100%);
  padding: 22px;
}

.preview-page-wrapper {
  box-shadow: 0 14px 34px rgba(22, 33, 44, 0.14);
  border-radius: 6px;
}

.btn-preview {
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
}

.btn-preview-download {
  background: linear-gradient(135deg, #5a9d7e 0%, #4c886b 100%);
  border-color: #4c886b;
}

.btn-preview-download:hover {
  background: linear-gradient(135deg, #4f8b70 0%, #447c62 100%);
}

.btn-preview-change,
.btn-preview-close {
  border-color: rgba(58, 80, 96, 0.25);
  background: #ffffff;
  color: #2d4354;
}

.btn-preview-change:hover,
.btn-preview-close:hover {
  background: #f4f7fa;
}

.preview-zoom-controls {
  padding: 8px;
  border-radius: 0;
  border: 1px solid rgba(43, 63, 78, 0.18);
  box-shadow: 0 10px 20px rgba(25, 40, 54, 0.15);
}

.btn-zoom {
  width: 36px;
  height: 36px;
  border-radius: 0;
  border: 1px solid rgba(58, 79, 95, 0.2);
  background: #ffffff;
  color: #223646;
  font-size: 22px;
  font-weight: 300;
  line-height: 32px;
}

.btn-zoom:hover {
  background: #f0f7f3;
  border-color: #5a9d7e;
  color: #3f735b;
}

.zoom-level {
  min-width: 56px;
  font-size: 15px;
  font-weight: 300;
  color: #3d5365;
}

.selector-overlay {
  background: rgba(17, 24, 32, 0.45);
}

.resume-generating {
  border-radius: 0;
  border: 1px solid rgba(39, 59, 73, 0.18);
  box-shadow: 0 18px 30px rgba(17, 27, 36, 0.2);
}

@media (max-width: 1200px) {
  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 991px) {
  .resume-template-selector {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .selector-header {
    padding: 18px 18px 14px;
  }

  .template-grid {
    padding: 18px;
    gap: 14px;
  }

  .template-title {
    font-size: 28px;
  }

  .template-description {
    font-size: 14px;
  }

  .feature-tag {
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .resume-template-selector {
    width: 100vw;
    height: 100vh;
  }

  .template-selector-sidebar {
    display: none;
  }

  .selector-header {
    display: block;
  }

  .selector-header-tools {
    width: 100%;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .search-input {
    width: min(260px, calc(100% - 90px));
    min-width: 0;
  }

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

  .template-title {
    font-size: 24px;
  }

  .template-description {
    font-size: 14px;
  }

  .feature-tag {
    font-size: 12px;
  }
}
