:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #0b1220;
  --muted: #5a6475;
  --card: #ffffff;
  --border: #e6e8ee;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  --brand: #2f6fed;
  --brand-pressed: #2458c0;
  --danger: #b42318;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans", sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
  color: var(--text);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

.header {
  padding: 10px 4px 14px;
}

.headerTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.langBtn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.langBtn:active {
  background: #f4f6fb;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

input[type="file"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: #fff;
  font-size: 16px;
  outline: none;
}

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

.fileInputRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.btnSecondary {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 800;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btnSecondary:active {
  background: #f4f6fb;
}

.fileName {
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

input[type="number"]:focus,
select:focus,
input[type="file"]:focus {
  border-color: rgba(47, 111, 237, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.modeValue {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: #f8faff;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.btn:active {
  background: var(--brand-pressed);
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.meta {
  display: grid;
  gap: 8px;
}

.status {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.status.error {
  color: var(--danger);
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.download:active {
  background: #f4f6fb;
}

.hidden {
  display: none !important;
}

.previewHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.previewTitle {
  font-weight: 800;
}

.previewInfo {
  color: var(--muted);
  font-size: 13px;
}

.previewImg {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.footer {
  margin-top: 18px;
  padding: 2px 4px;
}

.footerText {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
