:root {
  --bg-main: #070a13;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --glow-cyan: rgba(56, 189, 248, 0.25);
  --glow-purple: rgba(168, 85, 247, 0.25);
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 90% 70%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 10, 19, 0.85);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

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

.brand-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-lab {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.btn-blog-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  transition: all 0.2s ease;
}

.btn-blog-top:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

/* Page Hero */
.app-hero {
  padding: 32px 0 24px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* Main 2-Column Workspace */
.workspace {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 28px;
  align-items: start;
  padding-bottom: 60px;
}

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

/* Form Section (Left Column) */
.builder-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease;
}

.form-group:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #070a13;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* Chip Buttons */
.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--border-active);
  color: var(--accent-cyan);
  box-shadow: 0 0 14px var(--glow-cyan);
  font-weight: 600;
}

/* Custom Input Field */
.custom-input-wrap {
  margin-top: 14px;
}

.custom-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--glow-cyan);
}

.custom-input::placeholder {
  color: var(--text-dim);
}

/* Preview / Output Section (Right Column) */
.preview-panel {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-preview {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--glow-cyan);
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preview-label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-cyan);
}

/* Mode Switch Tabs */
.mode-switch {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border-color);
}

.mode-tab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: var(--accent-cyan);
  color: #070a13;
}

/* Visual Frame Mockup */
.preview-visual-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  position: relative;
  transition: all 0.3s ease;
  background: rgba(56, 189, 248, 0.03);
}

.preview-frame.aspect-sns-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border-color: var(--accent-cyan);
}

.preview-frame.aspect-blog-eye {
  width: 140px;
  height: 79px;
  border-radius: 8px;
  border-color: var(--accent-purple);
}

.preview-frame.aspect-wallpaper {
  width: 60px;
  height: 106px;
  border-radius: 8px;
  border-color: var(--accent-emerald);
}

.frame-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
  pointer-events: none;
}

/* Textarea Output */
.prompt-textarea {
  width: 100%;
  min-height: 180px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Inter', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #e2e8f0;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

.prompt-textarea:focus {
  border-color: var(--accent-cyan);
}

/* Actions */
.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-action-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #070a13;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--glow-cyan);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.4);
}

.btn-action-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Direct Launch Tools */
.card-tools {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
}

.tools-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  text-align: center;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 18px;
}

.tool-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

.tool-badge {
  font-size: 9px;
  color: var(--accent-emerald);
}

/* Article Cross-Promo Card */
.card-article-promo {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s ease;
}

.card-article-promo:hover {
  border-color: var(--accent-cyan);
}

.promo-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.promo-body {
  flex: 1;
}

.promo-tag {
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
}

.promo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin: 2px 0 4px;
}

.promo-link {
  font-size: 11.5px;
  color: var(--accent-cyan);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--glow-cyan);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}
