/* ==================== 基础重置 ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

html, body {
  height: 100%;
}

/* 修复 hidden 属性被 display 样式覆盖的问题 */
[hidden] {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font-family: inherit;
}

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

/* ==================== 背景动画 ==================== */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  top: -200px;
  left: -100px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -50px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ==================== 头部 ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(15, 15, 26, 0.7);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo svg {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-link-admin {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.nav-link-admin:hover {
  opacity: 0.9;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ==================== Hero ==================== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
}

.hide-mobile { display: inline; }

/* ==================== 上传区 ==================== */
.upload-section {
  padding: 20px 0 40px;
}

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.upload-area {
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px dashed transparent;
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragging {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.01);
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.highlight {
  color: var(--primary-light);
  font-weight: 600;
}

.upload-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.expire-select {
  padding: 8px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.expire-select:hover {
  border-color: var(--primary);
}

.expire-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-upload:active {
  transform: translateY(0);
}

.btn-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==================== 进度条 ==================== */
.progress-container {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  width: 0;
  transition: width 0.3s;
}

/* ==================== 结果预览 ==================== */
.results-section {
  padding: 40px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--success);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.result-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 16px 48px rgba(99, 102, 241, 0.2);
}

.result-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1a1a2e;
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-preview img,
.result-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.result-info {
  padding: 16px;
}

.result-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 48px;
  text-transform: uppercase;
}

.link-input-wrap {
  flex: 1;
  display: flex;
  gap: 4px;
}

.link-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

.link-input:focus {
  border-color: var(--primary);
}

.btn-copy {
  padding: 6px 10px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

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

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

.result-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== 统计和功能 ==================== */
.features-section {
  padding: 40px 0 80px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

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

/* ==================== 页脚 ==================== */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.footer a {
  color: var(--primary-light);
}

.footer a:hover {
  text-decoration: underline;
}

/* ==================== Toast ==================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(20px);
  animation: slideIn 0.3s ease;
  min-width: 200px;
}

.toast-success {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.toast-error {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.toast-info {
  background: rgba(99, 102, 241, 0.9);
  color: white;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== 全屏预览 Modal ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

.modal-content {
  max-width: 100%;
  max-height: 100%;
}

.modal-content img,
.modal-content video {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

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

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .nav-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .hide-mobile { display: none; }

  .hero {
    padding: 40px 0 24px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .upload-icon svg {
    width: 48px;
    height: 48px;
  }

  .upload-title {
    font-size: 1.1rem;
  }

  .upload-subtitle {
    font-size: 0.85rem;
    padding: 0 10px;
  }

  .upload-options {
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }

  .option-label {
    width: 100%;
    justify-content: space-between;
  }

  .expire-select {
    flex: 1;
  }

  .btn-upload {
    width: 100%;
    justify-content: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .toast-container {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
  }

  .toast {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header-inner {
    height: 56px;
  }

  .logo {
    font-size: 18px;
  }

  .logo svg {
    width: 26px;
    height: 26px;
  }

  .nav {
    gap: 4px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .feature-card {
    padding: 20px;
  }

  .upload-area {
    padding: 30px 16px;
  }

  .result-links {
    gap: 6px;
  }

  .link-label {
    min-width: 36px;
    font-size: 10px;
  }

  .link-input {
    font-size: 11px;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .upload-area {
    padding: 50px 20px;
  }

  .btn-upload {
    padding: 14px 24px;
    font-size: 16px;
  }

  .link-input {
    font-size: 14px;
  }

  .btn-copy {
    padding: 8px 14px;
    font-size: 14px;
  }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 20px 0;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .upload-area {
    padding: 24px;
  }

  .upload-icon svg {
    width: 36px;
    height: 36px;
  }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
