/* ========== 应用容器 ========== */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ========== 顶部标题 ========== */
.app-header {
  position: relative;
  text-align: center;
  margin-bottom: 32px;
}

.app-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.app-subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ========== 返回按钮 ========== */
.back-btn {
  position: absolute;
  left: 0;
  top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-btn::before {
  content: "←";
  transition: transform 0.2s ease;
}

.back-btn:hover {
  color: var(--primary);
  gap: 10px;
}

.back-btn:hover::before {
  transform: translateX(-3px);
}

/* ========== 面板通用 ========== */
.panel {
  display: none;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}

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

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

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

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: #eef2ff;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

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

.upload-hint {
  font-size: 12px !important;
  color: var(--secondary) !important;
  margin-top: 6px;
}


/* ========== Toast 消息通知 ========== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  transform: translateX(-50%) translateY(calc(-100% - 32px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: rgba(4, 120, 87, 0.92);
}

.toast.error {
  background: rgba(220, 38, 38, 0.92);
}

/* ========== 文件信息 ========== */
.file-info {
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
}

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

.file-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 按钮 ========== */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
}

/* ========== 转换状态 ========== */
.status-area {
  margin-top: 24px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.status-bar-wrapper {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.status-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  transition: width 0.4s ease;
}

.status-bar.indeterminate {
  width: 40%;
  animation: barSlide 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.status-bar.success {
  width: 100%;
  background: var(--success);
}

.status-bar.error {
  width: 100%;
  background: var(--danger);
}

@keyframes barSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.status-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== 结果区域 ========== */
.result-area {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.result-card {
  text-align: center;
  padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f0fdf4;
}

.result-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.result-card p {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .app-container {
    padding: 16px 12px 40px;
  }

  .back-btn {
    position: static;
    margin-bottom: 8px;
  }

  .panel {
    padding: 20px 16px;
  }

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

  .btn-large {
    padding: 12px 24px;
    font-size: 14px;
  }
}
