:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --panel: #111827;
  --border: #1f2937;
  --muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --dash: #334155;
  --bg-page: #f9fafb;
  --card: #ffffff;
  --text-main: #0f172a;
  --accent-soft: #eff6ff;
  --border-soft: #e5e7eb;
  --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.18);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'HarmonyOS Sans SC', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, 'Microsoft Yahei', sans-serif;
  background: var(--bg);
  color: #e2e8f0;
}
.site-header {
  padding: 32px 24px 0;
  max-width: 1160px;
  margin: 0 auto;
  color: #f9fafb;
}
.hero {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.06));
  border-radius: 24px 24px 18px 18px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.22) 0, transparent 40%),
    radial-gradient(circle at 80% 0, rgba(59, 130, 246, 0.6) 0, transparent 55%);
  opacity: 0.8;
  pointer-events: none;
}
.hero-main,
.hero-side {
  position: relative;
  z-index: 1;
}
.hero-main {
  max-width: 520px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.8);
  color: #e5edff;
}
.hero h1 {
  margin: 10px 0 8px;
  font-size: 30px;
  letter-spacing: 0.05em;
}
.hero-sub {
  margin: 0;
  font-size: 14px;
  color: #e5edff;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.hero-meta span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
}
.hero-side {
  text-align: right;
}
.lang-switch.field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.lang-switch.field span {
  white-space: nowrap;
  color: var(--muted);
}
.hero-tagline {
  font-size: 13px;
  opacity: 0.95;
}
.hero-product-name {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
}
main {
  max-width: 1160px;
  margin: 12px auto 40px;
  padding: 0 24px 24px;
  min-width: 550px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: flex-start;
}
.editor {
  background: var(--panel);
  border-radius: 20px;
  padding: 16px 18px 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
}
.editor-section + .editor-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}
.editor-section-avatar {
  padding-top: 18px;
}
.editor-section-avatar .field {
  margin-top: 10px;
}
.editor-section-avatar .field:first-of-type {
  margin-top: 12px;
}
.editor-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #111827;
}
.editor-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field span {
  font-size: 12px;
  color: var(--muted);
}
.select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 13px;
  background: #0b1220;
  color: #e2e8f0;
}
.color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04) inset;
  cursor: pointer;
  outline: none;
  display: none;
}
.color-dot:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}
.color-picker input[type='color'].input {
  appearance: none;
  padding: 0;
  height: 16px;
  border-radius: 999px;
  background: transparent;
}
.color-picker input[type='color'].input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker input[type='color'].input::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}
.input,
.textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 13px;
  background: #0b1220;
  color: #e2e8f0;
}
.input:focus,
.textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.textarea {
  resize: vertical;
  min-height: 80px;
}

.textarea {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) #020617;
}
.textarea::-webkit-scrollbar {
  width: 6px;
}
.textarea::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 999px;
}
.textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}
.textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.9);
}
.editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, border-color 0.15s ease;
}
.btn.small {
  padding: 5px 11px;
  font-size: 12px;
}
.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}
.btn.ghost {
  background: #0b1220;
  border-color: var(--border);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.file-upload .file-button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.file-upload .file-button .btn {
  /* main upload button */
}
.file-upload .file-button .file-main-button {
  display: block;
  width: 80%;
  max-width: 420px;
  min-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-upload .file-button .file-clear-btn {
  width: auto;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  display: none;
}
.file-upload .file-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.hobby-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.identity-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.identity-editor-header {
  display: grid;
  grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}
.identity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.identity-item-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 120px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid var(--accent);
}
.identity-item-row.dragging {
  opacity: 0.7;
}
.identity-item-drag {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  cursor: grab;
}
.identity-item-label .input,
.identity-item-value .input {
  font-size: 12px;
  padding: 4px 8px;
}
.identity-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.identity-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) #020617;
}
.identity-list::-webkit-scrollbar {
  width: 6px;
}
.identity-list::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 999px;
}
.identity-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}
.identity-list::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.9);
}
.hobby-item {
  border-radius: 12px;
  padding: 9px 10px;
  background: #0b1220;
  border: 1px solid var(--accent);
  display: grid;
  grid-template-columns: minmax(0, 90px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.hobby-item-title {
  font-size: 12px;
  color: var(--muted);
}
.hobby-item-title .input {
  padding: 4px 8px;
  font-size: 12px;
}
.hobby-item-main {
  font-size: 13px;
}
.hobby-remove {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: none;
  background: rgba(248, 113, 113, 0.08);
  color: #b91c1c;
  cursor: pointer;
}
.preview {
  position: relative;
}
.preview-card-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.hobby-list::-webkit-scrollbar,
.cv-hobbies::-webkit-scrollbar {
  width: 6px;
}
.hobby-list::-webkit-scrollbar-track,
.cv-hobbies::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 999px;
}
.hobby-list::-webkit-scrollbar-thumb,
.cv-hobbies::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}
.hobby-list::-webkit-scrollbar-thumb:hover,
.cv-hobbies::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.9);
}

.hobby-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) #020617;
}
.cv-hobbies {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) transparent;
}
.preview-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.cv-card {
  position: relative;
  width: 520px;
  border-radius: 32px;
  background: var(--bg-page);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.cv-top {
  position: relative;
  padding: 20px 24px 16px;
}
.cv-top-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0, var(--accent-light, #60a5fa) 0, transparent 45%),
    radial-gradient(circle at 90% 0, var(--accent-dark, #1d4ed8) 0, transparent 50%),
    linear-gradient(135deg, var(--accent, #2563eb), var(--accent-strong, #4f46e5));
}
.cv-top-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  color: #f9fafb;
}
.cv-top-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.3);
}
.cv-top-title {
  margin-top: 8px;
  font-size: 18px;
  letter-spacing: 0.06em;
}
.cv-top-name {
  display: inline-block;
  min-width: 48px;
}
.cv-top-maker {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 4px;
  white-space: nowrap;
}
.cv-section {
  padding: 14px 24px 8px;
}
.cv-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 8px;
  color: var(--accent);
}
.cv-section-title-main {
  font-size: 14px;
  font-weight: 600;
}
.cv-section-title-sub {
  font-size: 11px;
  text-transform: uppercase;
  color: #9ca3af;
}
.cv-section-index {
  font-size: 18px;
  font-weight: 600;
  color: rgba(37, 99, 235, 0.3);
}
.cv-section-body {
  margin-top: 10px;
  display: flex;
  gap: 16px;
}
.cv-section-body-two {
  align-items: stretch;
}
.cv-block {
  flex: 1;
  background: #ffffff;
  border-radius: 18px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(209, 213, 219, 0.9);
}
.cv-block-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
}
.cv-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.cv-section-body-two .cv-block:first-child {
  display: flex;
  flex-direction: column;
}
.cv-section-body-two .cv-block:first-child .cv-info-grid {
  flex: 1;
  align-content: space-between;
}
.cv-info-item {
  font-size: 11px;
  color: #4b5563;
  padding: 4px 0 5px;
  display: flex;
  align-items: center;
  border-bottom: 1px dashed rgba(209, 213, 219, 0.8);
}
.cv-info-label {
  color: #9ca3af;
  margin-right: 4px;
}
.cv-info-value {
  font-weight: 500;
}
.cv-avatar-block {
  max-width: 180px;
}
.cv-section-body-two .cv-avatar-block {
  display: flex;
  flex-direction: column;
}
.cv-section-body-two .cv-avatar-block .cv-avatar-wrapper {
  margin-top: auto;
  margin-bottom: auto;
  align-self: center;
}
.cv-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cv-avatar-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(209, 213, 219, 0.9);
  background: #111827;
  display: none;
}
.cv-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cv-avatar-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  background: radial-gradient(circle at 50% 0, #e5e7eb 0, #f9fafb 55%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-avatar-face {
  width: 68%;
  height: 68%;
  border-radius: 999px;
  border: 3px solid #111827;
  position: relative;
}
.cv-avatar-face::before,
.cv-avatar-face::after {
  content: '';
  position: absolute;
  top: 40%;
  width: 16%;
  height: 16%;
  border-radius: 999px;
  background: #111827;
}
.cv-avatar-face::before {
  left: 20%;
}
.cv-avatar-face::after {
  right: 20%;
}
.cv-avatar-caption {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
}
.cv-paragraph {
  font-size: 11px;
  line-height: 1.6;
  color: #4b5563;
}
.cv-hobbies {
  flex-direction: column;
}
.cv-hobby-item {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px 12px 9px;
  border: 1px solid rgba(209, 213, 219, 0.9);
}
.cv-hobby-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}
.cv-hobby-text {
  font-size: 11px;
  color: #4b5563;
  line-height: 1.6;
  white-space: pre-line;
}
.cv-footer {
  margin: 10px 20px 20px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.16));
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  font-size: 11px;
  color: #1f2937;
}
.cv-footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cv-footer-cta {
  color: var(--accent);
}

.cv-card[data-template='simple'] .cv-section-header {
  grid-template-columns: minmax(0, 1fr) auto;
}
.cv-card[data-template='simple'] .cv-section-index {
  display: none;
}
.cv-card[data-template='simple'] .cv-top-tag {
  display: none;
}

.cv-card[data-template='business'] .cv-section-body {
  flex-direction: column;
}
.cv-card[data-template='business'] .cv-avatar-block {
  max-width: 100%;
}

.cv-card[data-template='social'] .cv-top-tag {
  background: rgba(248, 250, 252, 0.2);
}
.cv-card[data-template='social'] .cv-footer {
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.12), rgba(56, 189, 248, 0.18));
}

.cv-card[data-template='resume'] {
  max-width: 680px;
  border-radius: 0;
  background: #e5e7eb;
}
.cv-card[data-template='resume'] .cv-top {
  padding: 32px 48px 24px;
  margin-bottom: 0;
  background: #f9fafb;
}
.cv-card[data-template='resume'] .cv-top-bg {
  display: none;
}
.cv-card[data-template='resume'] .cv-top-content {
  color: #111827;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  position: relative;
}
.cv-card[data-template='resume'] .cv-top-tag {
  display: none;
}
.cv-card[data-template='resume'] .cv-top-title {
  margin-top: 0;
  font-size: 20px;
  letter-spacing: 0;
  font-weight: 600;
}
.cv-card[data-template='resume'] .cv-top-title span:last-child {
  display: none;
}
.cv-card[data-template='resume'] .cv-top-maker {
  margin-top: 8px;
  font-size: 12px;
  color: #4b5563;
}
.cv-card[data-template='resume'] .cv-section {
  padding: 0 48px 12px;
}
.cv-card[data-template='resume'] .cv-section-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #111827;
  margin-top: 4px;
}
.cv-card[data-template='resume'] .cv-section-title-main {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 0;
  border-bottom: 2px solid #111827;
}
.cv-card[data-template='resume'] .cv-section-title-sub,
.cv-card[data-template='resume'] .cv-section-index {
  display: none;
}
.cv-card[data-template='resume'] .cv-section-body {
  margin-top: 8px;
}
.cv-card[data-template='resume'] .cv-section-body-two {
  flex-direction: row;
}
.cv-card[data-template='resume'] .cv-block {
  border-radius: 0;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
.cv-card[data-template='resume'] .cv-hobby-item {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0;
}
.cv-card[data-template='resume'] .cv-avatar-block {
  position: absolute;
  top: 32px;
  right: 48px;
  max-width: 120px;
}
.cv-card[data-template='resume'] .cv-avatar-block .cv-block-title {
  display: none;
}
.cv-card[data-template='resume'] .cv-avatar-wrapper {
  align-items: flex-end;
}
.cv-card[data-template='resume'] .cv-avatar-photo,
.cv-card[data-template='resume'] .cv-avatar-placeholder {
  border-radius: 12px;
}
.cv-card[data-template='resume'] .cv-avatar-caption {
  text-align: right;
}
.cv-hobbies {
  max-height: none;
  overflow: visible;
}
.cv-card[data-template='resume'] .cv-footer-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.cv-card[data-template='resume'] .cv-footer-badge {
  margin-top: 4px;
}

.cv-card[data-template='resume'] .cv-footer {
  margin: 12px 0 0;
  background: #f9fafb;
  border-radius: 0;
  padding: 10px 48px 16px;
}
.cv-card[data-template='resume'] .cv-footer-cta {
  color: #111827;
}
.cv-card[data-template='resume'] .cv-section-body-social {
  flex-direction: column;
  gap: 6px;
}
.cv-card[data-template='resume'] .cv-section-body-social .cv-block {
  flex: initial;
  width: 100%;
}
.cv-footer-id {
  text-align: right;
  color: #4b5563;
}
.cv-footer-badge {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #6b7280;
}
.preview-tip {
  margin-top: 10px;
  font-size: 11px;
  color: #dbeafe;
  text-align: center;
}
.site-footer {
  text-align: center;
  padding: 4px 20px 16px;
  color: #9ca3af;
  font-size: 11px;
}
.site-footer .legal {
  display: inline-grid;
  gap: 2px;
}

.site-footer a { 
  color: #9ca3af;
  text-decoration: none;
}

.site-footer a:hover{ 
  text-decoration: underline;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor {
    order: 2;
  }
  .preview {
    order: 1;
  }
}
@media (max-width: 640px) {
  main {
    padding-inline: 16px;
  }
  .site-header {
    padding-inline: 16px;
  }
  .hero {
    flex-direction: column;
  }
  .editor {
    padding-inline: 14px;
  }
}
