:root {
  color-scheme: light;
  --ink: #17201e;
  --muted: #7d8783;
  --paper: #f6f4ef;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --line: rgba(28, 43, 39, 0.1);
  --line-strong: rgba(28, 43, 39, 0.18);
  --green: #0d5f53;
  --green-soft: #e9f3ef;
  --gold: #c7a461;
  --danger: #c84b5c;
  --shadow: 0 22px 56px rgba(41, 55, 50, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(199, 164, 97, 0.16), transparent 17rem),
    radial-gradient(circle at 88% 8%, rgba(13, 95, 83, 0.11), transparent 16rem),
    linear-gradient(180deg, #fbfaf7 0%, var(--paper) 52%, #f0eee9 100%);
}

[hidden] {
  display: none !important;
}

button,
a,
textarea {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  position: relative;
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 16px 34px;
}

.app-hero {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 2px 22px;
}

.app-hero::after {
  position: absolute;
  right: 2px;
  bottom: 6px;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199, 164, 97, 0.62));
  content: "";
}

.hero-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 46%),
    var(--green);
  box-shadow: 0 18px 38px rgba(13, 95, 83, 0.22);
  font-size: 29px;
  font-weight: 950;
}

.hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mini-label,
.eyebrow,
.section-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-copy h1 {
  font-size: clamp(34px, 8vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p:last-child {
  color: var(--muted);
  line-height: 1.58;
}

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

.panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 18px;
}

.tool-head {
  display: block;
}

.tool-title {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.tool-head p + p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.parse-form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 126px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

textarea::placeholder {
  color: #a2aaa6;
}

textarea:focus {
  border-color: rgba(13, 95, 83, 0.38);
  box-shadow:
    0 0 0 4px rgba(13, 95, 83, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form-row {
  display: grid;
  grid-template-columns: 0.85fr 1.35fr 0.85fr;
  gap: 10px;
}

button,
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

button:focus-visible,
.button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13, 95, 83, 0.2);
  outline-offset: 2px;
}

#parse-button,
.primary,
.media-action {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    var(--green);
  box-shadow: 0 16px 30px rgba(13, 95, 83, 0.2);
  font-weight: 950;
}

.ghost,
.secondary {
  color: var(--green);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.danger {
  color: #9f3342;
  border-color: rgba(200, 75, 92, 0.28);
  background: #fff4f5;
}

.status-line {
  border: 1px solid rgba(13, 95, 83, 0.1);
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--green);
  background: rgba(233, 243, 239, 0.72);
}

.status-line[data-tone="error"] {
  border-color: rgba(200, 75, 92, 0.26);
  color: #9f3342;
  background: #fff5f6;
}

.status-line[data-tone="success"] {
  border-color: rgba(13, 95, 83, 0.14);
  background: rgba(233, 243, 239, 0.9);
}

.helper-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
}

.helper-card p {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 950;
}

.helper-card ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.78;
}

.menu-list {
  display: grid;
  gap: 10px;
}

.menu-item {
  display: grid;
  min-height: 60px;
  grid-template-columns: 34px auto 1fr 18px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
}

.menu-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(199, 164, 97, 0.13);
  font-size: 11px;
  font-weight: 950;
}

.menu-icon.note {
  color: var(--green);
  background: rgba(13, 95, 83, 0.09);
}

.menu-item strong {
  font-size: 15px;
}

.menu-item em {
  overflow: hidden;
  color: #9ba39f;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item b {
  color: #b9c0bd;
  font-size: 26px;
  font-weight: 300;
}

.result-panel {
  overflow: hidden;
  min-height: 360px;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  gap: 16px;
  padding: 32px 20px;
  text-align: center;
}

.empty-device {
  position: relative;
  width: 106px;
  height: 150px;
  border: 7px solid #1e2926;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(199, 164, 97, 0.15), transparent 54%),
    #fffefa;
  box-shadow: 0 18px 40px rgba(41, 55, 50, 0.14);
}

.empty-device div {
  position: absolute;
  inset: 34px 18px auto;
  height: 48px;
  border-radius: 15px;
  background: var(--green);
}

.empty-device span {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  height: 8px;
  border-radius: 999px;
  background: #dfe4e1;
}

.empty-state p {
  max-width: 17rem;
  color: var(--muted);
  line-height: 1.7;
}

.result-card {
  display: grid;
}

.media-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 12px;
  background: #111a18;
}

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.result-tab {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #b8c3bf;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
}

.result-tab[aria-selected="true"] {
  color: #ffffff;
  border-color: rgba(199, 164, 97, 0.32);
  background: var(--green);
}

.media-frame {
  display: grid;
  gap: 10px;
  align-content: start;
}

.media-frame img,
.media-frame video {
  width: 100%;
  border-radius: 18px;
  background: #050706;
}

.media-frame img {
  aspect-ratio: 9 / 12;
  object-fit: cover;
}

.media-frame video {
  aspect-ratio: 9 / 16;
}

.title-panel {
  display: grid;
  min-height: 300px;
  align-content: center;
  gap: 18px;
  padding: 18px 10px 8px;
  color: #ffffff;
}

.title-panel p {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.65;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.eyebrow,
.section-label {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 950;
}

h2 {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 21px;
  line-height: 1.34;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.meta-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.62);
}

dt {
  color: var(--muted);
  font-size: 11px;
}

dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 950;
}

.action-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
}

.section-label {
  margin-bottom: 8px;
}

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 950;
}

.variant.active {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
}

.hidden {
  display: none !important;
}

@media (min-width: 780px) {
  .shell {
    width: min(960px, calc(100vw - 40px));
    padding-top: 30px;
  }

  .workspace {
    grid-template-columns: 390px minmax(0, 1fr);
    align-items: start;
  }

  .app-hero {
    grid-template-columns: 72px minmax(0, 1fr);
    padding-inline: 8px;
  }

  .hero-mark {
    width: 72px;
    height: 72px;
    border-radius: 26px;
  }

  .result-card {
    grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr);
  }
}
