.tpl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .tpl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }
}

.tpl-card {
  position: relative;
}

.tpl-card-glow {
  position: absolute;
  inset: 0;
  border-radius: 3rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent);
  transform: rotate(-1deg);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.tpl-card:hover .tpl-card-glow {
  transform: rotate(0deg);
}

.tpl-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 3rem;
  overflow: hidden;
  transition: border-color 0.4s ease;
}

@media (min-width: 640px) {
  .tpl-card-inner {
    flex-direction: row;
    padding: 2.25rem;
    gap: 2rem;
  }
}

.tpl-card:hover .tpl-card-inner,
.tpl-card.is-active .tpl-card-inner {
  border-color: rgba(37, 99, 235, 0.4);
}

.tpl-shot {
  position: relative;
  width: 100%;
  max-width: 16rem;
  height: 20rem;
  flex-shrink: 0;
  background: #020617;
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.45s ease;
}

.tpl-shot::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: #2563eb;
  z-index: 4;
}

.tpl-card:hover .tpl-shot {
  transform: scale(1.03);
}

.tpl-info {
  flex: 1;
  width: 100%;
  min-width: 0;
  text-align: center;
}

@media (min-width: 640px) {
  .tpl-info {
    text-align: left;
  }
}

.tpl-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 640px) {
  .tpl-badge-row {
    justify-content: flex-start;
  }
}

.tpl-chip {
  padding: 0.25rem 0.7rem;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 0.5rem;
}

.tpl-chip-icon {
  color: #f97316;
  font-size: 0.8rem;
}

.tpl-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #f8fafc;
  line-height: 1.2;
}

.tpl-desc {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.5);
  line-height: 1.6;
}

.tpl-rule {
  width: 3rem;
  margin: 1.1rem auto;
  border: 0;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
}

@media (min-width: 640px) {
  .tpl-rule {
    margin-left: 0;
    margin-right: auto;
  }
}

.tpl-feats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.tpl-feats span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.4);
}

.tpl-feats i {
  color: #22c55e;
}

.tpl-use-btn {
  width: 100%;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.tpl-card:hover .tpl-use-btn,
.tpl-use-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.tpl-use-btn:active {
  transform: scale(0.97);
}

.tpl-name {
  display: none;
}

.tpl-active-badge {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  width: 1.6rem;
  height: 1.6rem;
  background: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  z-index: 5;
}

.tpl-hover-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.15rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 3;
  pointer-events: none;
}

.tpl-card:hover .tpl-hover-mask {
  opacity: 1;
  visibility: visible;
}

.tpl-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: #2563eb;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 9999px;
}

.tpl-preview {
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #fff;
}

.tpl-preview::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none;
  z-index: 1;
}

.r-doc {
  height: 100%;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1f2937;
  line-height: 1.45;
  overflow: hidden;
  font-size: 10.5px;
}

.r-doc * {
  box-sizing: border-box;
}

.r-inner {
  padding: 12px 14px 16px;
}

.r-tac {
  text-align: center;
}

.r-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.r-meta {
  margin: 3px 0 0;
  font-size: 9.5px;
  color: #6b7280;
  line-height: 1.4;
}

.r-summary {
  margin: 6px 0 0;
  font-size: 8.5px;
  color: #6b7280;
  line-height: 1.5;
}

.r-work {
  margin-top: 8px;
}

.r-work-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 10px;
}

.r-work-row strong {
  color: #111827;
  font-weight: 600;
}

.r-work-row span {
  color: #9ca3af;
  font-size: 8.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.r-work-role {
  font-size: 9px;
  color: #6b7280;
  margin-top: 1px;
}

.r-work-bullet {
  margin: 4px 0 0;
  font-size: 9px;
  color: #4b5563;
  line-height: 1.45;
  padding-left: 8px;
  position: relative;
}

.r-work-bullet::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #9ca3af;
}

.r-block {
  margin-top: 8px;
}

.r-block-title {
  margin: 0 0 3px;
  font-size: 9.5px;
  font-weight: 700;
  color: #374151;
}

.r-block-line {
  margin: 0;
  font-size: 9px;
  color: #6b7280;
  line-height: 1.4;
}

.r-photo {
  border-radius: 50%;
  background: linear-gradient(145deg, #e9d5ff, #c4b5fd);
  flex-shrink: 0;
}

.r-photo-sm {
  width: 22px;
  height: 22px;
}

.r-photo-lg {
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
}

.r-photo-white {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.r-divider {
  height: 1px;
  background: #111827;
  margin: 8px 0;
}

.r-divider-double {
  height: 3px;
  border-top: 1px solid #111827;
  border-bottom: 1px solid #111827;
  margin: 8px auto;
  width: 65%;
}

.r-dot {
  width: 20px;
  height: 2px;
  background: #10b981;
  margin: 6px auto 10px;
}

.r-style-minimal .r-accent {
  height: 4px;
  background: #7c6aef;
}

.r-style-minimal .r-block-title {
  color: #7c6aef;
  border-bottom: 1px solid #ede9fe;
  padding-bottom: 2px;
}

.r-style-executive {
  border-left: 3px solid #111827;
}

.r-style-executive .r-name {
  font-family: Georgia, 'Noto Serif SC', serif;
}

.r-style-creative .r-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
}

.r-style-creative .r-hero .r-photo {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.35);
}

.r-style-creative .r-hero .r-name {
  color: #fff;
  font-size: 14px;
}

.r-style-creative .r-hero .r-meta {
  color: rgba(255, 255, 255, 0.88);
}

.r-style-creative .r-block-title {
  color: #6366f1;
}

.r-style-academic .r-name {
  color: #065f46;
}

.r-style-academic .r-summary,
.r-style-intern .r-summary,
.r-style-classic .r-summary,
.r-style-teacher .r-summary {
  text-align: center;
}

.r-style-academic .r-block-title {
  color: #059669;
}

.r-style-column {
  display: grid;
  grid-template-columns: 34% 66%;
  height: 100%;
}

.r-style-column .r-aside {
  background: linear-gradient(180deg, #0891b2, #0e7490);
  color: #fff;
  padding: 12px 8px;
  text-align: center;
}

.r-style-column .r-aside .r-name {
  font-size: 11px;
  color: #fff;
}

.r-style-column .r-aside-label {
  font-size: 8.5px;
  opacity: 0.92;
  margin: 2px 0 8px;
}

.r-style-column .r-aside-info {
  font-size: 8px;
  line-height: 1.5;
  opacity: 0.9;
  margin: 0;
}

.r-style-column .r-main {
  padding: 12px 10px;
}

.r-style-column .r-block-title {
  color: #0891b2;
}

.r-style-timeline .r-tl {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid #fcd34d;
}

.r-style-timeline .r-tl-node {
  position: relative;
  margin-bottom: 10px;
  padding-left: 4px;
}

.r-style-timeline .r-tl-node::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #fcd34d;
}

.r-style-timeline .r-tl-node span {
  display: block;
  font-size: 8px;
  color: #d97706;
}

.r-style-timeline .r-tl-node strong {
  display: block;
  font-size: 9.5px;
  color: #111827;
  margin-top: 1px;
}

.r-style-timeline .r-tl-node p {
  margin: 2px 0 0;
  font-size: 8.5px;
  color: #6b7280;
}

.r-style-classic .r-name {
  font-family: Georgia, 'Noto Serif SC', serif;
}

.r-style-classic .r-meta {
  letter-spacing: 0.05em;
}

.r-style-compact {
  padding: 10px 12px;
}

.r-style-compact .r-compact-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #7c6aef;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.r-style-compact .r-compact-head .r-name {
  font-size: 13px;
}

.r-style-compact .r-compact-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.r-style-compact .r-work,
.r-style-compact .r-block {
  margin-top: 0;
}

.r-style-compact .r-work-row,
.r-style-compact .r-work-role,
.r-style-compact .r-work-bullet,
.r-style-compact .r-block-line {
  font-size: 8px;
}

.r-style-elegant .r-elegant-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.r-style-elegant .r-name {
  font-family: Georgia, 'Noto Serif SC', serif;
}

.r-style-elegant .r-dash {
  margin: 8px 0 4px;
  font-size: 9px;
  color: #a8a29e;
  font-family: Georgia, serif;
}

.r-style-split {
  padding: 12px 14px;
}

.r-style-split .r-split-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #111827;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.r-style-split .r-split-top .r-name {
  font-size: 13px;
}

.r-style-split .r-label {
  display: inline-block;
  background: #111827;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  padding: 2px 6px;
  margin: 6px 0 4px;
}

.r-style-dev {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
}

.r-style-dev .r-prompt {
  margin: 0 0 4px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 8px;
  color: #22d3ee;
}

.r-style-dev .r-name {
  font-size: 13px;
  color: #22d3ee;
  font-family: 'SF Mono', Menlo, monospace;
}

.r-style-dev .r-meta {
  color: #94a3b8;
  font-family: 'SF Mono', Menlo, monospace;
}

.r-style-dev .r-summary {
  color: #94a3b8;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 8px;
}

.r-style-dev .r-block-title {
  color: #22d3ee;
  font-family: 'SF Mono', Menlo, monospace;
}

.r-style-dev .r-block-line {
  color: #cbd5e1;
  font-family: 'SF Mono', Menlo, monospace;
}

.r-style-fresh {
  background: #f9fafb;
}

.r-style-fresh .r-name {
  color: #7c6aef;
}

.r-style-fresh .r-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 8px;
}

.r-style-fresh .r-card .r-work,
.r-style-fresh .r-card .r-block {
  margin-top: 0;
}

.r-style-fresh .r-block-title {
  color: #7c6aef;
}

.r-style-bold .r-bold-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}

.r-style-bold .r-bold-banner .r-name {
  color: #fff;
  font-size: 14px;
}

.r-style-bold .r-bold-banner .r-meta {
  color: rgba(255, 255, 255, 0.9);
}

.r-style-bold .r-block-title {
  color: #dc2626;
}

.r-style-intern .r-name { color: #2563eb; }
.r-style-intern .r-dot { background: #3b82f6; }
.r-style-intern .r-block-title { color: #2563eb; }

.r-style-product .r-accent { height: 4px; background: #f97316; }
.r-style-product .r-block-title { color: #ea580c; border-bottom: 1px solid #ffedd5; padding-bottom: 2px; }

.r-style-fe .r-fe-bar { height: 4px; background: #0ea5e9; }
.r-style-fe .r-block-title { color: #0284c7; }

.r-style-be .r-aside-dark {
  background: linear-gradient(180deg, #1e293b, #0f172a);
}

.r-style-be .r-block-title { color: #334155; }

.r-style-teacher .r-name { font-family: Georgia, 'Noto Serif SC', serif; color: #78350f; }
.r-style-teacher .r-block-title { color: #92400e; }

.r-style-medical .r-block-title { color: #0d9488; }
.r-style-medical .r-photo-sm { background: linear-gradient(145deg, #99f6e4, #5eead4); }

.r-style-startup .r-hero-warm {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.r-style-startup .r-hero-warm .r-photo { background: rgba(255,255,255,0.35); }
.r-style-startup .r-hero-warm .r-name { color: #fff; font-size: 14px; }
.r-style-startup .r-hero-warm .r-meta { color: rgba(255,255,255,0.9); }
.r-style-startup .r-block-title { color: #ea580c; }

.r-style-consultant {
  border-left: 3px solid #1e3a5f;
}

.r-style-consultant .r-name { font-family: Georgia, 'Noto Serif SC', serif; }
.r-style-consultant .r-divider { background: #1e3a5f; }
.r-style-consultant .r-block-title { color: #1e3a5f; }

.tpl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  font-size: 0.875rem;
}
