:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #17201c;
  background: #f3f6f4;
  font-synthesis: none;
  --ink: #17201c;
  --muted: #637069;
  --line: #d8e0db;
  --paper: #ffffff;
  --green: #176f49;
  --green-dark: #10593a;
  --green-light: #e9f5ee;
  --amber: #b56716;
  --red: #b84138;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(#dce3df 1px, transparent 1px),
    linear-gradient(90deg, #dce3df 1px, transparent 1px),
    #f3f6f4;
  background-size: 48px 48px;
}

button, input { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 246, 244, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 19px;
  font-weight: 800;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
}

.brand-icon img { width: 20px; filter: invert(1); }

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.service-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a9b68;
  box-shadow: 0 0 0 4px #dcefe4;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(50px, 8vw, 94px) 0 70px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: end;
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.12;
  letter-spacing: 0;
}

.intro-copy {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(27, 48, 38, 0.08);
}

.upload-panel { min-width: 0; padding: clamp(22px, 4vw, 48px); }

.drop-zone {
  min-height: 284px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #afbbb4;
  border-radius: 6px;
  background: #fafcfb;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  border-color: var(--green);
  background: #f4faf6;
  box-shadow: inset 0 0 0 1px var(--green);
}

.upload-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--green-light);
}

.upload-symbol img { width: 27px; filter: invert(34%) sepia(19%) saturate(1543%) hue-rotate(103deg) brightness(91%); }
.drop-zone h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: 0; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 14px; }

.limit-label {
  margin-top: 23px;
  padding-top: 17px;
  border-top: 1px solid #e6ebe8;
  color: #89938e;
  font-size: 12px;
}

.selection {
  min-height: 104px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 38px;
  gap: 15px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafcfb;
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.terms-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.terms-row a {
  margin: 0 3px;
  color: var(--green);
  font-weight: 700;
}

.file-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green-light);
}

.file-icon img { width: 22px; filter: invert(34%) sepia(19%) saturate(1543%) hue-rotate(103deg) brightness(91%); }
.file-details { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-details span { color: var(--muted); font-size: 12px; }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.icon-button:hover { background: #edf1ef; }
.icon-button img { width: 18px; }

.upload-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.upload-button:hover:not(:disabled) { background: var(--green-dark); }
.upload-button:active:not(:disabled) { transform: translateY(1px); }
.upload-button:disabled { cursor: not-allowed; color: #98a39d; background: #e3e8e5; }
.upload-button img { width: 18px; filter: invert(1); }
.upload-button:disabled img { filter: invert(65%); }

.progress-wrap {
  min-height: 104px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafcfb;
}

.progress-copy { display: flex; justify-content: space-between; margin-bottom: 17px; font-size: 13px; }
.progress-copy span { color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; border-radius: 4px; background: #e4eae6; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width 120ms linear; }

.result {
  min-height: 284px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid #bcd9c8;
  border-radius: 6px;
  background: #f7fbf8;
}

.success-line { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.success-line > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #dff1e6; }
.success-line img { width: 20px; filter: invert(34%) sepia(19%) saturate(1543%) hue-rotate(103deg) brightness(91%); }
.success-line div { display: flex; flex-direction: column; gap: 4px; }
.success-line strong { font-size: 15px; }
.success-line small { color: var(--amber); font-size: 12px; font-weight: 700; }
.result label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }

.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.link-row input { min-width: 0; height: 46px; padding: 0 13px; border: 1px solid #c9d4ce; border-right: 0; border-radius: 5px 0 0 5px; color: #36443d; background: #fff; outline: none; font-size: 13px; }
.link-row input:focus { box-shadow: inset 0 0 0 1px var(--green); }
.copy-button { height: 46px; display: flex; align-items: center; gap: 7px; padding: 0 16px; border: 0; border-radius: 0 5px 5px 0; color: #fff; background: var(--ink); font-weight: 700; }
.copy-button:hover { background: #344139; }
.copy-button img { width: 16px; filter: invert(1); }

.result-actions { display: flex; gap: 20px; align-items: center; margin-top: 22px; font-size: 13px; font-weight: 700; }
.result-actions a { color: var(--green); }
.result-actions button { padding: 0; border: 0; color: var(--muted); background: none; text-decoration: underline; }

.error-message { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid var(--red); color: var(--red); background: #fdf0ef; font-size: 13px; }

.rules {
  padding: 34px 30px;
  color: #fff;
  background: #202a25;
}

.rule-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 22px; border-bottom: 1px solid #3d4742; }
.rule-heading span { font-size: 14px; font-weight: 800; }
.rule-heading small { color: #96a29b; font-size: 10px; }
.rule-item { display: grid; grid-template-columns: 34px 1fr; gap: 13px; align-items: center; padding: 22px 0; border-bottom: 1px solid #3d4742; }
.rule-item img { width: 21px; filter: invert(81%) sepia(13%) saturate(673%) hue-rotate(95deg); }
.rule-item div { display: flex; flex-direction: column; gap: 4px; }
.rule-item strong { font-size: 14px; }
.rule-item span { color: #aeb8b2; font-size: 11px; }
.rules > p { margin: 24px 0 0; color: #96a29b; font-size: 11px; line-height: 1.75; }

footer {
  width: min(1120px, calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  padding: 23px 0 32px;
  border-top: 1px solid var(--line);
  color: #7c8982;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

[hidden] { display: none !important; }

@media (max-width: 800px) {
  .intro { grid-template-columns: 1fr; gap: 22px; }
  .intro-copy { max-width: 560px; }
  .workspace { grid-template-columns: 1fr; }
  .rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 26px; }
  .rule-heading { grid-column: 1 / -1; }
  .rule-item { padding: 0; border: 0; }
  .rules > p { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 560px) {
  .topbar { height: 64px; padding: 0 18px; }
  .service-status { font-size: 0; }
  main { width: min(100% - 28px, 1120px); padding: 46px 0 50px; }
  h1 { font-size: 34px; }
  .intro { margin-bottom: 28px; }
  .upload-panel { padding: 14px; }
  .drop-zone { min-height: 260px; padding: 24px; }
  .rules { grid-template-columns: 1fr; gap: 0; }
  .rule-heading, .rules > p { grid-column: auto; }
  .rule-item { padding: 18px 0; border-bottom: 1px solid #3d4742; }
  .result { min-height: 0; padding: 22px 16px; }
  .link-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .copy-button { justify-content: center; padding: 0; }
  .copy-button span { display: none; }
  footer { width: min(100% - 28px, 1120px); gap: 12px; }
  footer span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
