* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #111928 !important;
  min-height: 100vh;
  color: #E0E0E0;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

/* Rubik Bubbles字体样式 */
.rubik-bubbles-regular {
  font-family: "Rubik Bubbles", system-ui;
  font-weight: 400;
  font-style: normal;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #111928;
  overflow-x: hidden;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

/* 初始加载动画 */
.initial-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111928;
}

.initial-loading.completing {
  transition: opacity 1s ease-out;
  opacity: 0;
  pointer-events: none;
}

.loading-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 252, 0, 0.1) 0%, rgba(17, 25, 40, 1) 70%);
}

.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  transition: all 1s ease-out;
}

.loading-logo.move-to-top {
  transform: translateY(-50vh) scale(0.6);
}

.loading-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #FFFC00;
  box-shadow: 0 0 0 4px rgba(255, 252, 0, 0.2);
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-text {
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loading-logo.move-to-top .loading-text {
  opacity: 0;
}

.loading-title {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 900;
  color: #FFFC00;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.loading-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0CAFFB;
  animation: loadingDots 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(255, 252, 0, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(255, 252, 0, 0.4);
  }
}

@keyframes loadingDots {
  0%, 20%, 80%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 0;
}

.logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px auto;
  display: block;
  border: 4px solid #FFFC00;
  box-shadow: 0 0 0 4px rgba(255, 252, 0, 0.2);
}

.title {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 900;
  color: #FFFC00;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: #B8B8B8;
  font-weight: 500;
  margin-bottom: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Upload Section */
.upload-section {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dual-upload-container {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin-bottom: 24px;
}

.upload-area {
  flex: 1;
  max-width: 400px;
}

.vs-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.vs-text {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 900;
  color: #0CAFFB;
  text-shadow: 0 0 20px rgba(12, 175, 251, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 20px rgba(12, 175, 251, 0.5);
  }
  to {
    text-shadow: 0 0 30px rgba(12, 175, 251, 0.8);
  }
}

.dropzone {
  border: 3px solid #0CAFFB;
  border-radius: 16px;
  padding: clamp(30px, 5vw, 50px);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #242426;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover,
.dropzone.active {
  border-color: #FFFC00;
  background: #2a2a2c;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 252, 0, 0.2);
}

.dropzone.has-image {
  border-color: #00FF88;
  background: #1e2a24;
}

.upload-prompt {
  color: #ffffff;
}

.upload-icon {
  font-size: clamp(3rem, 6vw, 4rem);
  margin-bottom: 16px;
  color: #0CAFFB;
}

.upload-prompt p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 12px;
  font-weight: 600;
  color: #ffffff;
}

.upload-hint {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: #999999;
  font-weight: 400 !important;
}

.image-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preview-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 16px;
  border: 3px solid #00FF88;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.preview-image:hover {
  transform: scale(1.02);
}

.image-name {
  color: #B8B8B8;
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
  background: #2a2a2c;
  padding: 8px 16px;
  border-radius: 8px;
  max-width: 200px;
  text-align: center;
  border: 1px solid #3a3a3c;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.analyze-btn {
  background: #FFFC00;
  color: #111928;
  border: none;
  padding: clamp(16px, 3.5vw, 20px) clamp(32px, 7vw, 40px);
  border-radius: 50px;
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 16px rgba(255, 252, 0, 0.2);
}

.analyze-btn:hover:not(:disabled) {
  background: #E6E300;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 227, 0, 0.4);
}

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

.reset-btn,
.retry-btn,
.new-test-btn {
  background: #3a3a3c;
  color: #E0E0E0;
  border: none;
  padding: clamp(16px, 3.5vw, 20px) clamp(32px, 7vw, 40px);
  border-radius: 50px;
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 16px rgba(58, 58, 60, 0.3);
}

.reset-btn {
  background: #444448;
  color: #B8B8B8;
  border: 2px solid #555;
}

.new-test-btn {
  background: #0CAFFB;
  color: #111928;
  border: none;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(12, 175, 251, 0.2);
}

.reset-btn:hover,
.retry-btn:hover,
.new-test-btn:hover {
  background: #0CAFFB;
  color: #161618;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 175, 251, 0.3);
}

/* Loading Container */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 40px;
  background: #242426;
  border-radius: 20px;
  border: 2px solid #3a3a3c;
  max-width: 500px;
}

.analysis-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #0CAFFB;
  margin-bottom: 24px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.analysis-text {
  text-align: center;
}

.analysis-text h3 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: #0CAFFB;
  margin-bottom: 20px;
  font-weight: 700;
}

.progress-bar {
  width: 200px;
  height: 6px;
  background: #3a3a3c;
  border-radius: 3px;
  overflow: hidden;
  margin: 20px auto;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0CAFFB, #FFFC00);
  border-radius: 3px;
  animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 80%; }
  100% { width: 100%; }
}

.analysis-text p {
  color: #B8B8B8;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
}

/* Error Message */
.error-message {
  background: #2a1d1d;
  border: 2px solid #FF4757;
  border-radius: 16px;
  padding: clamp(28px, 6vw, 40px);
  text-align: center;
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.error-message p {
  color: #FF4757;
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  margin-bottom: 20px;
  font-weight: 600;
}

/* Result Section */
.result-section {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideInUp 0.4s ease-out;
  background: #242426;
  border-radius: 20px;
  padding: clamp(32px, 6vw, 60px);
  border: 2px solid #3a3a3c;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.result-title {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  font-weight: 800;
  color: #FFFC00;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.result-images-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 28px 0 40px 0;
  padding: 28px;
  background: #1e1e20;
  border-radius: 16px;
  border: 2px solid #00FF88;
}

.result-image-item {
  flex: 1;
  text-align: center;
  position: relative;
}

.crown {
  position: absolute;
  font-size: 2.5rem;
  transform: rotate(35deg);
  z-index: 10;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  animation: crownGlow 2s ease-in-out infinite alternate;
  pointer-events: none; /* 防止皇冠阻挡鼠标事件 */
}

@keyframes crownGlow {
  0% {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  }
  100% {
    text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.6);
  }
}

.result-image {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  border-radius: 16px;
  border: 2px solid #00FF88;
  transition: transform 0.2s ease;
  object-fit: cover;
}

.result-image:hover {
  transform: scale(1.02);
}

.image-label {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}

.vs-result {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: #0CAFFB;
  text-shadow: 0 0 20px rgba(12, 175, 251, 0.5);
}

.result-content {
  margin-bottom: 32px;
}

/* Analysis Result Content */
#analysisResult {
  text-align: left;
  line-height: 1.7;
  color: #ffffff;
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  width: 100%;
  margin-bottom: 32px;
  padding: 0;
}

/* Markdown Content (for backward compatibility) */
.markdown-content {
  text-align: left;
  line-height: 1.7;
  color: #ffffff;
  background: #1e1e20;
  border-radius: 16px;
  padding: clamp(24px, 5vw, 36px);
  border-left: 4px solid #B4A7FF;
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  border: 2px solid #3a3a3c;
}

#analysisResult h1,
#analysisResult h2,
#analysisResult h3,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #ffffff;
  margin: 28px 0 16px 0;
  font-weight: 800;
}

#analysisResult h1,
.markdown-content h1 {
  font-size: clamp(1.8em, 4.5vw, 2em);
  color: #FFFC00;
  border-bottom: 3px solid #FFFC00;
  padding-bottom: 12px;
  text-transform: uppercase;
}

#analysisResult h2,
.markdown-content h2 {
  font-size: clamp(1.5em, 4vw, 1.7em);
  color: #0CAFFB;
  text-transform: uppercase;
}

#analysisResult h3,
.markdown-content h3 {
  font-size: clamp(1.3em, 3.5vw, 1.5em);
  color: #00FF88;
  text-transform: uppercase;
}

#analysisResult p,
.markdown-content p {
  margin: 16px 0;
  color: #E0E0E0;
}

#analysisResult ul,
#analysisResult ol,
.markdown-content ul,
.markdown-content ol {
  margin: 16px 0;
  padding-left: 28px;
}

#analysisResult li,
.markdown-content li {
  margin: 12px 0;
  color: #E0E0E0;
}

#analysisResult strong,
.markdown-content strong {
  color: #FFFC00;
  font-weight: 800;
}

#analysisResult em,
.markdown-content em {
  color: #B4A7FF;
  font-style: italic;
}

/* 新的结构化结果显示样式 */
.result-content-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.winner-section,
.loser-section,
.summary-section {
  background: transparent;
  border-radius: 24px;
  padding: 24px;
  border: 2px solid;
  transition: all 0.3s ease;
}

.winner-section {
  border-color: #00FF88;
}

.winner-section:hover {
  border-color: #00FF88;
  box-shadow: 0 0 0 1px #00FF88;
}

.loser-section {
  border-color: #FF4757;
}

.loser-section:hover {
  border-color: #FF4757;
  box-shadow: 0 0 0 1px #FF4757;
}

.summary-section {
  border-color: #0CAFFB;
}

.summary-section:hover {
  border-color: #0CAFFB;
  box-shadow: 0 0 0 1px #0CAFFB;
}

.section-title {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-weight: 700;
  margin: 0 0 16px 0;
  text-transform: uppercase;
}

.praise-title {
  color: #00FF88;
}

.criticism-title {
  color: #FF4757;
}

.summary-title {
  color: #0CAFFB;
}

.praise-content,
.criticism-content,
.summary-content {
  color: #E0E0E0;
  line-height: 1.6;
  font-size: clamp(1rem, 2.3vw, 1.1rem);
}

.praise-content strong {
  color: #00FF88;
}

.criticism-content strong {
  color: #FF4757;
}

.summary-content strong {
  color: #0CAFFB;
}

/* Share Section */
.share-section {
  margin-bottom: 32px;
  padding-top: 28px;
  border-top: 2px solid #3a3a3c;
}

.share-section h3 {
  font-size: clamp(1.3rem, 3.2vw, 1.6rem);
  color: #B4A7FF;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.share-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.share-url-box {
  display: flex;
  background: #3a3a3c;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #555;
  max-width: 400px;
  width: 100%;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #E0E0E0;
  font-size: 14px;
  outline: none;
}

.copy-btn {
  background: #0CAFFB;
  color: #111928;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s ease;
}

.copy-btn:hover {
  background: #09a3d1;
}

.toast {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: #00FF88;
  color: #111928;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.3);
  animation: toastShow 0.3s ease-out;
}

@keyframes toastShow {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  color: #666666;
  margin-top: auto;
  border-top: 2px solid #2a2a2c;
}

.footer p {
  margin-bottom: 8px;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
}

.disclaimer {
  font-size: clamp(0.85rem, 2vw, 0.95rem) !important;
  opacity: 0.7;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .dual-upload-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .vs-separator {
    min-width: auto;
    min-height: 60px;
  }
  
  .result-images-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  
  .analyze-btn,
  .reset-btn,
  .retry-btn,
  .new-test-btn {
    width: 100%;
    max-width: 280px;
    min-width: auto;
  }
}
