/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #1a1a2e;
  background: #f7f8fa;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

/* ===== Color System ===== */
:root {
  --primary-900:#0c4a6e; --primary-700:#0369a1; --primary-500:#0ea5e9; --primary-300:#7dd3fc; --primary-100:#e0f2fe;
  --accent-600:#d97706; --accent-500:#f59e0b; --accent-300:#fcd34d;
  --success-600:#16a34a; --success-500:#22c55e;
  --warning-600:#ca8a04; --warning-500:#eab308; --warning-100:#fef9c3;
  --error-600:#dc2626; --error-500:#ef4444;
  --gray-900:#111827; --gray-700:#374151; --gray-500:#6b7280; --gray-300:#d1d5db; --gray-200:#e5e7eb; --gray-100:#f3f4f6; --gray-50:#f9fafb;
  --radius: 10px; --radius-lg: 16px; --shadow: 0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06); --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  --max-width: 1080px; --space: 8px;
}

/* ===== Layout ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--gray-200);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; color: var(--primary-700); }
.logo svg { width: 28px; height: 28px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-700); margin: 4px 0; transition: .3s; }
.main-nav ul { list-style: none; display: flex; gap: 28px; }
.main-nav a { font-weight: 500; color: var(--gray-700); transition: color .2s; }
.main-nav a:hover, .main-nav a.active { color: var(--primary-700); }

/* ===== Ad Slots ===== */
.ad-slot {
  min-height: 100px;
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: .8rem; text-align: center;
  margin: 32px 0; padding: 16px;
}
.ad-top { margin-top: 24px; }
.ad-middle { margin: 40px 0; }
.ad-bottom { margin: 40px 0 24px; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 48px 20px 24px; }
.hero h1 { font-size: 2.25rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; margin-bottom: 12px; }
.hero p { font-size: 1.125rem; color: var(--gray-500); max-width: 640px; margin: 0 auto 8px; }

/* ===== Tool Section ===== */
.tool-section { padding: 16px 0 40px; }
.tool-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--gray-200);
}
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 768px) { .tool-grid { grid-template-columns: 1fr; } }

.panel { padding: 28px; }
.panel + .panel { border-left: 1px solid var(--gray-200); }
@media (max-width: 768px) { .panel + .panel { border-left: none; border-top: 1px solid var(--gray-200); } }

.panel h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; color: var(--gray-900); }

/* ===== Drop Zone ===== */
.drop-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary-500); background: var(--primary-100); }
.drop-zone .dz-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--primary-500); }
.drop-zone .dz-text { font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.drop-zone .dz-sub { font-size: .85rem; color: var(--gray-500); }
.drop-zone input[type="file"] { display: none; }

.file-info { margin-top: 14px; font-size: .85rem; color: var(--gray-500); display: none; }
.file-info.show { display: block; }

/* ===== Controls ===== */
.control-group { margin-bottom: 20px; }
.control-group label { display: block; font-weight: 600; font-size: .875rem; color: var(--gray-700); margin-bottom: 6px; }
.control-group input[type="number"], .control-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 1rem; color: var(--gray-900); background: #fff; transition: border-color .2s;
}
.control-group input[type="number"]:focus, .control-group select:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-100); }

.dimension-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.lock-ratio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; color: var(--gray-700); user-select: none; }
.lock-ratio input { width: 18px; height: 18px; accent-color: var(--primary-500); cursor: pointer; }

/* ===== Slider ===== */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider-wrap input[type="range"] { flex: 1; accent-color: var(--primary-500); cursor: pointer; }
.slider-value { font-weight: 700; color: var(--primary-700); min-width: 48px; text-align: right; font-size: .9rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius); font-weight: 600; font-size: 1rem; cursor: pointer; transition: background .2s, transform .1s, box-shadow .2s; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary-700); color: #fff; }
.btn-primary:hover { background: var(--primary-900); }
.btn-accent { background: var(--accent-500); color: #fff; }
.btn-accent:hover { background: var(--accent-600); }
.btn:disabled { background: var(--gray-300); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Preview ===== */
.preview-area {
  background: var(--gray-50); border-radius: var(--radius); padding: 16px; min-height: 280px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--gray-200);
}
.preview-area .placeholder { text-align: center; color: var(--gray-500); font-size: .9rem; }
.preview-area .placeholder svg { width: 56px; height: 56px; margin: 0 auto 12px; opacity: .4; }
#previewCanvas { max-width: 100%; max-height: 500px; border-radius: var(--radius); box-shadow: var(--shadow); }

.preview-meta { margin-top: 14px; font-size: .85rem; color: var(--gray-500); display: none; }
.preview-meta.show { display: block; }
.preview-meta strong { color: var(--gray-700); }

/* ===== Info / Features ===== */
.section { padding: 48px 0; }
.section h2 { text-align: center; font-size: 1.75rem; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; }
.section .section-intro { text-align: center; color: var(--gray-500); max-width: 600px; margin: 0 auto 36px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .fc-icon { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--primary-500); }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.feature-card p { font-size: .9rem; color: var(--gray-500); }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.step { text-align: center; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-700); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; margin: 0 auto 14px; }
.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--gray-900); }
.step p { font-size: .875rem; color: var(--gray-500); }

/* ===== Content Page ===== */
.content-page { padding: 48px 0; }
.content-page .page-title { font-size: 2rem; font-weight: 800; color: var(--gray-900); margin-bottom: 24px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.375rem; font-weight: 700; color: var(--gray-900); margin: 32px 0 12px; }
.prose p { color: var(--gray-700); margin-bottom: 16px; line-height: 1.7; }
.prose ul { margin: 0 0 16px 20px; color: var(--gray-700); }
.prose li { margin-bottom: 8px; line-height: 1.7; }

/* ===== Footer ===== */
.site-footer { background: var(--gray-900); color: var(--gray-300); padding: 40px 0 24px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-col p, .footer-col li { font-size: .875rem; line-height: 1.7; list-style: none; }
.footer-col a { color: var(--gray-300); transition: color .2s; }
.footer-col a:hover { color: var(--primary-300); }
.footer-bottom { border-top: 1px solid var(--gray-700); padding-top: 16px; text-align: center; font-size: .8rem; color: var(--gray-500); }

/* ===== Mobile Nav ===== */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: #fff; padding: 24px; transform: translateX(100%); transition: transform .3s; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 16px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
}
