:root {
  --page-bg: #f3f6f9;
  --panel: #ffffff;
  --ink: #24364b;
  --muted: #667085;
  --brand: #1e3a5f;
  --brand-2: #234772;
  --line: #e5e9f0;
  --soft: #f5f7fa;
  --focus: #2f7df6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(30, 58, 95, 0.08), transparent 26%),
    linear-gradient(180deg, #f3f6f9 0%, #eef2f6 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

.page-header {
  background: var(--brand);
  color: #fff;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
}

.page-header p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.header-link,
.secondary-btn {
  color: inherit;
  text-decoration: none;
}

.header-link {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.52);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(229, 233, 240, 0.86);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section-title {
  min-height: 66px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.section-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-2);
  color: #fff;
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

h2 {
  color: var(--brand-2);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.section-title p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 18px;
  padding: 22px 20px 18px;
}

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

.format-row {
  display: flex;
}

.format-field {
  width: 240px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #4b5f75;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
button,
textarea {
  font: inherit;
}

input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dde4ee;
  border-radius: 4px;
  background: #fff;
  color: #2f3f52;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.14);
}

input::placeholder {
  color: #a7b2c1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

button,
.secondary-btn {
  min-width: 112px;
  height: 42px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

button {
  border: 1px solid var(--brand-2);
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 4px 10px rgba(35, 71, 114, 0.18);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e0ea;
  background: #fff;
  color: #344054;
}

.meta {
  margin: 0 20px 20px;
  padding: 12px 14px;
  border: 1px solid #d7e6fb;
  border-radius: 6px;
  background: #f0f6ff;
  color: var(--brand-2);
  font-size: 14px;
  font-weight: 600;
}

.output-section {
  margin: 16px 20px 0;
}

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

textarea {
  min-height: 320px;
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #111827;
  color: #f9fafb;
}

.html-grid textarea {
  min-height: 240px;
}

.output-hidden {
  display: none;
}

@media (max-width: 900px) {
  .header-inner,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-link,
  .secondary-btn,
  button {
    width: 100%;
  }

  .grid,
  .html-grid {
    grid-template-columns: 1fr;
  }

  .format-field {
    width: 100%;
  }
}
