
:root {
  --bg: #f5f0eb;
  --bg2: #ffffff;
  --ink: #2c1810;
  --muted: #8b7355;
  --rule: #d4c4b0;
  --accent: #c41a1a;
  --accent2: #b8860b;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(44,24,16,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}


.site-header {
  background: linear-gradient(135deg, #8b0000 0%, #c41a1a 50%, #a01010 100%);
  color: #fff; padding: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(139,0,0,0.3);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.site-header.scrolled .site-logo h1 { font-size: 1.3rem; }
.site-header.scrolled .seal-icon { width: 34px; height: 34px; font-size: 1rem; }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 1; min-width: 0; }
.site-logo .seal-icon {
  width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.site-logo h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-logo a { color: #fff; text-decoration: none; }
.header-desc { font-size: 0.82rem; opacity: 0.85; display: none; }
.header-nav { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; flex-shrink: 0; }
.header-nav a {
  color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.95rem;
  padding: 0.45rem 1rem; border-radius: 6px; transition: background 0.2s; white-space: nowrap;
  font-weight: 400;
}
.header-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.header-nav a.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 500; }
.header-nav .nav-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.3); }
.mobile-menu-btn {
  display: none; background: none; border: 2px solid rgba(255,255,255,0.8);
  color: #fff; font-size: 1.4rem; padding: 0.3rem 0.6rem; border-radius: 6px; cursor: pointer;
}


.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.main-content { padding: 2rem 0; }


.generator-section { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 2rem; }
.generator-body { display: grid; grid-template-columns: 320px 1fr; min-height: 500px; }
.control-panel { padding: 1.5rem; border-right: 1px solid var(--rule); overflow-y: auto; max-height: 700px; }
.control-panel::-webkit-scrollbar { width: 4px; }
.control-panel::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }


.ctrl-group { margin-bottom: 1.15rem; }
.ctrl-group label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--muted); margin-bottom: 0.35rem; }
.ctrl-group input[type="text"], .ctrl-group input[type="number"], .ctrl-group select, .ctrl-group textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--rule); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; background: var(--bg); color: var(--ink); transition: border-color 0.2s;
}
.ctrl-group input:focus, .ctrl-group select:focus { outline: none; border-color: var(--accent); }
.ctrl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.color-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.color-input-wrap input[type="color"] { width: 36px; height: 36px; border: 2px solid var(--rule); border-radius: 6px; cursor: pointer; padding: 2px; }
.ctrl-group input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 0.5rem; }
.range-row input[type="range"] { flex: 1; }
.range-val { font-size: 0.82rem; color: var(--muted); min-width: 40px; text-align: right; }
.check-row { display: flex; align-items: center; gap: 0.5rem; }
.check-row input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.check-row span { font-size: 0.88rem; }


.btn-group { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.btn {
  flex: 1; padding: 0.7rem 1rem; border: none; border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a01010; }
.btn-secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--rule); }
.btn-secondary:hover { background: var(--rule); }


.preview-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem;
  background: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  min-height: 400px;
}
.preview-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 1rem; }
#sealCanvas { max-width: 100%; border-radius: 4px; }
.preview-info { margin-top: 1rem; font-size: 0.78rem; color: var(--muted); text-align: center; }


.content-sections { margin-top: 1rem; }
.content-section { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 2.5rem; margin-bottom: 2rem; }
.content-section h2 {
  font-size: 1.5rem; font-weight: 700; color: var(--accent); margin-bottom: 1.25rem;
  padding-bottom: 0.75rem; border-bottom: 2px solid var(--rule); position: relative;
}
.content-section h2::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: var(--accent); }
.content-section h3 { font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 1.5rem 0 0.75rem; }
.content-section p { margin-bottom: 1rem; color: #4a3728; }
.content-section ul, .content-section ol { margin: 0.75rem 0 1.25rem 1.5rem; color: #4a3728; }
.content-section li { margin-bottom: 0.5rem; }
.highlight-box { background: #fef5f0; border-left: 4px solid var(--accent); padding: 1rem 1.25rem; margin: 1rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.highlight-box p { margin-bottom: 0.5rem; }
.highlight-box p:last-child { margin-bottom: 0; }
.info-box { background: #f8f5f0; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
.seal-types-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
.seal-types-table th { background: var(--accent); color: #fff; padding: 0.75rem 1rem; text-align: left; font-weight: 600; }
.seal-types-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); }
.seal-types-table tr:nth-child(even) td { background: #faf7f4; }
.seal-types-table tr:hover td { background: #fef5f0; }
.steps-list { counter-reset: step-counter; list-style: none; margin-left: 0; }
.steps-list li { counter-increment: step-counter; position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; }
.steps-list li::before {
  content: counter(step-counter); position: absolute; left: 0; top: 0.15rem;
  width: 1.75rem; height: 1.75rem; background: var(--accent); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 700;
}


.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.35rem; }


.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); text-align: center; padding: 2rem 1.5rem; margin-top: 2rem; font-size: 0.85rem; }
.site-footer a { color: rgba(255,255,255,0.85); }
.footer-links { margin-top: 0.75rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 0.82rem; }


.seal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.seal-card {
  background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; text-decoration: none; color: var(--ink);
  display: block;
}
.seal-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(44,24,16,0.12); }
.seal-card-icon { height: 180px; display: flex; align-items: center; justify-content: center; position: relative; }
.seal-card-icon canvas { max-width: 160px; max-height: 160px; }
.seal-card-body { padding: 1.25rem; }
.seal-card-body h3 { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 0.5rem; }
.seal-card-body p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }


.related-links { margin-top: 2rem; padding: 1.5rem; background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); }
.related-links h3 { font-size: 1.1rem; color: var(--ink); margin-bottom: 1rem; }
.related-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.related-link {
  display: block; padding: 0.75rem 1rem; background: var(--bg); border-radius: 6px;
  text-decoration: none; color: var(--ink); font-size: 0.88rem; transition: all 0.2s; border: 1px solid var(--rule);
}
.related-link:hover { border-color: var(--accent); color: var(--accent); background: #fef5f0; }
.related-link .rl-arrow { color: var(--accent); margin-left: 0.5rem; }


@media (max-width: 900px) {
  .generator-body { grid-template-columns: 1fr; }
  .control-panel { border-right: none; border-bottom: 1px solid var(--rule); max-height: none; }
  .preview-panel { min-height: 350px; }
  .header-desc { display: block; }
  .header-nav { display: none; }
  .header-nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: rgba(139,0,0,0.97); padding: 1rem; gap: 0.5rem; }
  .header-nav .nav-divider { display: none; }
  .mobile-menu-btn { display: block; }
}
@media (max-width: 600px) {
  .content-section { padding: 1.25rem; }
  .ctrl-row { grid-template-columns: 1fr; }
  .seal-cards { grid-template-columns: 1fr; }
}


.ctrl-sub-label {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: -0.3rem;
  margin-bottom: 0.3rem;
}
.ctrl-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.related-link-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  border: 1px solid var(--rule);
  transition: all 0.2s;
}
.related-link-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fef5f0;
}
.related-icon {
  font-size: 1.1rem;
}
.impression-active {
  box-shadow: inset 0 2px 8px rgba(44, 24, 16, 0.12), inset 0 1px 3px rgba(44, 24, 16, 0.08);
}

@media print {
  .site-header, .breadcrumb, .control-panel, .btn-group, .related-links, .site-footer, .section-heading, .features-section, .knowledge-section, .comparison-section, .hero-section { display: none !important; }
  .generator-body { grid-template-columns: 1fr !important; }
  .preview-panel { background: #fff !important; min-height: auto; page-break-inside: avoid; }
  #sealCanvas { max-width: 80%; }
  .content-section { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}


.preview-actions { margin-bottom: 0.5rem; }
.preview-btn { background: rgba(255,255,255,0.9); border: 1px solid var(--rule); border-radius: 6px; padding: 0.35rem 0.9rem; font-size: 0.82rem; cursor: pointer; color: var(--ink); transition: all 0.2s; }
.preview-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.fs-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; align-items: center; justify-content: center; }
.fs-modal-content { position: relative; background: #fff; padding: 1.5rem; border-radius: var(--radius); max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.fs-close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); }
.fs-close:hover { color: var(--accent); }
#fsCanvas { max-width: 80vw; max-height: 75vh; }
.fs-info { margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }

.back-to-top { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 1.2rem; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 500; transition: opacity 0.3s; }
.back-to-top.visible { display: flex; }
.back-to-top:hover { background: #a01010; }


input[type="checkbox"]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }


button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }


#sealCanvas:hover { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); transition: filter 0.2s; }

