/* FujinAI Image Tools — base stylesheet */
:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --ink: #0b1524;
  --ink-soft: #33465c;
  --muted: #647b93;
  --line: #e2e9f2;
  --line-strong: #cfdbe9;
  --brand: #0d8073;
  --brand-dark: #0a6159;
  --brand-soft: #e6f5f2;
  --accent: #f59e0b;
  --danger: #c2410c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 32, 51, .06);
  --shadow: 0 10px 30px -18px rgba(15, 32, 51, .35);
  --max: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: -.3px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--brand); }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-soft); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.nav a.is-active { color: var(--brand-dark); font-weight: 600; }
.header-cta { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; font-size: 14px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px -10px rgba(13, 128, 115, .9); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- hero ---------- */
.hero {
  padding: 76px 0 56px;
  background:
    radial-gradient(900px 380px at 12% -8%, #d8f0ec 0%, transparent 62%),
    radial-gradient(760px 340px at 92% 0%, #e6efff 0%, transparent 58%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #c9e9e2; padding: 6px 12px; border-radius: 999px; }
h1 { font-size: 44px; line-height: 1.14; letter-spacing: -1.2px; margin: 18px 0 16px; font-weight: 800; }
.lede { font-size: 17px; color: var(--ink-soft); margin: 0 0 26px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

.hero-board { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; }
.board-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 2px 0 12px; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; background: #fbfdff; }
.board-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.board-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.board-meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.board-footer { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 34px; }
h2 { font-size: 28px; letter-spacing: -.6px; margin: 0 0 10px; font-weight: 750; }
.section-head p { color: var(--muted); margin: 0; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tool-card:hover { border-color: #b6d9d2; transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.tool-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.tag-local { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); padding: 4px 9px; border-radius: 999px; }

/* ---------- tool page ---------- */
.tool-head { padding: 44px 0 26px; background: var(--surface); border-bottom: 1px solid var(--line); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.tool-head h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -.8px; }
.tool-head .lede { margin-bottom: 0; max-width: 720px; }

.tool-body { padding: 38px 0 70px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 54px 24px; margin: 18px; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: #fbfdff; cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone strong { font-size: 16px; }
.dropzone span { font-size: 13px; color: var(--muted); }
.dropzone input { display: none; }

.opts { padding: 0 18px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
.field input[type=range] { width: 100%; accent-color: var(--brand); }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: flex; gap: 8px; }

.presets { padding: 0 18px 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-right: 2px; }
.chip {
  font-size: 12.5px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line); background: #fbfdff; }
.actions .status { font-size: 13px; color: var(--muted); margin-left: auto; }

.results { padding: 0 18px 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.result-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.result-thumb { height: 128px; background: #eff3f9; display: flex; align-items: center; justify-content: center; }
.result-thumb img { max-height: 100%; max-width: 100%; object-fit: contain; }
.result-info { padding: 9px 11px; }
.result-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta { font-size: 11.5px; color: var(--muted); }
.result-meta .good { color: var(--brand-dark); font-weight: 600; }
.result-item .dl { display: block; text-align: center; font-size: 12.5px; font-weight: 600; padding: 8px; border-top: 1px solid var(--line); color: var(--brand-dark); }
.result-item .dl:hover { background: var(--brand-soft); text-decoration: none; }

.canvas-wrap { padding: 18px; }
#cropCanvas { max-width: 100%; display: block; margin: 0 auto; cursor: crosshair; border-radius: 8px; background: #eff3f9; touch-action: none; }

.exif-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.exif-table th, .exif-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.exif-table th { width: 38%; color: var(--muted); font-weight: 600; }
.exif-empty { padding: 18px; color: var(--muted); font-size: 14px; }

/* ---------- content blocks ---------- */
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; }
.prose { font-size: 15.5px; color: var(--ink-soft); }
.prose h2 { font-size: 22px; margin: 30px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 16px; padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose code { background: #eef2f8; padding: 1px 5px; border-radius: 5px; font-size: 13.5px; }

.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.step p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-soft); }

.related { padding: 30px 0 0; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.price-card.is-featured { border-color: var(--brand); box-shadow: 0 16px 40px -24px rgba(13, 128, 115, .5); position: relative; }
.price-badge { position: absolute; top: -12px; left: 26px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.price-name { font-size: 15px; font-weight: 700; }
.price-amount { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin: 8px 0 2px; }
.price-amount small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-desc { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.price-list { list-style: none; margin: 0 0 22px; padding: 0; font-size: 13.8px; color: var(--ink-soft); flex: 1; }
.price-list li { display: flex; gap: 9px; margin-bottom: 9px; }
.price-list .yes { color: var(--brand); flex: none; }
.price-list .no { color: #b3c1d1; flex: none; }
.price-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- faq ---------- */
.faq-list { max-width: 820px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq-q { font-weight: 650; font-size: 16px; margin: 0 0 8px; }
.faq-a { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- legal ---------- */
.legal-body { max-width: 800px; }

/* ---------- forms ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto 90px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.4px; }
.auth-card .sub { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; }
.form-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13px; padding: 10px 12px; border-radius: 9px; margin-bottom: 16px; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }

/* ---------- admin ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { background: #fbfdff; font-weight: 600; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: #0d1b2a; color: #b5c4d4; padding: 46px 0 30px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-brand { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-note { font-size: 13px; max-width: 300px; color: #93a6b9; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin: 0 0 12px; }
.footer-col a { display: block; font-size: 13.5px; color: #b5c4d4; padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #1d2f42; padding-top: 18px; font-size: 12.5px; color: #7f93a8; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .card-grid, .price-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .nav-toggle { display: inline-block; }
  .nav.is-open { display: flex; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 20px 16px; border-bottom: 1px solid var(--line); }
  .header-cta { display: none; }
  .card-grid, .price-grid, .related-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  h1 { font-size: 29px; }
  .hero-board { display: none; }
  .opts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ---------- AI studio ---------- */
.ai-credits { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.ai-credits strong { color: var(--brand-dark); }
.ai-gate { border: 1px dashed var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; background: #fbfdfc; }
.ai-gate p { font-size: 14px; line-height: 1.6; margin: 0 0 12px; color: #35485c; }
.ai-preview { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ai-preview span { font-size: 13px; color: var(--muted); }
textarea#aiPrompt { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 14.5px; resize: vertical; }
textarea#aiPrompt:focus { outline: 2px solid rgba(13,128,115,.25); border-color: var(--brand); }
.ai-result { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.ai-result img { max-width: 420px; width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.ai-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }