/* 全局样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #4d7cff;
  --secondary-color: #6c5ce7;
  --accent-color: #00cec9;
  --success-color: #00b894;
  --error-color: #ff7675;
  --warning-color: #fdcb6e;
  --text-color: #2d3436;
  --text-light: #636e72;
  --bg-color: #ecf0f1;
  --card-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --blur-effect: 10px;
}

body {
  font-family: 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景装饰 */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
}

.bg-circle-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, rgba(81, 162, 255, 0.8), rgba(102, 126, 234, 0.4));
  top: -200px;
  right: -100px;
}

.bg-circle-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(253, 187, 45, 0.4), rgba(255, 123, 123, 0.2));
  bottom: -100px;
  left: -150px;
}

.bg-circle-3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.5), rgba(118, 75, 162, 0.3));
  top: 40%;
  right: 20%;
}

.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.glass-container {
  backdrop-filter: blur(5px);
  border-radius: 16px;
  padding: 30px;
}

/* 头部样式 */
header {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

/* 玻璃拟态Header */
.glass-header {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 25px 20px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2);
}

header h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 16px;
  color: #7f8c8d;
}

/* 玻璃卡片样式 */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--blur-effect));
  -webkit-backdrop-filter: blur(var(--blur-effect));
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 0;
  margin-bottom: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px 0 rgba(31, 38, 135, 0.4);
}

.card-content {
  padding: 25px;
}

/* 广告区域样式 */
.ad-section {
  transition: all 0.3s ease;
  margin-top: 0;
  /* 调整顶部间距，现在放在header下 */
  margin-bottom: 20px;
  /* 与下面的卡片保持合适间距 */
}

.ad-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.ad-item {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.ad-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(77, 124, 255, 0.4), rgba(108, 92, 231, 0.4));
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.ad-link:hover {
  background: linear-gradient(135deg, rgba(77, 124, 255, 0.6), rgba(108, 92, 231, 0.6));
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(77, 124, 255, 0.3);
}

/* 二维码部分 */
.qrcode-wrapper {
  position: relative;
}

.qrcode-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.4), rgba(0, 184, 148, 0.4));
  color: white;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.qrcode-btn:hover {
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.6), rgba(0, 184, 148, 0.6));
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 206, 201, 0.3);
}

.ad-icon {
  font-size: 20px;
  margin-right: 10px;
}

.ad-text {
  font-size: 15px;
}

/* 简化的二维码弹窗样式 */
.qrcode-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  width: 100%;
  height: 100%;
}

/* 显示弹窗 */
.qrcode-popup.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.qrcode-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  position: relative;
  width: 280px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  z-index: 10000;
  /* 确保内容在最上层 */
}

.qrcode-img {
  width: 220px;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  max-width: 100%;
}

.qrcode-content p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #666;
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 24px;
  cursor: pointer;
  color: #777;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #ff5252;
}

/* 输入组样式 */
.input-group {
  margin-bottom: 25px;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text-color);
  font-size: 16px;
  letter-spacing: 0.3px;
}

.glass-input {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-color);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.input-group textarea.glass-input {
  height: 110px;
  resize: vertical;
}

.glass-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(77, 124, 255, 0.2);
}

/* 按钮样式 */
.button-group {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

button.glass-btn {
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

button.glass-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  transition: transform 0.6s;
  z-index: 1;
}

button.glass-btn:hover::before {
  transform: translateX(100%);
}

button.glass-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.1);
}

button.glass-btn:active {
  transform: translateY(0);
}

button.glass-btn span {
  position: relative;
  z-index: 2;
}

.primary-btn.glass-btn {
  background: linear-gradient(135deg, rgba(77, 124, 255, 0.6), rgba(108, 92, 231, 0.6));
  color: white;
  box-shadow: 0 4px 15px rgba(77, 124, 255, 0.3);
}

.primary-btn.glass-btn:hover {
  background: linear-gradient(135deg, rgba(77, 124, 255, 0.7), rgba(108, 92, 231, 0.7));
  box-shadow: 0 6px 20px rgba(77, 124, 255, 0.4);
}

.secondary-btn.glass-btn {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-color);
}

.secondary-btn.glass-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* 加载样式 */
.loading.glass-panel {
  text-align: center;
  padding: 25px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2);
  margin-top: 20px;
}

.spinner {
  width: 45px;
  height: 45px;
  margin: 0 auto 20px;
  border: 4px solid rgba(77, 124, 255, 0.1);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.queue-info {
  font-size: 15px;
  color: var(--text-light);
  margin-top: 12px;
}

.queue-info.highlight {
  color: var(--error-color);
  font-weight: 500;
  animation: pulse 1.5s infinite;
}

.wait-time-info {
  font-size: 14px;
  color: var(--warning-color);
  margin-top: 15px;
  padding: 10px;
  background: rgba(253, 203, 110, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--warning-color);
}

/* 倒计时样式 */
.countdown-timer {
  font-size: 15px;
  color: var(--primary-color);
  margin-top: 15px;
  padding: 10px 15px;
  background: rgba(77, 124, 255, 0.15);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
  font-weight: 600;
  text-align: center;
  animation: pulse 1.5s infinite;
  box-shadow: 0 2px 8px rgba(77, 124, 255, 0.2);
  position: relative;
  z-index: 10;
  display: block !important;
  /* 强制显示 */
}

.countdown-timer.active {
  animation: highlight 0.3s ease-in-out;
}

@keyframes highlight {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
    background: rgba(77, 124, 255, 0.3);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(77, 124, 255, 0.5);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(77, 124, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(77, 124, 255, 0);
  }
}

/* 重试消息样式 */
.retry-message {
  font-size: 14px;
  color: var(--error-color);
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 118, 117, 0.15);
  border-radius: 8px;
  border-left: 3px solid var(--error-color);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.7;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 结果面板样式 */
.glass-panel {
  margin-top: 25px;
  backdrop-filter: blur(var(--blur-effect));
  -webkit-backdrop-filter: blur(var(--blur-effect));
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel-content {
  padding: 20px 25px;
}

.success-glass {
  background: linear-gradient(135deg, rgba(0, 184, 148, 0.2), rgba(0, 206, 201, 0.15));
  border-top: 1px solid rgba(0, 206, 201, 0.3);
  box-shadow: 0 8px 32px rgba(0, 184, 148, 0.2);
}

.error-glass {
  background: linear-gradient(135deg, rgba(255, 118, 117, 0.2), rgba(255, 177, 153, 0.15));
  border-top: 1px solid rgba(255, 118, 117, 0.3);
  box-shadow: 0 8px 32px rgba(255, 118, 117, 0.2);
}

.glass-panel h3 {
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#resultContent {
  font-size: 15px;
}

#resultContent .file-size {
  font-size: 32px;
  color: var(--success-color);
  font-weight: 700;
  margin: 15px 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

#resultContent .details {
  color: var(--text-light);
  font-size: 15px;
}

#errorContent {
  color: var(--error-color);
  font-size: 15px;
  line-height: 1.6;
}

/* 说明部分样式 */
.instruction ol {
  padding-left: 25px;
  margin-bottom: 20px;
}

.instruction li {
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text-color);
}

.instruction strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* 注意样式 */
.glass-note {
  background: linear-gradient(135deg, rgba(253, 203, 110, 0.2), rgba(255, 177, 153, 0.15));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(253, 203, 110, 0.3);
  padding: 15px 20px;
  margin: 25px 0;
  box-shadow: 0 4px 15px rgba(253, 203, 110, 0.15);
}

.glass-note p {
  margin: 0;
  font-size: 15px;
  color: var(--text-color);
}

.glass-note strong {
  color: var(--warning-color);
  font-weight: 600;
}

/* 示例样式 */
.examples {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.examples h4 {
  font-size: 17px;
  color: var(--text-color);
  margin-bottom: 15px;
  font-weight: 600;
}

.examples ul {
  padding-left: 25px;
}

.examples li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

.examples li::marker {
  color: var(--primary-color);
}

/* 页脚样式 */
.glass-footer {
  text-align: center;
  margin-top: 40px;
  padding: 15px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.5px;
}

/* 响应式设计 */
@media (max-width: 600px) {
  .container {
    padding: 15px;
    margin: 20px auto;
  }

  .glass-container {
    padding: 20px 15px;
  }

  .glass-header {
    padding: 15px;
  }

  .card-content {
    padding: 20px;
  }

  header h1 {
    font-size: 24px;
  }

  .button-group {
    flex-direction: column;
  }

  button.glass-btn {
    width: 100%;
  }

  .glass-panel h3 {
    font-size: 16px;
  }

  #resultContent .file-size {
    font-size: 28px;
  }

  .bg-circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
  }

  .bg-circle-2 {
    width: 250px;
    height: 250px;
    bottom: -50px;
    left: -100px;
  }

  .bg-circle-3 {
    width: 200px;
    height: 200px;
  }

  .glass-footer {
    padding: 12px;
    font-size: 13px;
    margin-top: 30px;
  }

  .ad-container {
    flex-direction: column;
  }

  .ad-item {
    min-width: auto;
  }

  /* 移动端二维码样式调整 */
  .qrcode-popup {
    position: fixed;
    top: 50% !important;
    /* 覆盖JS设置的inline样式 */
    left: 50% !important;
    /* 覆盖JS设置的inline样式 */
    transform: translate(-50%, -50%);
    margin-bottom: 0;
    z-index: 10000;
  }

  .qrcode-popup:after {
    display: none;
    /* 在移动端不显示指示箭头 */
  }

  .qrcode-content {
    width: 260px;
    max-width: 90%;
    padding: 15px;
  }

  .qrcode-img {
    width: 100%;
    height: auto;
    max-width: 220px;
  }
}