/* 智证证件照 - 公共样式 */
/* 基于 Figma 设计稿 / 原 React + Tailwind 项目转换 */

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: #030213;
  --card: #ffffff;
  --card-foreground: #030213;
  --popover: #ffffff;
  --popover-foreground: #030213;
  --primary: #1677ff;
  --primary-foreground: #ffffff;
  --brand: #1677ff;
  --brand-hover: #0e5fd9;
  --action: #ff6700;
  --action-hover: #e65c00;
  --page: #f7f8fa;
  --secondary: #f0f1f5;
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --ring: #a1a1aa;
  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  font-size: var(--font-size);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

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

button {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* 工具类 */
.container {
  width: 100%;
  max-width: 90rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.block { display: block; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.grow { flex-grow: 1; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-7 { gap: 1.75rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-auto { margin-right: auto; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.p-1 { padding: 0.25rem; }
.p-1_5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-9 { padding-left: 2.25rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-16 { padding-bottom: 4rem; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.tracking-tight { letter-spacing: -0.025em; }

.text-white { color: #ffffff; }
.text-brand { color: var(--brand); }
.text-action { color: var(--action); }
.text-destructive { color: var(--destructive); }
.text-foreground { color: var(--foreground); }
.text-foreground\/60 { color: rgba(3, 2, 19, 0.6); }
.text-foreground\/80 { color: rgba(3, 2, 19, 0.8); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.required-mark { color: #ef4444; margin-left: 0.125rem; font-weight: 400; }

.bg-white { background-color: #ffffff; }
.bg-page { background-color: var(--page); }
.bg-brand { background-color: var(--brand); }
.bg-action { background-color: var(--action); }
.bg-destructive { background-color: var(--destructive); }
.bg-muted { background-color: var(--muted); }
.bg-green-100 { background-color: #dcfce7; }
.text-green-700 { color: #15803d; }
.bg-amber-100 { background-color: #fef3c7; }
.text-amber-700 { color: #b45309; }
.bg-blue-100 { background-color: #dbeafe; }
.text-blue-700 { color: #1d4ed8; }

.border { border-width: 1px; border-style: solid; }
.border-0 { border-width: 0; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-border { border-color: var(--border); }
.border-brand { border-color: var(--brand); }
.border-black\/10 { border-color: rgba(0, 0, 0, 0.1); }
.border-dashed { border-style: dashed; }
.border-2 { border-width: 2px; }

.rounded-sm { border-radius: 0.125rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-fit { width: fit-content; }
.min-w-\[130px\] { min-width: 130px; }

.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-64 { height: 16rem; }
.min-h-64 { min-height: 16rem; }
.min-h-screen { min-height: 100vh; }
.max-h-64 { max-height: 16rem; }
.max-h-\[50vh\] { max-height: 50vh; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-2xl { max-width: 42rem; }

.aspect-\[3\/4\] { aspect-ratio: 3/4; }
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

.cursor-pointer { cursor: pointer; }
.outline-none { outline: none; }
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color, background-color, border-color 0.2s ease; }
.hover\:-translate-y-0_5:hover { transform: translateY(-2px); }
.hover\:border-brand:hover { border-color: var(--brand); }
.hover\:text-brand:hover { color: var(--brand); }
.hover\:text-white:hover { color: #fff; }
.hover\:bg-brand:hover { background-color: var(--brand); color: #fff; }
.hover\:bg-brand\/5:hover { background-color: rgba(22, 119, 255, 0.05); }
.hover\:bg-page:hover { background-color: var(--page); }
.hover\:bg-action-hover:hover { background-color: var(--action-hover); }
.hover\:bg-destructive:hover { background-color: var(--destructive); color: #fff; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.hover\:underline:hover { text-decoration: underline; }

.bg-brand\/10 { background-color: rgba(22, 119, 255, 0.1); }
.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6); }

.ring-2 { box-shadow: 0 0 0 2px var(--brand); }
.ring-brand { --tw-ring-color: var(--brand); }
.ring-offset-2 { outline: 2px solid #fff; outline-offset: 2px; }

/* 针对颜色选择器的 ring 效果 */
.color-dot.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand);
}

/* 用于 tool-detail 中的颜色点 */
button[class*="ring-2 ring-brand"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand);
}

.backdrop-blur { backdrop-filter: blur(8px); }
.grayscale { filter: grayscale(100%); }
.opacity-60 { opacity: 0.6; }
.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 响应式 */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:gap-3 { gap: 0.75rem; }
  .sm\:col-span-full { grid-column: 1 / -1; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid { display: grid; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-\[200px_1fr\] { grid-template-columns: 200px 1fr; }
  .md\:grid-cols-\[1\.5fr_1fr_1fr_1fr\] { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .md\:order-last { order: 9999; }
  .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .md\:py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .md\:py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 布局 */
.app-layout {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--page);
}

.app-main {
  flex: 1;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--primary);
  color: var(--primary-foreground);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--accent);
}

.btn-outline.brand {
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline.brand:hover {
  background: var(--brand);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
}

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

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

.btn-destructive {
  color: var(--destructive);
  border-color: var(--border);
  background: transparent;
}

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

/* 输入框 */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-background);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.input-icon-wrap .input {
  padding-left: 2.25rem;
}

/* 卡片 */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 500;
  color: var(--muted-foreground);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* 弹窗 */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dialog-overlay.active {
  display: flex;
}

.dialog {
  width: 100%;
  max-width: 28rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: dialogIn 0.2s ease;
}

.dialog.dialog-lg {
  max-width: 42rem;
}

.dialog.dialog-xl {
  max-width: 48rem;
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-header {
  padding: 1.5rem 1.5rem 0;
}

.dialog-title {
  font-size: 1.125rem;
  font-weight: 500;
}

.dialog-desc {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.dialog-body {
  padding: 1.5rem;
}

.dialog-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.dialog-footer .btn {
  flex: 1;
}

/* 标签页 */
.tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius);
  background: var(--muted);
  margin-bottom: 1rem;
}

.tab-trigger {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-trigger.active {
  background: #fff;
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Switch */
.switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--switch-background);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.switch.active {
  background: var(--brand);
}

.switch.active::after {
  transform: translateX(1.25rem);
}

/* Slider */
.slider {
  width: 100%;
  height: 1.25rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--muted);
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 9999px;
  background: var(--brand);
}

.slider-thumb {
  position: absolute;
  top: 50%;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  transform: translate(-50%, -50%);
}

/* 上传区域 */
.uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.uploader:hover,
.uploader.dragging {
  border-color: var(--brand);
  background: rgba(22, 119, 255, 0.05);
}
.uploader-icon svg {
  width: 2.5rem;
  height: 2.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  min-width: 240px;
  text-align: center;
}

.toast.success { background: rgba(34, 197, 94, 0.95); }
.toast.error { background: rgba(239, 68, 68, 0.95); }
.toast.info { background: rgba(22, 119, 255, 0.95); }

.toast svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 下拉菜单 */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  min-width: 10rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 50;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--accent);
}

/* 下拉触发 */
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  cursor: pointer;
  color: rgba(3, 2, 19, 0.8);
}

.dropdown-trigger:hover,
.dropdown-trigger.active {
  color: var(--brand);
}

/* 导航 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.navbar-inner {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-left {
  display: none;
  align-items: center;
  gap: 1rem;
}

.navbar-right {
  display: none;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .navbar-left,
  .navbar-right {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .navbar-left {
    gap: 4rem;
  }

  .navbar-right {
    gap: 1.5rem;
  }
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .navbar-nav {
    gap: 1.25rem;
  }
}

.nav-link {
  font-size: 0.875rem;
  color: rgba(3, 2, 19, 0.8);
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-search {
  width: 160px;
}

@media (min-width: 1024px) {
  .navbar-search {
    width: 280px;
  }
}

.navbar-search .input-icon-wrap,
.navbar-search .input {
  width: 100%;
}

.navbar-search .input {
  height: 2.25rem;
  font-size: 0.8125rem;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  border: none;
  background: transparent;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 1rem;
}

.mobile-drawer.open {
  display: block;
}

.mobile-search {
  margin-bottom: 1rem;
}

.mobile-search .input-icon-wrap,
.mobile-search .input {
  width: 100%;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.footer-col-title {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: rgba(3, 2, 19, 0.6);
}

.footer-col-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col-list a {
  font-size: 0.875rem;
  color: rgba(3, 2, 19, 0.8);
}

.footer-col-list a:hover {
  color: var(--brand);
}

.footer-copy {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* 颜色选择器 */
.color-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-dot.active {
  box-shadow: 0 0 0 2px var(--brand), 0 0 0 4px #fff;
}

.color-dot.active::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.color-dot.active[style*="background:#ffffff"]::after,
.color-dot.active[style*="background: white"]::after,
.color-dot.active[style*="background:rgb(255,255,255"]::after {
  color: #333;
  text-shadow: none;
}

/* 首页证件照 tab */
.home-tab {
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  padding: 0.5rem 1.75rem;
}
.home-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* 电子照尺寸标注框 */
#home-photo-frame {
  margin: 50px 64px;
}
.size-frame {
  position: absolute;
  top: -40px;
  left: -52px;
  right: -52px;
  bottom: -40px;
  pointer-events: none;
}
.size-frame::before,
.size-frame::after {
  content: '';
  position: absolute;
  border: 1px dashed #ef4444;
}
.size-frame::before {
  top: 32px; left: 50px; right: 50px; bottom: 32px;
  border-left: none; border-right: none;
}
.size-frame::after {
  top: 40px; left: 42px; right: 42px; bottom: 40px;
  border-top: none; border-bottom: none;
}
.size-label {
  position: absolute;
  color: #ef4444;
  font-size: 11px;
  line-height: 1;
  background: rgba(255,255,255,0.85);
  padding: 2px 4px;
  border-radius: 2px;
}
.size-label.top { top: 8px; left: 50%; transform: translateX(-50%); }
.size-label.bottom { bottom: 8px; left: 50%; transform: translateX(-50%); }
.size-label.left { left: 8px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; }
.size-label.right { right: 8px; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: center; }

/* 选中规格按钮 */
.spec-chip {
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: max-content;
}

.spec-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.spec-chip.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.spec-chip span {
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

.spec-chip.active span {
  color: rgba(255,255,255,0.8);
}

.spec-radio-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.spec-radio-item:hover {
  border-color: var(--brand);
  background: rgba(22, 119, 255, 0.03);
}

.spec-radio-item input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.color-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.color-select-btn.active {
  border-color: var(--brand);
  background: rgba(22, 119, 255, 0.08);
  color: var(--brand);
}

.color-select-btn .color-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}

/* 滚动条优化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 3px;
}

/* 首页 Hero 文案微调 */
.hero-text {
  padding-left: 0;
}

@media (min-width: 768px) {
  .hero-text {
    padding-left: 2rem;
  }
}

/* ================= 分享弹窗 ================= */
.share-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .share-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.share-item:hover {
  background: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}

.share-icon {
  display: inline-flex;
  color: var(--primary);
}

.share-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.share-label {
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
}

/* ================= 首页换装 ================= */
#home-result-top {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  align-items: stretch;
}

#home-result-top {
  height: 420px;
}

#home-photo-box,
#home-secondary-box {
  height: 100%;
  overflow: hidden;
}

#home-secondary-box {
  position: relative;
}

#home-clothe-panel {
  position: absolute;
  inset: 0;
  background: #f8f9fb;
  padding: 1rem;
}

#home-preview-layout-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

#home-photo-frame img {
  max-height: 300px;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  #home-result-top {
    flex-direction: column;
    height: auto;
  }
  #home-photo-box,
  #home-secondary-box {
    min-height: 280px;
    height: auto;
  }
}

.home-clothe-tab {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.home-clothe-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.home-clothe-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.home-preview-clothe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--brand);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.home-preview-clothe-btn:hover {
  background: var(--brand);
  color: #fff;
}

.home-clothe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.5rem;
}

.home-clothe-item {
  position: relative;
  border: 2px solid transparent;
  border-radius: 0.375rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8f9fb;
  aspect-ratio: 1;
}

.home-clothe-item:hover {
  border-color: var(--brand);
}

.home-clothe-item.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.home-clothe-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-clothe-item .name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.125rem 0.25rem;
  font-size: 0.65rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted-foreground);
}

.home-clothe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}

.share-section {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--muted);
  text-align: center;
}

.share-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.share-preview canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.share-preview img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.share-link-box {
  padding: 0.875rem;
  border-radius: var(--radius);
  background: var(--muted);
}

#success-share-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--primary);
  font-weight: 500;
}

.poster-template-list {
  margin-bottom: 1rem;
}

.poster-template-list .flex {
  scrollbar-width: thin;
}

.poster-template-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 108px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.poster-template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 2px);
}

.poster-template-thumb:hover,
.poster-template-thumb.active {
  border-color: var(--primary);
}

/* 资讯分类筛选芯片 */
.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.category-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.category-chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* 资讯卡片 */
.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.article-card:hover .article-card-title {
  color: var(--brand);
}
.article-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.article-card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* line-clamp 通用 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
