* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1D9E75;
  --primary-dark: #0F6E56;
  --primary-light: #E1F5EE;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-500: #737373;
  --gray-700: #404040;
  --gray-900: #171717;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 24px 0;
  text-align: center;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.tagline {
  font-size: 14px;
  color: var(--gray-500);
}

.main {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.tool-section {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.qr-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.5;
  outline: none;
}

.qr-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.char-count {
  font-size: 12px;
  color: var(--gray-500);
}

.char-count.warning {
  color: #E24B4A;
}

.options-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.option {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.option select,
.option input[type="color"] {
  height: 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.option input[type="color"] {
  width: 44px;
  padding: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-100);
}

.qr-container {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  text-align: center;
  padding: 40px;
}

.qr-placeholder svg {
  opacity: 0.4;
  margin-bottom: 16px;
}

.placeholder-text {
  font-size: 14px;
  color: var(--gray-500);
}

.qr-result {
  text-align: center;
  width: 100%;
}

.qr-code {
  display: flex;
  justify-content: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius-sm);
}

.qr-code canvas {
  border-radius: 4px;
}

.qr-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.ad-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ad-label {
  font-size: 12px;
  color: var(--gray-300);
  margin-bottom: 4px;
}

.ad-hint {
  font-size: 11px;
  color: var(--gray-300);
}

.features {
  padding: 48px 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  color: var(--gray-900);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.feature-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

.how-to {
  padding: 0 20px 48px;
}

.steps {
  list-style: none;
  counter-reset: step;
  max-width: 600px;
  margin: 0 auto;
}

.steps li {
  counter-increment: step;
  padding: 16px 16px 16px 56px;
  position: relative;
  font-size: 15px;
  color: var(--gray-700);
  border-left: 2px solid var(--gray-200);
  margin-left: 20px;
}

.steps li:last-child {
  border-left-color: transparent;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -18px;
  top: 14px;
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.faq {
  padding: 0 20px 48px;
}

.faq-item {
  background: white;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--gray-500);
  font-weight: 300;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}

.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-500);
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 1000;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .ad-sidebar {
    display: none;
  }

  .tool-section {
    padding: 20px;
  }

  .options-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .option select {
    width: 100%;
  }

  .logo {
    font-size: 20px;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}
