
:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --text: #15203c;
  --muted: #67718a;
  --line: #dde4f2;
  --line-strong: #ccd6ea;
  --primary: #07122b;
  --accent: #5b7cff;
  --accent-soft: rgba(91,124,255,.10);
  --gold: #f4bf3f;
  --green: #84a94f;
  --green-soft: rgba(132,169,79,.14);
  --blue-soft: rgba(70,131,242,.14);
  --cyan-soft: rgba(70,183,225,.14);
  --yellow-soft: rgba(244,191,63,.15);
  --shadow: 0 14px 32px rgba(20,35,74,.07);
  --shadow-lg: 0 18px 48px rgba(20,35,74,.09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 14%, rgba(91,124,255,.08), transparent 26%),
    radial-gradient(circle at 92% 20%, rgba(160,180,255,.11), transparent 28%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden, .hidden-file { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(91,124,255,.35); outline-offset: 3px; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: 70px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; background: var(--primary); position: relative; overflow: hidden; box-shadow: 0 8px 18px rgba(7,18,43,.18); }
.brand-moon { position: absolute; width: 20px; height: 20px; left: 9px; top: 9px; border-radius: 50%; background: var(--gold); }
.brand-moon::after { content: ""; position: absolute; width: 17px; height: 17px; left: 8px; top: 1px; border-radius: 50%; background: var(--primary); }
.brand-name { font-size: 1.8rem; font-weight: 800; letter-spacing: -.04em; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.top-link { padding: 9px 12px; border-radius: 11px; color: var(--muted); font-weight: 700; font-size: 14px; }
.top-link:hover, .top-link.active { color: var(--accent); background: var(--accent-soft); }

.page-shell, .home-shell { width: min(1200px, calc(100% - 44px)); margin: 0 auto; }
.home-intro { padding: 24px 0 12px; }
.home-intro h1 { margin: 0; font-size: clamp(28px,4vw,44px); line-height: 1.06; letter-spacing: -.05em; max-width: 760px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 20px; }
.filter-chip { padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.72); color: #9aa4bb; font-weight: 700; font-size: 13px; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 16px; padding-bottom: 24px; }
.tool-card { min-height: 205px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); padding: 20px; position: relative; display: flex; flex-direction: column; align-items: flex-start; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cbd7ef; }
.tool-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 16px; }
.tool-icon.green { background: var(--green-soft); color: var(--green); }
.tool-icon.blue { background: var(--blue-soft); color: #5a78e2; }
.tool-icon.cyan { background: var(--cyan-soft); color: #299fcb; }
.tool-icon.yellow { background: var(--yellow-soft); color: #c39d1f; }
.tool-svg { width: 34px; height: 34px; }
.tool-card h2, .tool-card h3 { margin: 0 0 9px; font-size: 1.22rem; line-height: 1.15; letter-spacing: -.03em; }
.tool-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14.5px; }
.tool-badge { position: absolute; top: 16px; right: 16px; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(132,169,79,.14); color: var(--green); }

.page-intro { padding: 24px 0 20px; }
.page-intro h1 { margin: 0 0 8px; font-size: clamp(28px,4vw,42px); line-height: 1.06; letter-spacing: -.05em; }
.page-intro p { margin: 0; color: var(--muted); max-width: 780px; line-height: 1.65; }
.eyebrow { display: inline-flex; align-items: center; padding: 7px 11px; margin-bottom: 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.layout-2 { display: grid; grid-template-columns: minmax(280px,360px) minmax(0,1fr); gap: 18px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-title { margin: 0 0 14px; font-size: 1.08rem; letter-spacing: -.02em; }
.stack { display: grid; gap: 14px; }
.stack-gap { margin-top: 14px; }
.upload-zone { border: 2px dashed var(--line-strong); border-radius: 20px; padding: 20px; text-align: center; background: #fbfcff; transition: border-color .2s ease, background .2s ease; }
.upload-zone.dragover { border-color: var(--accent); background: #f4f7ff; }
.upload-zone p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.upload-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: linear-gradient(145deg,var(--accent),#8c7cff); color: #fff; font-size: 26px; box-shadow: 0 12px 26px rgba(91,124,255,.22); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 14px; color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn, .btn-secondary { border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 800; }
.btn { background: linear-gradient(145deg,var(--accent),#8b7cff); color: #fff; box-shadow: 0 10px 24px rgba(91,124,255,.22); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn:disabled, .btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.notice { border-radius: 14px; padding: 12px 14px; background: #f6f9ff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }
.preview-stage { padding: 18px; }
.preview-stage.dark { background: linear-gradient(180deg,#fbfcff 0%,#f6f8fd 100%); }
.preview-shell { border: 1px solid var(--line); border-radius: 20px; background: #f4f7fd; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; padding: 16px; width: 100%; min-height: 0; }
.preview-shell img, .preview-shell canvas { max-width: 100%; max-height: 620px; width: auto; height: auto; object-fit: contain; display: block; }
.preview-placeholder { color: #9aa4b6; text-align: center; padding: 90px 20px; width: 100%; min-height: 280px; display: grid; place-items: center; }
.result-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 16px; }
.stat { border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; padding: 14px; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.stat strong { font-size: 17px; }
.loader { display: none; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.loader.show { display: inline-flex; }
.spinner { width: 18px; height: 18px; border: 2px solid #d8dff0; border-top-color: var(--accent); border-radius: 999px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checker { background-image: linear-gradient(45deg,#edf1fb 25%,transparent 25%),linear-gradient(-45deg,#edf1fb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf1fb 75%),linear-gradient(-45deg,transparent 75%,#edf1fb 75%); background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; }
.range-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.crop-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.crop-stage img { display: block; max-width: 100%; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(21,32,60,.45); cursor: move; }
.crop-box .handle { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }

.seo-content { width: min(900px,100%); margin: 28px auto 0; display: grid; gap: 16px; }
.info-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.92); padding: 20px; }
.info-card h2 { margin: 0 0 10px; font-size: 1.35rem; letter-spacing: -.03em; }
.info-card h3 { margin: 18px 0 7px; font-size: 1.04rem; }
.info-card p, .info-card li { color: var(--muted); line-height: 1.72; }
.info-card ul { margin: 8px 0 0; padding-left: 20px; }
.faq details { border-top: 1px solid var(--line); padding: 13px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 750; }
.faq details p { margin: 8px 0 0; }

.guides-strip { margin: 10px 0 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 12px 0 14px; }
.section-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.04em; }
.section-head a { color: var(--accent); font-weight: 750; font-size: 14px; }
.guide-mini-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.guide-mini { border: 1px solid var(--line); background: rgba(255,255,255,.88); border-radius: 18px; padding: 16px; }
.guide-mini strong { display: block; margin-bottom: 6px; line-height: 1.3; }
.guide-mini span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.article-shell { width: min(860px,calc(100% - 44px)); margin: 0 auto; }
.breadcrumb { margin-top: 22px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--accent); }
.article-hero { padding: 18px 0 12px; }
.article-hero h1 { margin: 0 0 12px; font-size: clamp(32px,5vw,50px); line-height: 1.06; letter-spacing: -.05em; }
.article-hero p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.article-meta { margin-top: 12px; color: #9199aa; font-size: 13px; }
.article-body { margin-top: 20px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.94); padding: clamp(20px,4vw,38px); box-shadow: var(--shadow); }
.article-body h2 { margin: 30px 0 10px; font-size: 1.55rem; letter-spacing: -.035em; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 22px 0 8px; }
.article-body p, .article-body li { color: #4f5a72; font-size: 16px; line-height: 1.8; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.article-cta { margin: 28px 0 4px; border-radius: 20px; padding: 20px; background: linear-gradient(145deg,#0b1733,#182b5d); color: #fff; }
.article-cta h2 { color: #fff; margin: 0 0 7px; }
.article-cta p { color: rgba(255,255,255,.78); margin: 0 0 14px; }
.article-cta a { display: inline-flex; background: #fff; color: #13214a; padding: 11px 14px; border-radius: 12px; text-decoration: none; }
.guides-index { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-top: 18px; }
.guide-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.92); padding: 20px; box-shadow: var(--shadow); }
.guide-card h2 { margin: 0 0 8px; font-size: 1.2rem; line-height: 1.25; }
.guide-card p { margin: 0; color: var(--muted); line-height: 1.6; }

.legal-shell { width: min(860px,calc(100% - 44px)); margin: 0 auto; }
.legal-card { margin-top: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.95); border-radius: 24px; padding: clamp(22px,4vw,38px); box-shadow: var(--shadow); }
.legal-card h1 { margin: 0 0 12px; font-size: clamp(30px,4vw,44px); letter-spacing: -.05em; }
.legal-card h2 { margin: 28px 0 9px; font-size: 1.35rem; }
.legal-card p, .legal-card li { color: var(--muted); line-height: 1.75; }

.site-footer { margin-top: 32px; padding: 26px 0 30px; border-top: 1px solid var(--line); color: #8e96a7; font-size: 13px; }
.footer-inner { width: min(1200px,calc(100% - 44px)); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

@media (max-width:980px) {
  .layout-2 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .guide-mini-grid { grid-template-columns: 1fr; }
}
@media (max-width:720px) {
  .topbar { padding: 0 14px; height: 66px; }
  .brand-name { font-size: 1.55rem; }
  .top-link { padding: 8px 9px; }
  .page-shell, .home-shell, .article-shell, .legal-shell { width: min(100% - 22px,1200px); }
  .tool-grid, .guides-index, .row, .result-grid { grid-template-columns: 1fr; }
  .preview-placeholder { min-height: 220px; padding: 68px 18px; }
  .footer-inner { width: min(100% - 22px,1200px); }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
