:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --success: #10b981;
  --success-light: #ecfdf5;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-button: 0 4px 12px rgba(37, 99, 235, 0.25);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

/* ========================================================
   自适应容器系统 (全端屏幕响应式适配)
   ======================================================== */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: auto;
  box-sizing: border-box;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 18px;
  width: 100%;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.3;
}

/* Card */
.card {
  width: 100%;
  max-width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  padding: 22px 18px;
  box-sizing: border-box;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  isolation: isolate;
  transition: all 0.3s ease;
}

/* ========================================================
   表单与输入框
   ======================================================== */
.form-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 18px;
  overflow: hidden;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.required {
  color: #ef4444;
  margin-left: 2px;
}

.label-tip {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: 3px;
  line-height: 1.4;
}

/* 基础输入控件 */
.form-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px; /* 移动端严禁低于16px，杜绝iOS聚焦自动放大页面 */
  color: var(--text-main);
  background-color: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  min-height: 48px;
  line-height: 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 专属移动端日期外层包裹与输入框重置：彻底根除 iOS Safari / Android 超过边界问题 */
.date-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.date-input-wrapper input[type="date"],
input[type="date"].form-input {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text-main);
  min-height: 48px;
  line-height: 22px;
  margin: 0;
  outline: none;
  overflow: hidden;
  text-align: left;
  transition: all 0.2s ease;
}

.date-input-wrapper input[type="date"]:focus,
input[type="date"].form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* iOS Safari 内部文本节点强制左对齐与宽度限制 */
input[type="date"]::-webkit-date-and-time-value {
  display: block !important;
  text-align: left !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 1.4em !important;
  line-height: 22px !important;
}

input[type="date"]::-webkit-datetime-edit {
  display: inline-flex !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

/* ========================================================
   上传与拖拽区域
   ======================================================== */
.dropzone {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--primary-border);
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.dropzone:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.dropzone-text .primary-text {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.dropzone-text .secondary-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 视频选择后卡片 */
.video-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.video-details {
  overflow: hidden;
  text-align: left;
}

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

.video-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-change-file {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
  transition: all 0.2s;
  min-height: 36px;
}

.btn-change-file:hover {
  background: #e2e8f0;
}

/* ========================================================
   进度条与状态展示
   ======================================================== */
.progress-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-status {
  font-weight: 600;
  color: var(--primary);
}

.progress-percent {
  font-weight: 700;
  color: var(--text-main);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.progress-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.progress-warning {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #b45309;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

/* ========================================================
   提交按钮
   ======================================================== */
.form-action {
  width: 100%;
}

.btn-submit {
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================================
   成功提示屏
   ======================================================== */
.success-screen {
  text-align: center;
  padding: 16px 0 8px;
}

.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
}

.result-summary {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  font-size: 13px;
  margin-bottom: 22px;
  width: 100%;
  box-sizing: border-box;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.result-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  max-width: 70%;
  word-break: break-all;
}

.btn-new-submit {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-new-submit:hover {
  background: #e2e8f0;
}

/* ========================================================
   各端精细化响应式适配规则 (Media Queries)
   ======================================================== */

/* 1. 超小屏手机 / 折叠屏外屏 (<= 360px) */
@media (max-width: 360px) {
  body {
    padding: 10px 8px;
  }
  .card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }
  .header-title {
    font-size: 19px;
  }
  .form-input,
  .date-input-wrapper input[type="date"] {
    padding: 10px 10px;
    font-size: 15px;
  }
  .dropzone {
    padding: 16px 10px;
  }
}

/* 2. 平板端 / 大屏折叠展开态 (600px ~ 1024px) */
@media (min-width: 600px) and (max-width: 1024px) {
  body {
    padding: 32px 24px;
  }
  .app-container {
    max-width: 560px;
  }
  .header-title {
    font-size: 24px;
    margin-bottom: 4px;
  }
  .card {
    padding: 32px 28px;
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.07);
  }
  .dropzone {
    padding: 28px 18px;
  }
}

/* 3. 电脑 PC 端 / 大屏显示器 (>= 1025px) */
@media (min-width: 1025px) {
  body {
    padding: 40px 24px;
  }
  .app-container {
    max-width: 580px;
  }
  .header-title {
    font-size: 26px;
    margin-bottom: 6px;
  }
  .card {
    padding: 36px 32px;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
  }
  .form-input,
  .date-input-wrapper input[type="date"] {
    font-size: 15px;
  }
  .dropzone {
    padding: 30px 20px;
  }
  .dropzone:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
  }
}

/* 4. 横屏模式优化 (高度受限如移动端横放) */
@media (max-height: 550px) and (orientation: landscape) {
  body {
    padding-top: 12px;
    padding-bottom: 16px;
    justify-content: flex-start;
  }
  .header {
    margin-bottom: 10px;
  }
  .header-title {
    font-size: 18px;
  }
  .card {
    padding: 16px 20px;
  }
  .form-group {
    margin-bottom: 12px;
  }
}
