:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #18202f;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #166b5c;
  --accent-strong: #0f5146;
  --warning: #b35c1e;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(22, 107, 92, 0.10), transparent 38%),
    linear-gradient(300deg, rgba(179, 92, 30, 0.08), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

body.player-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  place-items: center;
  overflow: hidden;
  background: #020617;
}

a {
  color: var(--accent);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 16px;
}

.upload-panel {
  width: min(760px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-heading {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.upload-form {
  display: grid;
  gap: 18px;
}

.file-picker {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 24px;
  border: 1px dashed #9aa8b8;
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: var(--accent);
  background: #f3faf8;
}

.file-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.file-title {
  font-size: 18px;
  font-weight: 700;
}

.file-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.progress-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 140ms ease;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.result-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.result-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

#play-url {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.message.error {
  color: #b42318;
}

.message.success {
  color: var(--accent-strong);
}

body.player-page .video-player {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  background: #020617;
  object-fit: contain;
}

@media (max-width: 640px) {
  .upload-panel {
    padding: 22px;
  }

  h1 {
    font-size: 25px;
  }

  .progress-wrap,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .result-panel {
    display: grid;
  }
}

