* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f3f4f6;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
}

.ad-banner-top {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ad-placeholder {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 999px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

.nav {
  margin-bottom: 24px;
}

.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #111827;
}

.header {
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5f2ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.header p {
  color: #4b5563;
  font-size: 1rem;
}

.tool-section {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.action-row {
  display: flex;
  gap: 10px;
}

.btn-clear {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #6b7280;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clear:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Result section */
.result-section {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.result-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.copy-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: #e5e7eb;
}

.copy-btn.copied {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.base-url-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
  word-break: break-all;
}

.block-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  flex-shrink: 0;
}

.base-url-value {
  font-size: 0.9rem;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Param table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.param-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.param-table tr:last-child td {
  border-bottom: none;
}

.param-key {
  font-weight: 600;
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.param-key.utm {
  color: #1d4ed8;
}

.param-key.other {
  color: #7c3aed;
}

.param-value {
  color: #111827;
  word-break: break-all;
}

.param-value.empty {
  color: #9ca3af;
  font-style: italic;
}

.copy-cell {
  width: 60px;
  text-align: right;
}

.copy-cell button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.copy-cell button:hover {
  background: #e5e7eb;
  color: #374151;
}

.copy-cell button.copied {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.other-params {
  margin-top: 8px;
}

.other-params-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.notice {
  padding: 14px 16px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #92400e;
}

/* UTM reference grid */
.tips-outer {
  background: #ffffff;
}

.tips-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.utm-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.utm-ref-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.utm-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d4ed8;
}

.utm-desc {
  font-size: 0.82rem;
  color: #6b7280;
}

/* Bottom ad + footer */
.ad-banner-bottom {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
}

@media (max-width: 640px) {
  .page { padding: 24px 16px; }
  .header h1 { font-size: 1.6rem; }
  .utm-ref-grid { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Related tools */
.related-tools {
  margin-top: 32px;
}

.related-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.related-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
  transform: translateY(-1px);
}

.related-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
}

.related-desc {
  font-size: 0.82rem;
  color: #6b7280;
}

@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* FAQ accordion */
.faq {
  margin-top: 40px;
}

.faq-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 1.1rem;
  color: #9ca3af;
  flex-shrink: 0;
  line-height: 1;
}

details[open] > .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 16px 14px;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.65;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
}
