:root {
  --ds-bg: #f4f8fb;
  --ds-bg-soft: #eef5fa;
  --ds-surface: #ffffff;
  --ds-surface-muted: #f8fafc;
  --ds-text: #172334;
  --ds-muted: #647489;
  --ds-line: #dbe5ee;
  --ds-primary: #164f7a;
  --ds-primary-dark: #103a5b;
  --ds-primary-soft: #e8f2fa;
  --ds-warning: #a76512;
  --ds-warning-bg: #fff7e8;
  --ds-success: #2d6f58;
  --ds-radius: 10px;
  --ds-radius-lg: 16px;
  --ds-shadow: 0 12px 30px rgba(23, 35, 52, 0.08);
  --ds-shadow-soft: 0 6px 18px rgba(23, 35, 52, 0.05);
  --ds-space-1: 6px;
  --ds-space-2: 10px;
  --ds-space-3: 16px;
  --ds-space-4: 24px;
  --ds-space-5: 36px;
  --ds-space-6: 56px;
  --ds-container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.design-preview {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(214, 233, 246, 0.7), transparent 32%),
    linear-gradient(180deg, var(--ds-bg-soft) 0%, var(--ds-bg) 48%, #f7f9fb 100%);
  color: var(--ds-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  letter-spacing: normal;
  overflow-wrap: normal;
  text-align: start;
  word-break: normal;
  word-spacing: normal;
}

body.design-preview :where(
  p,
  li,
  a,
  button,
  label,
  input,
  select,
  textarea,
  code,
  pre,
  h1,
  h2,
  h3,
  strong,
  span,
  nav
) {
  letter-spacing: normal;
  text-align: start;
  word-spacing: normal;
}

body.design-preview :where(
  input,
  select,
  textarea,
  button,
  code,
  pre,
  .ds-template,
  .ds-template-title
) {
  letter-spacing: normal;
  overflow-wrap: break-word;
  word-break: normal;
  word-spacing: normal;
}

body,
nav,
button,
input,
select,
textarea,
.card,
.result-card,
.article-card,
.ad-placeholder,
.template-box,
.template-content,
pre,
code {
  letter-spacing: normal;
  word-spacing: normal;
}

.template-content,
pre,
code {
  overflow-wrap: break-word;
  white-space: pre-wrap;
  word-break: normal;
}

.ds-container {
  width: min(var(--ds-container), calc(100% - 32px));
  margin: 0 auto;
}

.ds-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(219, 229, 238, 0.85);
  backdrop-filter: blur(10px);
}

.ds-nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
  padding: 6px 0;
}

.ds-brand {
  color: var(--ds-text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

.ds-menu a {
  color: #314357;
  font-weight: 650;
  letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-menu a:hover {
  color: var(--ds-primary);
}

.ds-hero {
  padding: 48px 0 30px;
}

.ds-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 32px;
  align-items: center;
}

.ds-eyebrow {
  margin: 0 0 8px;
  color: var(--ds-primary);
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-hero h1,
.ds-section h2,
.ds-card h3,
.ds-report h3 {
  margin: 0;
  line-height: 1.25;
}

.ds-hero h1 {
  max-width: 720px;
  font-size: clamp(34px, 4.6vw, 52px);
  letter-spacing: normal;
  word-break: keep-all;
}

.ds-lead {
  max-width: 760px;
  margin: 12px 0 0;
  color: #4e6278;
  font-size: 19px;
  word-break: normal;
}

.ds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-3);
  margin-top: 22px;
}

.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--ds-primary);
  border-radius: var(--ds-radius);
  background: var(--ds-primary);
  color: #fff;
  font-weight: 750;
  letter-spacing: normal;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 79, 122, 0.16);
  white-space: nowrap;
  word-break: keep-all;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ds-button:hover {
  background: var(--ds-primary-dark);
  border-color: var(--ds-primary-dark);
}

.ds-button.secondary {
  background: var(--ds-surface);
  color: var(--ds-primary);
  box-shadow: none;
}

.ds-button.secondary:hover {
  background: var(--ds-primary-soft);
}

.ds-helper-text {
  margin: 10px 0 0;
  color: #5f7083;
  font-size: 13px;
}

.ds-hero-note {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg);
  padding: 22px;
  box-shadow: var(--ds-shadow);
}

.ds-note-label {
  display: inline-flex;
  margin-bottom: var(--ds-space-3);
  padding: 4px 10px;
  border: 1px solid #d5e5f0;
  border-radius: 999px;
  background: #f2f7fb;
  color: var(--ds-primary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-hero-note strong {
  display: block;
  margin-bottom: var(--ds-space-2);
  color: var(--ds-primary-dark);
  font-size: 18px;
  word-break: keep-all;
}

.ds-check-list,
.ds-advice-list {
  display: grid;
  gap: var(--ds-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-check-list li,
.ds-advice-list li {
  position: relative;
  padding-left: 24px;
}

.ds-check-list li::before,
.ds-advice-list li::before {
  content: "";
  position: absolute;
  top: 0.74em;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ds-success);
}

.ds-section {
  padding: 28px 0;
}

.ds-section-head {
  margin-bottom: var(--ds-space-4);
}

.ds-section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  word-break: keep-all;
}

.ds-section-head p {
  max-width: 700px;
  margin: var(--ds-space-2) 0 0;
  color: var(--ds-muted);
}

.ds-grid {
  display: grid;
  gap: var(--ds-space-4);
  align-items: stretch;
}

.ds-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ds-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-card,
.ds-form-card,
.ds-report {
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-soft);
}

.ds-card {
  position: relative;
  padding: var(--ds-space-4);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ds-card:hover {
  border-color: #b9ccdc;
  box-shadow: 0 12px 28px rgba(23, 35, 52, 0.1);
  transform: translateY(-2px);
}

.ds-card-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--ds-space-3);
  border: 1px solid #d4e3ee;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7fbff 0%, #eaf3fa 100%);
  color: var(--ds-primary);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.ds-card h3 {
  color: #18293b;
  font-size: 20px;
  letter-spacing: normal;
  word-break: keep-all;
}

.ds-card p {
  margin: 9px 0 0;
  color: var(--ds-muted);
  font-size: 15px;
}

.ds-card-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--ds-primary);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-ad {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  padding: 15px 18px;
  border: 1px solid #dfe8ef;
  border-radius: var(--ds-radius);
  background: #f5f8fb;
  color: #8a98a7;
  font-size: 12px;
  letter-spacing: normal;
}

.ds-ad-section {
  padding: 24px 0;
}

.ds-ad strong {
  color: #748294;
  font-size: 13px;
  font-weight: 650;
}

.ds-form-card,
.ds-report {
  padding: var(--ds-space-4);
}

.ds-form-card {
  display: flex;
  flex-direction: column;
}

.ds-form-card form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.ds-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-space-3);
}

.ds-field {
  display: grid;
  gap: var(--ds-space-1);
}

.ds-field.full {
  grid-column: 1 / -1;
}

.ds-field label {
  color: #26384b;
  font-size: 14px;
  font-weight: 750;
  word-break: keep-all;
}

.ds-field input,
.ds-field select,
.ds-field textarea {
  width: 100%;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: #fff;
  color: var(--ds-text);
  font: inherit;
  letter-spacing: normal;
  overflow-wrap: break-word;
  padding: 11px 12px;
  word-break: normal;
  word-spacing: normal;
}

.ds-field textarea {
  min-height: 150px;
  resize: vertical;
}

.ds-field input:focus,
.ds-field select:focus,
.ds-field textarea:focus {
  border-color: var(--ds-primary);
  outline: 3px solid rgba(22, 79, 122, 0.12);
}

.ds-form-actions {
  margin-top: auto;
  padding-top: var(--ds-space-4);
}

.ds-form-actions .ds-button {
  width: 100%;
}

.ds-report {
  display: flex;
  flex-direction: column;
}

.ds-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-3);
  margin-top: 0;
}

.ds-risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #edd5a6;
  border-radius: 999px;
  background: var(--ds-warning-bg);
  color: #8a5512;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-report-section {
  padding: 14px 0;
  border-top: 1px solid #eef3f7;
}

.ds-report-section p {
  margin: 4px 0 0;
  color: var(--ds-muted);
  word-break: keep-all;
}

.ds-risk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
}

.ds-report-label {
  display: block;
  margin-bottom: 7px;
  color: #2f4154;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-template {
  margin-top: auto;
  border: 1px solid #d8e3ec;
  border-radius: var(--ds-radius);
  background: var(--ds-surface-muted);
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

.ds-template-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  padding: 10px 14px;
  border-bottom: 1px solid #d8e3ec;
  color: #41556a;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: normal;
  overflow-wrap: break-word;
  word-break: keep-all;
  word-spacing: normal;
}

.ds-template-title button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #c8d7e3;
  border-radius: 8px;
  background: #fff;
  color: var(--ds-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: default;
  letter-spacing: normal;
  overflow-wrap: break-word;
  white-space: nowrap;
  word-break: normal;
  word-spacing: normal;
}

.ds-template pre {
  margin: 0;
  padding: var(--ds-space-3);
  color: #233548;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  letter-spacing: normal;
  line-height: 1.6;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  word-break: normal;
  word-spacing: normal;
}

.ds-article-card {
  min-height: 178px;
  display: flex;
  flex-direction: column;
}

.ds-article-meta {
  align-self: flex-start;
  margin-bottom: 13px;
  padding: 4px 9px;
  border: 1px solid #d7e5ef;
  border-radius: 999px;
  background: #f1f7fb;
  color: var(--ds-primary-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  word-break: keep-all;
}

.ds-footer {
  margin-top: var(--ds-space-5);
  padding: 46px 0 36px;
  background: #172334;
  color: #dce6ef;
}

.ds-footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
}

.ds-footer strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  word-break: keep-all;
}

.ds-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-3);
}

.ds-footer a {
  color: #edf5fb;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}

@media (max-width: 820px) {
  .ds-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    min-height: 60px;
    padding: 10px 0 8px;
  }

  .ds-footer-layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .ds-menu {
    width: 100%;
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .ds-menu::-webkit-scrollbar {
    display: none;
  }

  .ds-hero {
    padding: 26px 0 14px;
  }

  .ds-hero-layout {
    gap: 14px;
  }

  .ds-eyebrow {
    font-size: 14px;
  }

  .ds-hero h1 {
    font-size: 34px;
  }

  .ds-lead {
    margin-top: 10px;
    font-size: 16px;
  }

  .ds-actions {
    gap: 8px;
    margin-top: 16px;
  }

  .ds-button {
    min-height: 44px;
  }

  .ds-helper-text {
    margin-top: 8px;
    font-size: 12px;
  }

  .ds-hero-note {
    padding: 15px;
    box-shadow: var(--ds-shadow-soft);
  }

  .ds-note-label {
    margin-bottom: 9px;
  }

  .ds-hero-note strong {
    font-size: 16px;
  }

  .ds-check-list,
  .ds-advice-list {
    gap: 7px;
  }

  .ds-section {
    padding: 20px 0;
  }

  .ds-ad-section {
    padding: 12px 0;
  }

  .ds-section-head {
    margin-bottom: 16px;
  }

  .ds-grid {
    gap: 14px;
  }

  .ds-card,
  .ds-form-card,
  .ds-report {
    padding: 18px;
  }

  .ds-card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
  }

  .ds-card-link {
    margin-top: 12px;
  }

  .ds-ad {
    min-height: 90px;
    padding: 12px 14px;
  }

  .ds-field input,
  .ds-field select,
  .ds-field textarea {
    min-height: 44px;
  }

  .ds-field textarea {
    min-height: 126px;
  }

  .ds-form-actions {
    padding-top: 16px;
  }

  .ds-risk-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ds-report-section {
    padding: 12px 0;
  }

  .ds-template pre {
    font-size: 13px;
  }

  .ds-hero-layout,
  .ds-grid.three,
  .ds-grid.two,
  .ds-form-grid {
    grid-template-columns: 1fr;
  }

  .ds-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ds-button {
    width: 100%;
  }

  .ds-report-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
