:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
  color: #f4f4f6;
  background: #101012;
  --surface: #26262b;
  --line: #53535d;
  --muted: #b4b4bf;
  --focus: #acbfef;
  --action: #f3f3f6;
  --action-text: #16161a;
  accent-color: var(--focus);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: flow-root;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 24% 0%, #282833 0%, transparent 58%), #101012;
}
main { width: min(100% - 64px, 1392px); margin: 36px auto 44px; }
h1 { margin: 0 0 34px; font-size: clamp(1.9rem, 2.9vw, 2.65rem); letter-spacing: -.035em; line-height: 1.18; }

form {
  display: grid;
  grid-template-columns: minmax(0, 2.04fr) minmax(270px, 1fr);
  align-items: center;
  gap: clamp(35px, 5vw, 74px);
  min-height: clamp(452px, 42vw, 604px);
  padding: clamp(26px, 4.1vw, 61px);
  border: 1px solid #ffffff18;
  border-radius: 26px;
  background: linear-gradient(145deg, #28282f, #1b1b20 56%, #202025);
  box-shadow: 0 22px 50px -26px #000b, inset 0 1px 0 #ffffff0c;
}

.preview { min-width: 0; }

.tv-frame {
  position: relative;
  width: 100%;
  padding: clamp(2px, .24vw, 4px) clamp(2px, .24vw, 4px) clamp(5px, .74vw, 12px);
  border: 1px solid #333339;
  border-top-color: #66666e;
  border-radius: 6px;
  background: linear-gradient(176deg, #55555b -10%, #232326 12%, #111114 90%, #242428);
  box-shadow: 15px 17px 28px -10px #000b, inset 0 1px 0 #fff3;
}

.tv-frame::after {
  content: "";
  position: absolute;
  right: 3%;
  bottom: clamp(2px, .21vw, 4px);
  width: 3px;
  height: 2px;
  border-radius: 50%;
  background: #e3e3ea;
  box-shadow: 0 0 3px #ffffff60;
}

.tv-display {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: #000;
}

#empty-preview, .tv-display img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tv-display img { display: block; object-fit: contain; }

#empty-preview {
  display: grid;
  place-items: center;
  margin: 0;
  color: #c6c6cf;
  background: radial-gradient(ellipse at 20% 0%, #292932 0%, #15151c 52%, #0b0b10 85%);
  font-size: clamp(.78rem, 1.17vw, 1.08rem);
}

.publish-controls { display: grid; gap: 24px; min-width: 0; }
.field { min-width: 0; }
label { display: block; margin-bottom: 10px; font-size: clamp(.99rem, 1.3vw, 1.18rem); font-weight: 650; }
input, button { width: 100%; min-width: 0; min-height: 48px; border-radius: 10px; font: inherit; }
input { border: 1px solid var(--line); padding: 9px 13px; color: inherit; background: var(--surface); }
input::placeholder { color: var(--muted); }
input[type="file"] { font-size: .92rem; padding: 0 11px 0 0; }
input::file-selector-button {
  min-height: 46px;
  margin-inline-end: 11px;
  padding: 0 16px;
  border: 0;
  border-inline-end: 1px solid var(--line);
  background: #404048;
  color: #f4f4f6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
input::file-selector-button:hover { background: #4b4b55; }

button {
  min-height: 53px;
  margin-top: 5px;
  padding: 10px;
  border: 0;
  color: var(--action-text);
  background: var(--action);
  font-weight: 680;
  cursor: pointer;
}

button:hover:enabled { background: #fff; }
button:disabled { color: #acacb7; background: #3b3b44; cursor: default; }
.remember-option {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.remember-option input {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
}
.remembered-browser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .9rem;
}
#forget-browser {
  width: auto;
  min-height: 40px;
  margin: 0;
  color: var(--focus);
  background: transparent;
  font-weight: 600;
}
#forget-browser:hover:enabled { background: var(--surface); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.field p, #status { margin: 8px 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
#status { min-height: 1.5em; margin: -12px 0 0; }
#status[data-state="error"] { color: #ffb4b4; }
#status[data-state="ok"] { color: #dce6ff; font-weight: 650; }

@media (max-width: 740px) {
  main { width: min(100% - 28px, 560px); margin: 24px auto 28px; }
  h1 { margin-bottom: 22px; }
  form { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 26px; padding: 18px; border-radius: 21px; }
  .publish-controls { gap: 17px; }
  input[type="password"] { font-size: 16px; }
  #status { margin-top: -8px; }
}
