:root {
  color-scheme: light;
  
  /* 光谱色系 - Spectrum Palette */
  --prism-clear: #F0F9FF;
  --prism-ice: #E0F2FE;
  --prism-glass: #BAE6FD;
  --spectrum-blue: #0EA5E9;
  --spectrum-cyan: #06B6D4;
  --spectrum-violet: #8B5CF6;
  --spectrum-pink: #EC4899;
  --spectrum-indigo: #6366F1;
  
  /* 折射效果 - Refraction Effects */
  --refraction-glow: rgba(14, 165, 233, 0.12);
  --refraction-beam: rgba(139, 92, 246, 0.08);
  --crystal-shine: rgba(255, 255, 255, 0.6);
  
  /* 中性色 - Neutrals */
  --ink: #0F172A;
  --muted: #64748B;
  --line: #CBD5E1;
  --paper: #F8FAFC;
  --panel: #FFFFFF;
  
  /* 语义色 - Semantic */
  --success: #0EA5E9;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* 阴影 - Shadows (光学玻璃的清透感) */
  --shadow-prism: 0 4px 16px rgba(14, 165, 233, 0.15), 0 1px 4px rgba(14, 165, 233, 0.1);
  --shadow-float: 0 12px 40px rgba(139, 92, 246, 0.2), 0 4px 12px rgba(14, 165, 233, 0.15);
  --shadow-spectrum: 0 8px 32px rgba(14, 165, 233, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 光谱折射环境 - 棱镜分离的彩虹光 */
  background:
    radial-gradient(ellipse at 20% 10%, var(--refraction-beam), transparent 50%),
    radial-gradient(circle at 80% 20%, var(--refraction-glow), transparent 60%),
    linear-gradient(135deg, var(--prism-clear), var(--prism-ice) 40%, var(--paper));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 32px) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .shell {
    padding: 16px clamp(14px, 3.5vw, 24px) 0;
  }
}

.panel {
  /* 水晶玻璃的质感 - 透明清澈 */
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.9)),
    var(--panel);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 20px;
  box-shadow: var(--shadow-prism);
  padding: clamp(20px, 5vw, 32px);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .panel {
    padding: clamp(18px, 4.5vw, 24px);
    border-radius: 18px;
  }
}

/* 光谱折射效果 */
.panel::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 500px;
  height: 500px;
  background: 
    radial-gradient(circle, var(--refraction-glow), transparent 50%),
    radial-gradient(circle at 60% 40%, var(--refraction-beam), transparent 60%);
  pointer-events: none;
  animation: spectrum-rotate 8s linear infinite;
}

/* 棱镜边缘的彩虹光 */
.panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--spectrum-violet), 
    var(--spectrum-blue), 
    var(--spectrum-cyan), 
    var(--spectrum-pink)
  );
  opacity: 0.4;
}

@keyframes spectrum-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.title-row,
.result-head,
.actions,
.card-actions,
.meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-row,
.result-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.title-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.3));
  animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .title-row,
  .result-head,
  .actions,
  .card-actions,
  .meta {
    gap: 12px;
  }
  
  .title-content {
    gap: 10px;
  }
  
  .logo {
    width: 32px;
    height: 32px;
  }
}

.eyebrow {
  margin: 0 0 4px;
  /* 光谱渐变文字 */
  background: linear-gradient(90deg, var(--spectrum-blue), var(--spectrum-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
}

h2 {
  font-size: clamp(18px, 4vw, 22px);
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
}

.badge {
  flex: 0 0 auto;
  /* 光谱标签 - 玻璃质感 */
  background: 
    linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(139, 92, 246, 0.1)),
    rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--spectrum-blue);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 
    0 2px 8px rgba(14, 165, 233, 0.15),
    inset 0 1px 0 var(--crystal-shine);
  backdrop-filter: blur(8px);
}

/* 帮助按钮 */
.help-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: 
    linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(139, 92, 246, 0.12)),
    rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(14, 165, 233, 0.35);
  color: var(--spectrum-blue);
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(14, 165, 233, 0.15),
    inset 0 1px 0 var(--crystal-shine);
  backdrop-filter: blur(10px);
  min-height: auto;
}

.help-btn:hover {
  background: 
    linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(139, 92, 246, 0.18)),
    rgba(255, 255, 255, 0.95);
  border-color: var(--spectrum-blue);
  box-shadow: 
    0 4px 16px rgba(14, 165, 233, 0.3),
    0 0 24px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 var(--crystal-shine);
  transform: translateY(-2px);
}

.help-btn svg {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(14, 165, 233, 0.3));
}

.input-card {
  margin-top: 28px;
}

/* 帮助弹窗内容 */
.help-modal-content {
  position: relative;
  max-width: 560px;
  width: 90vw;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.95)),
    white;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 
    0 20px 60px rgba(14, 165, 233, 0.3),
    0 8px 24px rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(20px);
  animation: modal-scale-in 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.help-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(14, 165, 233, 0.15);
}

.help-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spectrum-blue), var(--spectrum-cyan));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 16px rgba(14, 165, 233, 0.4),
    inset 0 1px 0 var(--crystal-shine);
}

.help-header svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.help-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--spectrum-blue), var(--spectrum-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 28px;
}

.help-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.help-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spectrum-blue), var(--spectrum-cyan));
  color: white;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 12px rgba(14, 165, 233, 0.35),
    inset 0 1px 0 var(--crystal-shine);
}

.help-step-content {
  flex: 1;
}

.help-step-content h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.help-step-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.help-step-content code {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--spectrum-blue);
  font-family: 'Consolas', 'Monaco', monospace;
}

.help-tips {
  padding: 20px;
  background: 
    linear-gradient(135deg, rgba(14, 165, 233, 0.06), rgba(139, 92, 246, 0.06)),
    rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(14, 165, 233, 0.2);
  border-radius: 14px;
  box-shadow: 
    0 2px 8px rgba(14, 165, 233, 0.1),
    inset 0 1px 0 var(--crystal-shine);
}

.help-tips h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.help-tips ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.help-tips li {
  position: relative;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 8px;
}

.help-tips li:last-child {
  margin-bottom: 0;
}

.help-tips li::before {
  content: '•';
  position: absolute;
  left: -12px;
  color: var(--spectrum-blue);
  font-weight: 900;
  font-size: 16px;
}

/* 手机端帮助弹窗优化 */
@media (max-width: 560px) {
  .help-modal-content {
    width: calc(100vw - 32px);
    padding: 24px 20px;
    border-radius: 18px;
  }

  .help-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    gap: 10px;
  }

  .help-icon {
    width: 36px;
    height: 36px;
  }

  .help-icon svg {
    width: 18px;
    height: 18px;
  }

  .help-header h3 {
    font-size: 20px;
  }

  .help-steps {
    gap: 20px;
    margin-bottom: 20px;
  }

  .help-step {
    gap: 12px;
  }

  .help-step-number {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .help-step-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
  }

  .help-step-content p {
    font-size: 13px;
  }

  .help-step-content code {
    font-size: 11px;
    padding: 2px 6px;
  }

  .help-tips {
    padding: 16px;
  }

  .help-tips h4 {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .help-tips li {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .help-tips li::before {
    font-size: 14px;
  }
}

/* 平板端帮助弹窗优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .help-modal-content {
    width: 85vw;
    max-width: 520px;
    padding: 30px 26px;
  }

  .help-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
  }

  .help-icon {
    width: 40px;
    height: 40px;
  }

  .help-icon svg {
    width: 20px;
    height: 20px;
  }

  .help-header h3 {
    font-size: 22px;
  }

  .help-steps {
    gap: 22px;
    margin-bottom: 24px;
  }

  .help-step {
    gap: 14px;
  }

  .help-step-number {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .help-step-content h4 {
    font-size: 15px;
  }

  .help-step-content p {
    font-size: 13px;
  }

  .help-tips {
    padding: 18px;
  }

  .help-tips h4 {
    font-size: 14px;
  }

  .help-tips li {
    font-size: 13px;
  }
  
  .help-tips li::before {
    font-size: 15px;
  }
}

/* 使用说明（已移除，改为弹窗） */

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .input-card {
    margin-top: 22px;
  }
  
  .help-btn {
    font-size: 13px;
    padding: 8px 14px;
    gap: 5px;
  }
  
  .help-btn svg {
    width: 16px;
    height: 16px;
  }
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  /* 水晶玻璃的透明质感 */
  background: 
    linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.7)),
    white;
  color: var(--ink);
  outline: none;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.6;
  backdrop-filter: blur(8px);
}

textarea:focus {
  border-color: var(--spectrum-blue);
  /* 光谱折射效果 */
  box-shadow: 
    0 0 0 4px var(--refraction-glow),
    0 4px 20px rgba(14, 165, 233, 0.2),
    0 0 40px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

.actions {
  justify-content: flex-end;
  margin-top: 14px;
  gap: 12px;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .actions {
    margin-top: 12px;
    gap: 10px;
  }
}

button,
.download {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  button,
  .download {
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 9px;
  }
}

.primary {
  /* 光谱分离按钮 - 渐变玻璃 */
  background: linear-gradient(135deg, var(--spectrum-blue), var(--spectrum-cyan));
  color: white;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 
    0 4px 16px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 var(--crystal-shine),
    0 0 20px rgba(14, 165, 233, 0.2);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.primary:hover {
  background: linear-gradient(135deg, var(--spectrum-cyan), var(--spectrum-violet));
  box-shadow: 
    0 6px 24px rgba(139, 92, 246, 0.4),
    inset 0 1px 0 var(--crystal-shine),
    0 0 32px rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
}

.primary:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 var(--crystal-shine),
    0 0 16px rgba(14, 165, 233, 0.2);
}

.ghost,
.copy-one {
  /* 玻璃质感次要按钮 */
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.8)),
    white;
  border-color: rgba(14, 165, 233, 0.2);
  color: var(--spectrum-blue);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.ghost:hover,
.copy-one:hover {
  background: 
    linear-gradient(135deg, rgba(240, 249, 255, 0.95), rgba(224, 242, 254, 0.9)),
    white;
  border-color: var(--spectrum-blue);
  box-shadow: 
    0 3px 12px rgba(14, 165, 233, 0.2),
    0 0 20px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

.download {
  /* 光谱提取按钮 - 深色渐变 */
  background: linear-gradient(135deg, var(--spectrum-indigo), var(--ink));
  color: white;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 
    0 3px 12px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 var(--crystal-shine);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.download:hover {
  background: linear-gradient(135deg, var(--spectrum-violet), var(--spectrum-indigo));
  box-shadow: 
    0 5px 16px rgba(139, 92, 246, 0.4),
    inset 0 1px 0 var(--crystal-shine),
    0 0 20px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .status {
    min-height: 22px;
    margin: 14px 0 0;
    font-size: 14px;
  }
}

.status[data-tone="ok"] {
  color: var(--success);
  font-weight: 600;
}

.status[data-tone="warn"] {
  color: var(--warning);
}

.status[data-tone="error"] {
  color: var(--error);
}

.is-loading button[type="submit"] {
  opacity: 0.72;
  pointer-events: none;
}

.result-head {
  margin: 32px 0 20px;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .result-head {
    margin: 24px 0 16px;
  }
}

.grid {
  display: grid;
  /* 桌面端：4列，平板：3列，手机：2列 */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

/* 页脚 */
.footer {
  padding: 48px clamp(16px, 4vw, 32px) 32px;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.footer-note svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin: 0;
}

.footer-links a {
  color: var(--spectrum-blue);
  text-decoration: none;
  transition: all 200ms;
}

.footer-links a:hover {
  color: var(--spectrum-violet);
  text-decoration: underline;
}

.separator {
  color: var(--line);
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 32px;
  }
  
  .footer {
    padding: 32px clamp(14px, 3.5vw, 24px) 24px;
    margin-top: auto;
  }
  
  .footer-note {
    font-size: 12px;
  }
  
  .footer-links {
    font-size: 12px;
  }
}

/* 手机端优化 - 显示2列 */
@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.image-card {
  overflow: hidden;
  /* 光谱分离后的图像 - 水晶玻璃质感 */
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.9)),
    white;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 16px;
  box-shadow: var(--shadow-prism);
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .image-card {
    border-radius: 14px;
  }
}

.image-card:hover {
  box-shadow: var(--shadow-spectrum);
  transform: translateY(-8px);
  border-color: var(--spectrum-violet);
}

/* 光谱折射光晕 */
.image-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 30%, var(--refraction-glow), transparent 40%),
    radial-gradient(circle at 70% 70%, var(--refraction-beam), transparent 40%);
  opacity: 0;
  transition: opacity 400ms;
  pointer-events: none;
  animation: spectrum-shift 6s ease-in-out infinite;
}

.image-card:hover::before {
  opacity: 1;
}

@keyframes spectrum-shift {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10%, 10%);
  }
}

/* 棱镜边缘的彩虹光 */
.image-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, 
    var(--spectrum-violet), 
    var(--spectrum-blue), 
    var(--spectrum-cyan), 
    var(--spectrum-pink)
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 400ms;
  pointer-events: none;
}

.image-card:hover::after {
  opacity: 0.6;
}

.preview-link {
  display: block;
  /* 棱镜内部的光谱背景 */
  background: 
    radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.1), rgba(14, 165, 233, 0.05)),
    linear-gradient(135deg, var(--prism-clear), var(--prism-ice));
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  border: none;
  width: 100%;
  padding: 0;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-link:active {
  transform: scale(0.98);
}

/* 光线折射效果 */
.preview-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(45deg, 
      transparent 30%, 
      var(--refraction-glow) 50%, 
      transparent 70%
    );
  opacity: 0;
  transition: opacity 500ms;
  pointer-events: none;
  transform: translateX(-100%);
}

.preview-link:hover::after {
  opacity: 1;
  animation: light-refract 1.5s ease-out;
}

@keyframes light-refract {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 图片预览弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal[hidden] {
  display: none;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.15), transparent 60%),
    rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  animation: backdrop-blur 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes backdrop-blur {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(20px);
  }
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: modal-scale-in 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

@keyframes modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#modal-image {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(14, 165, 233, 0.3),
    0 8px 24px rgba(139, 92, 246, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(14, 165, 233, 0.3);
  background: var(--panel);
  cursor: default;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.9)),
    white;
  color: var(--spectrum-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 16px rgba(14, 165, 233, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 var(--crystal-shine);
  z-index: 1001;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: 
    linear-gradient(135deg, var(--spectrum-blue), var(--spectrum-cyan)),
    white;
  color: white;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 
    0 6px 20px rgba(14, 165, 233, 0.4),
    0 0 32px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 var(--crystal-shine);
}

.modal-close:active {
  transform: rotate(90deg) scale(0.96);
}

.modal-close svg {
  filter: drop-shadow(0 1px 2px rgba(14, 165, 233, 0.3));
}

.modal-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-radius: 12px;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(240, 249, 255, 0.1)),
    rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 14px;
}

#modal-size {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.modal-action {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-action:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(14, 165, 233, 0.6);
  transform: translateY(-1px);
}

.modal-action:active {
  transform: translateY(0);
}

/* 手机端弹窗优化 */
@media (max-width: 560px) {
  .modal {
    padding: 12px;
  }

  #modal-image {
    max-height: calc(90vh - 80px);
    border-radius: 12px;
  }

  .modal-close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .modal-close svg {
    width: 18px;
    height: 18px;
  }

  .modal-info {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .modal-action {
    padding: 6px 12px;
    font-size: 12px;
  }
}

.preview-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* 光谱分离后的清晰影像 */
  transition: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(1) contrast(1.05) saturate(1.1);
}

.image-card:hover .preview-link img {
  transform: scale(1.06);
  filter: brightness(1.02) contrast(1.08) saturate(1.15);
}

.meta,
.meta,
.card-actions {
  justify-content: space-between;
  padding: 12px;
}

.card-actions {
  padding-top: 0;
  gap: 10px;
}

.card-actions > * {
  flex: 1;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .meta,
  .card-actions {
    padding: 10px;
  }
  
  .card-actions {
    padding-top: 0;
    gap: 8px;
  }
}

.size {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* 平板端优化 */
@media (max-width: 900px) and (min-width: 561px) {
  .size {
    font-size: 12px;
  }
}

.raw-mark {
  /* 光谱标记 */
  background: linear-gradient(135deg, var(--spectrum-blue), var(--spectrum-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  filter: drop-shadow(0 1px 2px rgba(14, 165, 233, 0.3));
}

/* 光谱分离动画 - 加载状态 */
@keyframes spectrum-separate {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes prism-glow {
  0%, 100% {
    opacity: 0.8;
    box-shadow: 
      0 4px 16px rgba(14, 165, 233, 0.3),
      inset 0 1px 0 var(--crystal-shine),
      0 0 20px rgba(14, 165, 233, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 
      0 4px 16px rgba(139, 92, 246, 0.4),
      inset 0 1px 0 var(--crystal-shine),
      0 0 32px rgba(139, 92, 246, 0.3);
  }
}

@keyframes spectrum-emerge {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    filter: blur(4px) saturate(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0) saturate(1.1);
  }
}

.is-loading .primary {
  /* 光谱流动效果 */
  background: 
    linear-gradient(
      90deg,
      var(--spectrum-blue),
      var(--spectrum-cyan),
      var(--spectrum-violet),
      var(--spectrum-pink),
      var(--spectrum-blue)
    );
  background-size: 300% 100%;
  animation: spectrum-separate 2s ease-in-out infinite, prism-glow 2s ease-in-out infinite;
  pointer-events: none;
}

/* 图片卡片出现动画 - 光谱分离浮现 */
.image-card {
  animation: spectrum-emerge 600ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.image-card:nth-child(1) { animation-delay: 60ms; }
.image-card:nth-child(2) { animation-delay: 120ms; }
.image-card:nth-child(3) { animation-delay: 180ms; }
.image-card:nth-child(4) { animation-delay: 240ms; }
.image-card:nth-child(5) { animation-delay: 300ms; }
.image-card:nth-child(6) { animation-delay: 360ms; }
.image-card:nth-child(7) { animation-delay: 420ms; }
.image-card:nth-child(8) { animation-delay: 480ms; }

/* 按钮点击反馈 - 光学脉冲 */
button:active,
.download:active {
  transform: scale(0.96);
}

/* 复制成功状态 - 光谱发光 */
.copy-one[data-copied="true"],
#copy-all[data-copied="true"] {
  background: linear-gradient(135deg, var(--spectrum-cyan), var(--spectrum-blue));
  color: white;
  border-color: var(--spectrum-blue);
  box-shadow: 
    0 0 24px rgba(14, 165, 233, 0.5),
    0 4px 16px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 var(--crystal-shine);
}

@media (max-width: 560px) {
  .shell {
    padding: 12px clamp(12px, 3vw, 16px) 0;
  }

  /* 标题区域优化 */
  .title-row,
  .result-head {
    align-items: flex-start;
    gap: 8px;
  }
  
  .title-content {
    gap: 10px;
  }
  
  .logo {
    width: 28px;
    height: 28px;
  }

  h1 {
    font-size: clamp(20px, 6vw, 28px);
    line-height: 1.2;
  }

  h2 {
    font-size: 18px;
  }

  .badge {
    font-size: 10px;
    padding: 6px 10px;
  }
  
  .help-btn {
    font-size: 13px;
    padding: 7px 12px;
    gap: 4px;
  }
  
  .help-btn svg {
    width: 16px;
    height: 16px;
  }

  /* 表单区域优化 */
  .input-card {
    margin-top: 20px;
  }
  
  .usage-tips {
    margin-top: 18px;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
  }
  
  .tip-item {
    gap: 10px;
  }
  
  .tip-number {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  
  .tip-text {
    font-size: 13px;
  }

  textarea {
    min-height: 96px;
    font-size: 15px;
    padding: 12px;
  }

  label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  /* 按钮优化 */
  .actions,
  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  button,
  .download {
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
  }

  /* 结果区域优化 */
  .result-head {
    margin: 20px 0 12px;
  }

  /* 状态文字 */
  .status {
    font-size: 14px;
    margin: 12px 0 0;
  }

  /* 图片卡片优化 */
  .image-card {
    border-radius: 12px;
  }

  .preview-link {
    /* 手机端使用更紧凑的比例 */
    aspect-ratio: 3 / 4;
  }

  .meta,
  .card-actions {
    padding: 8px;
    gap: 8px;
  }

  .card-actions {
    padding-top: 0;
  }

  .size {
    font-size: 12px;
  }

  .raw-mark {
    font-size: 9px;
  }

  .card-actions button,
  .card-actions .download {
    min-height: 36px;
    font-size: 13px;
    padding: 0 10px;
  }

  /* 页脚优化 */
  .footer {
    padding: 28px clamp(12px, 3vw, 16px) 24px;
    margin-top: auto;
  }

  .footer-content {
    gap: 10px;
  }

  .footer-note {
    font-size: 12px;
    gap: 6px;
  }

  .footer-note svg {
    width: 14px;
    height: 14px;
  }

  .footer-links {
    font-size: 12px;
    gap: 10px;
  }
}
