:root {
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-text: #111827;
    --color-muted: #6b7280;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.12);
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: linear-gradient(180deg, #eef2ff 0%, var(--color-bg) 100%);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.container {
    width: min(960px, 92vw);
    margin: 0 auto;
}

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    gap: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand__name {
    font-size: 1.5rem;
    font-weight: 700;
}

.brand__tagline {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav__link {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-nav__link:hover,
.site-nav__link:focus {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.08);
}

.site-nav__link--active {
    font-weight: 600;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.site-nav__link--disabled {
    color: var(--color-muted);
    cursor: not-allowed;
}

.site-main {
    padding: 2.5rem 0 4rem;
}

.intro {
    text-align: center;
    margin-bottom: 2.5rem;
}

.intro h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.intro p {
    margin: 0 auto;
    max-width: 540px;
    color: var(--color-muted);
    line-height: 1.6;
}

.tool {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.tool-form {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.tool-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.tool-form legend {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.tool-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
}

.tool-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-form__label {
    font-size: 0.95rem;
    font-weight: 600;
}

.field-help {
    font-size: 0.8rem;
    color: var(--color-muted);
}

input[type="text"],
input[type="number"],
select,
textarea {
    font: inherit;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input[type="range"] {
    accent-color: var(--color-primary);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}

input[type="color"] {
    padding: 0.15rem;
    height: 2.75rem;
    cursor: pointer;
}

.tool-form__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    font: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn--primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.btn--primary:hover:not(:disabled),
.btn--primary:focus-visible:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.4);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    background: rgba(37, 99, 235, 0.08);
}

.btn--link {
    border: none;
    background: transparent;
    color: var(--color-primary);
    padding: 0;
}

.tool-preview {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.tool-preview h2 {
    margin: 0;
}

.preview-frame {
    padding: 1.5rem;
    background: #f3f4f6;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.qr-preview {
    width: 100%;
    max-width: 360px;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.qr-preview img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    background: #ffffff;
}

.qr-preview__placeholder {
    text-align: center;
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0 1rem;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-help {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
}

.preview-status {
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    transition: color 0.2s ease;
    text-align: center;
}

.preview-status[data-tone="success"] {
    color: #15803d;
}

.preview-status[data-tone="error"] {
    color: #b91c1c;
}

.preview-status[data-tone="info"],
.preview-status[data-tone=""] {
    color: var(--color-muted);
}

.seo-content {
    margin-top: 3rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.seo-content__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.seo-content h2 {
    margin-top: 0;
}

.seo-content__list {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
    color: var(--color-text);
    line-height: 1.6;
}

.seo-content__list--ordered {
    list-style: decimal;
}

.seo-content__faq details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.04);
}

.seo-content__faq details + details {
    margin-top: 0.75rem;
}

.seo-content__faq summary {
    cursor: pointer;
    font-weight: 600;
}

.seo-content__faq p {
    margin: 0.75rem 0 0;
    color: var(--color-muted);
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2rem 0;
    background: rgba(17, 24, 39, 0.92);
    color: rgba(255, 255, 255, 0.85);
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__contact {
    color: #bfdbfe;
}

@media (max-width: 640px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-form {
        padding: 1.5rem;
    }

    .tool-preview {
        padding: 1.5rem;
    }

    .preview-frame {
        padding: 1rem;
    }
}
