/* ============================================
   传输星 TransferStar - 马卡龙色系主题
   ============================================ */

:root {
  /* 马卡龙色板 */
  --pink: #FFB5C5;
  --pink-light: #FFF0F3;
  --pink-deep: #FF8FAB;
  --lavender: #C3B4F3;
  --lavender-light: #F3F0FF;
  --mint: #A8E6CF;
  --mint-light: #E8FFF5;
  --peach: #FFDAB9;
  --peach-light: #FFF5EB;
  --sky: #A8D8EA;
  --sky-light: #EBF7FC;
  --lemon: #FFF3B0;
  --lemon-light: #FFFDE6;

  /* 功能色 */
  --primary: #FF8FAB;
  --primary-hover: #FF6B8A;
  --primary-soft: #FFB5C5;
  --secondary: #C3B4F3;
  --secondary-hover: #A994E8;
  --success: #7DCBA4;
  --warning: #FFB347;
  --danger: #FF6B6B;

  /* 中性色 */
  --text-primary: #3D3D5C;
  --text-secondary: #7A7A9E;
  --text-muted: #ABABBF;
  --bg-base: #FFF9FB;
  --bg-card: #FFFFFF;
  --border: #F0E6F6;
  --shadow-color: rgba(195, 180, 243, 0.15);

  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(195, 180, 243, 0.1);
  --shadow-md: 0 4px 20px rgba(195, 180, 243, 0.15);
  --shadow-lg: 0 8px 40px rgba(195, 180, 243, 0.2);
  --shadow-float: 0 12px 48px rgba(255, 143, 171, 0.2);
}

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

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== 背景装饰 ===== */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--pink);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: var(--lavender);
  bottom: -100px;
  left: -80px;
  animation-delay: -7s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--mint);
  top: 50%;
  left: 60%;
  animation-delay: -14s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== 布局容器 ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 30px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 头部 ===== */
.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
  color: var(--primary);
  animation: starPulse 3s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.logo h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.logo-en {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 1px;
}

.tagline {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 4px;
}

/* ===== 主卡片 ===== */
.main-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  flex: 1;
  border: 1px solid var(--border);
}

/* ===== 标签导航 ===== */
.tab-nav {
  display: flex;
  position: relative;
  background: var(--lavender-light);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  color: var(--text-primary);
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-nav[data-active="receive"] .tab-indicator {
  transform: translateX(100%);
}

.tab-icon {
  font-size: 16px;
}

/* ===== 面板切换 ===== */
.tab-panel {
  display: none;
  animation: fadeSlideIn 0.4s ease;
}

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

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-panel {
  animation: fadeSlideIn 0.35s ease;
}

.step-panel.hidden {
  display: none;
}

/* ===== 上传区域 ===== */
.upload-zone {
  border: 2.5px dashed var(--pink);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--pink-light);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: #FFF0F5;
  transform: scale(1.01);
  box-shadow: var(--shadow-float);
}

.upload-zone.drag-over {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 143, 171, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255, 143, 171, 0); }
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 16px;
}

.upload-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-subtext {
  font-size: 14px;
  color: var(--text-secondary);
}

.upload-limit {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--lemon-light);
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: inherit;
}

.link-btn:hover {
  color: var(--primary-hover);
}

/* ===== 文件信息卡片 ===== */
.file-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--sky-light);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid rgba(168, 216, 234, 0.3);
}

.file-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.file-details {
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== 进度条 ===== */
.progress-section {
  margin-bottom: 20px;
}

.progress-bar-track {
  height: 14px;
  background: var(--lavender-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--lavender), var(--sky));
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  animation: gradientShift 2s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
}

.progress-percent {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.progress-detail {
  color: var(--text-secondary);
}

.progress-speed {
  color: var(--text-muted);
  font-style: italic;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--pink-deep));
  color: white;
  box-shadow: 0 4px 16px rgba(255, 143, 171, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(255, 143, 171, 0.5);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--lavender-light);
  color: var(--text-primary);
  border: 1.5px solid var(--lavender);
}

.btn-secondary:hover {
  background: var(--lavender);
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-cancel {
  margin-top: 12px;
  font-size: 13px;
  padding: 10px 20px;
}

.btn-copy {
  background: var(--mint-light);
  color: var(--text-primary);
  border: 1.5px solid var(--mint);
  font-size: 13px;
  padding: 8px 18px;
  margin-top: 10px;
}

.btn-copy:hover {
  background: var(--mint);
  color: white;
}

.btn-copy.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* ===== 设置表单 ===== */
.step-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.optional-tag {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

.expiry-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.chip:hover {
  border-color: var(--primary-soft);
  color: var(--primary);
}

.chip.active {
  background: var(--pink-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.input-field {
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: all 0.25s ease;
  background: var(--bg-base);
  color: var(--text-primary);
}

.input-field:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 4px rgba(195, 180, 243, 0.15);
  background: white;
}

.input-field::placeholder {
  color: var(--text-muted);
}

/* ===== 结果展示 ===== */
.result-success {
  text-align: center;
  margin-bottom: 24px;
}

.success-icon {
  font-size: 48px;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-success h3 {
  margin-top: 10px;
  font-size: 20px;
  color: var(--text-primary);
}

.result-card {
  background: var(--lemon-light);
  border: 1.5px solid var(--lemon);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.result-item {
  text-align: center;
}

.result-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.pickup-code-display {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text-primary);
  font-family: 'Consolas', 'Courier New', monospace;
  background: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.share-link-box {
  font-size: 13px;
  color: var(--text-secondary);
  background: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  box-shadow: var(--shadow-sm);
}

.result-divider {
  height: 1px;
  background: var(--lemon);
  margin: 20px 0;
}

.result-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ===== 取件码输入 ===== */
.code-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 12px;
}

.code-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Consolas', 'Courier New', monospace;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
  background: var(--bg-base);
  color: var(--text-primary);
  text-transform: uppercase;
}

.code-box:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(195, 180, 243, 0.2);
  background: white;
  transform: translateY(-2px);
}

.code-box.filled {
  border-color: var(--mint);
  background: var(--mint-light);
}

.code-dash {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 2px;
}

.code-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ===== 密码区域 ===== */
.password-section {
  margin: 16px 0;
  padding: 16px;
  background: var(--peach-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--peach);
}

.password-section .form-label {
  margin-bottom: 10px;
  display: block;
}

.password-section.hidden {
  display: none;
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 61, 92, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border);
}

/* ===== 规则内容 ===== */
.rules-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 18px 0 8px;
}

.rules-content h4:first-child {
  margin-top: 0;
}

.rules-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
}

.rules-content ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.rules-content li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  line-height: 1.6;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.35s ease;
  pointer-events: auto;
}

.toast-success {
  background: var(--mint);
  color: #1a5c3a;
}

.toast-error {
  background: var(--danger);
  color: white;
}

.toast-info {
  background: var(--sky);
  color: #1a4a5c;
}

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

.toast-exit {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-16px); }
}

/* ===== 页脚 ===== */
.app-footer {
  text-align: center;
  padding: 28px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .app-container {
    padding: 24px 14px 20px;
  }

  .main-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .logo h1 {
    font-size: 26px;
  }

  .upload-zone {
    padding: 36px 16px;
  }

  .code-box {
    width: 38px;
    height: 48px;
    font-size: 18px;
  }

  .code-input-group {
    gap: 5px;
  }

  .pickup-code-display {
    font-size: 24px;
    letter-spacing: 2px;
  }

  .expiry-options {
    gap: 8px;
  }

  .chip {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ===== 滚动条美化 ===== */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--pink);
  border-radius: 3px;
}

/* ===== 加载动画 ===== */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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