/* WNNP Apple-style design tokens
 * 字体：苹方（PingFang SC） · 大圆角 · 液态玻璃 · 系统蓝主调
 */

:root {
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "SF Pro Text", "SF Pro Display", "Helvetica", "Arial", sans-serif;

  --bg: #f5f5f7;
  --bg-soft: #ebebef;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --border: rgba(60, 60, 67, 0.14);
  --border-strong: rgba(60, 60, 67, 0.22);

  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;

  --accent: #007aff;
  --accent-hover: #0a6cdd;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.12);
  --success: #34c759;
  --warning: #ff9500;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.12);

  --blur: saturate(180%) blur(20px);
  --transition: 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-soft: #1c1c1e;
    --surface: rgba(28, 28, 30, 0.72);
    --surface-strong: rgba(28, 28, 30, 0.92);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.5), 0 16px 48px rgba(0, 0, 0, 0.65);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 20% 0%, rgba(0, 122, 255, 0.10), transparent 70%),
    radial-gradient(50% 35% at 100% 30%, rgba(255, 45, 85, 0.06), transparent 70%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.78; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: 32px; letter-spacing: -0.02em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

/* === Glass surfaces === */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 20px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  font: 500 14px/1 var(--font-stack);
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.btn.primary:hover { background: var(--accent-hover); }

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn.danger:hover { background: var(--danger); color: #fff; }

.btn.ghost { background: transparent; }

.btn-icon {
  width: 38px;
  padding: 0;
  border-radius: 999px;
}

/* === Inputs === */
.input, .textarea, .select {
  width: 100%;
  font: 400 14px/1.4 var(--font-stack);
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 96px; resize: vertical; }

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

/* === Tags / chips === */
.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.success { background: rgba(52, 199, 89, 0.12); color: var(--success); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.warning { background: rgba(255, 149, 0, 0.14); color: var(--warning); }

/* === Layout === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Top bar === */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.appbar .brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.appbar .brand svg { width: 22px; height: 22px; }

/* === Toast === */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 20px;
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-2);
  transition: all var(--transition);
  z-index: 999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* === Modal === */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity var(--transition);
}
.modal-bg.show { display: flex; opacity: 1; }
.modal {
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface-strong);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  padding: 28px;
}
.modal h2 { margin: 0 0 16px; }

/* === Progress bar === */
.progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress > .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  border-radius: 999px;
  transition: width 200ms ease;
}

/* === Utilities === */
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--text-secondary); }
.tiny { font-size: 12px; color: var(--text-tertiary); }
.spacer { flex: 1; }
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  padding: 32px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* === Video grid === */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.video-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.video-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1c1c1e, #3a3a3c);
  overflow: hidden;
}
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .thumb .duration {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}
.video-card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.video-card .title-line {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card .meta { font-size: 13px; color: var(--text-secondary); }

/* === Table === */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th { font-weight: 500; color: var(--text-secondary); font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg-soft); }
