:root {
    --bg: #f9ecdf;
    --panel: #ffffff;
    --panel-soft: #fff7f4;
    --panel-border: rgba(34, 35, 37, 0.08);
    --text: #202124;
    --muted: #565b63;
    --accent: #EE4D2D;
    --accent-dark: #d94122;
    --accent-soft: rgba(238, 77, 45, 0.12);
    --success: #1f8a4c;
    --error: #d23434;
    --shadow: 0 18px 40px rgba(71, 39, 28, 0.08);
    --radius-xl: 28px;
    --radius-lg: 8px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.app-shell {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 0 20px 56px;
}

.topbar {
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(238, 77, 45, 0.18);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding-top: 0;
    padding-bottom: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: 42px;
}

.brand span {
    font-size: 0.35em;
    font-weight: 700;
    letter-spacing: 0;
    vertical-align: middle;
    margin-left: 2px;
}

.menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 48px;
    height: 48px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 4px;
    background: #fff;
    border-radius: 999px;
}

.content {
    display: grid;
    gap: 24px;
    padding-top: 22px;
}

.hero,
.generator-card,
.result-card,
.guide-card {
    background: transparent;
}

.hero {
    padding: 28px 8px 8px;
}

.hero h1 {
    margin: 0 0 22px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.04em;
}

.hero-heart {
    color: #72b653;
}

.hero-copy {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.16rem);
    line-height: 1.55;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 18px;
    border-radius: 8px;
}

.hero-copy + .hero-copy {
    margin-top: 14px;
}

.generator-card,
.result-card,
.guide-card {
    padding: 0;
}

.field-label,
.result-header h2,
.guide-heading h2 {
    display: block;
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
}

.generator-form,
.result-card,
.guide-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.generator-form {
    padding: 24px;
}

.field-stack {
    display: grid;
    gap: 10px;
}

.input-group {
    display: grid;
    gap: 14px;
}

.url-input,
.result-output {
    width: 100%;
    border: 1px solid rgba(32, 33, 36, 0.14);
    border-radius: var(--radius-lg);
    background: #fff;
    color: var(--text);
}

.url-input {
    min-height: 45px;
    padding: 0 18px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-input:focus,
.result-output:focus,
.guide-step:focus-visible,
.icon-button:focus-visible {
    border-color: rgba(238, 77, 45, 0.5);
    box-shadow: 0 0 0 4px rgba(238, 77, 45, 0.12);
    outline: none;
}

.primary-button,
.secondary-button {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-button {
    min-height: 40px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 16px 28px rgba(238, 77, 45, 0.22);
    border-color: var(--accent);
}

.secondary-button {
    min-height: 40px;
    background: #fff;
    color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.guide-step:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.error-message {
    display: none;
    margin: 0;
    color: var(--error);
    font-size: 0.95rem;
}

.error-message.is-visible {
    display: block;
}

.result-card.hidden {
    display: none;
}

.result-card {
    padding: 24px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.result-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.result-output {
    min-height: 88px;
    padding: 14px 18px;
    resize: none;
    font: 0.95rem/1.65 Consolas, "Courier New", monospace;
    cursor: copy;
}

.result-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
}

.result-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
}

.button-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.button-cart-icon {
    font-size: 1rem;
    line-height: 1;
}

.icon-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.icon-action-button:hover {
    transform: translateY(-1px);
}

.icon-action-image {
    width: 18px;
    height: 18px;
}

.result-helper {
    margin: 16px 0 12px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.result-post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.post-link-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(24, 119, 242, 0.16);
    border-radius: 12px;
    background: #f5f8ff;
    color: #1f3f73;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.post-link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.08);
    background: #edf3ff;
}

.post-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #1877f2;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
}

.guide-card {
    padding: 28px;
}

.guide-heading {
    max-width: 56ch;
    margin-bottom: 18px;
}

.guide-kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.guide-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.guide-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.guide {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}

.guide-left {
    display: flex;
    justify-content: center;
}

.guide-preview {
    display: grid;
    gap: 16px;
    width: min(100%, 320px);
}

.guide-phone-frame {
    position: relative;
    padding: 14px;
    border-radius: 34px;
    background: linear-gradient(180deg, #2c2f35, #191b1f);
    box-shadow: 0 24px 40px rgba(40, 30, 27, 0.18);
}

.guide-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 2;
    border-radius: 24px;
    object-fit: cover;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.guide-image.is-changing.is-next {
    opacity: 0.28;
    transform: translateX(-6px);
}

.guide-image.is-changing.is-prev {
    opacity: 0.28;
    transform: translateX(6px);
}

.guide-mobile-meta {
    display: none;
}

.guide-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(20, 22, 26, 0.68);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.guide-nav:hover {
    background: rgba(20, 22, 26, 0.82);
}

.guide-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.guide-nav span {
    display: block;
    font-size: 1.85rem;
    line-height: 1;
    transform: translateY(-1px);
}

.guide-nav-prev {
    left: 22px;
}

.guide-nav-next {
    right: 22px;
}

.guide-progress {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
}

.guide-current-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.5;
}

.guide-right {
    position: relative;
    display: grid;
    gap: 12px;
    padding-left: 24px;
}

.guide-right::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 18px;
    width: 2px;
    background: linear-gradient(180deg, rgba(238, 77, 45, 0.28), rgba(238, 77, 45, 0.08));
}

.guide-step {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(32, 33, 36, 0.1);
    background: #fff;
    color: #8a8f96;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.guide-step-title {
    color: #80858d;
    line-height: 1.55;
    transition: color 0.2s ease;
}

.guide-step.is-active .guide-step-number {
    background: var(--accent);
    border-color: rgba(238, 77, 45, 0.2);
    color: #fff;
    transform: scale(1.03);
}

.guide-step.is-active .guide-step-title {
    color: var(--text);
    font-weight: 700;
}

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(32, 33, 36, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 28px rgba(45, 33, 28, 0.12);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    pointer-events: auto;
}

.toast.info {
    border-color: rgba(32, 33, 36, 0.12);
}

.toast.success {
    border-color: rgba(31, 138, 76, 0.2);
    color: var(--success);
}

.toast.warn {
    border-color: rgba(238, 77, 45, 0.22);
    color: var(--accent-dark);
}

.toast.error {
    border-color: rgba(210, 52, 52, 0.2);
    color: var(--error);
}

.qr-modal,
.share-modal {
    width: min(100% - 32px, 420px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
}

.qr-modal::backdrop,
.share-modal::backdrop {
    background: rgba(32, 28, 26, 0.34);
    backdrop-filter: blur(3px);
}

.qr-modal-card,
.share-modal-card {
    background: #fff;
    border: 1px solid rgba(32, 33, 36, 0.08);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.qr-modal-card {
    text-align: center;
}

.qr-modal-header,
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.qr-modal-header h3,
.share-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(32, 33, 36, 0.1);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

.qr-image {
    display: block;
    width: 200px;
    height: 200px;
    margin: 0 auto 14px;
    background: #fff;
    object-fit: cover;
}

.qr-modal-copy,
.share-modal-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.share-modal-copy {
    margin-bottom: 16px;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.share-grid a,
.share-grid button {
    min-height: 48px;
}

.share-grid a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

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

    .guide-mobile-meta {
        display: block;
        order: -1;
        padding: 0 2px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        padding-inline: 12px;
    }

    .topbar-inner {
        min-height: 60px;
    }

    .brand-logo {
        height: 36px;
    }

    .content {
        gap: 18px;
    }

    .hero {
        padding: 24px 8px 2px;
    }

.hero h1 {
        font-size: 22px;
    }

    .hero-copy {
        max-width: none;
        font-size: 1rem;
    }

    .generator-form,
    .result-card,
    .guide-card {
        padding: 20px;
        border-radius: 22px;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .result-post-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-wrap: wrap;
    }

    .guide-preview {
        width: min(100%, 290px);
    }

    .guide-right {
        display: none;
    }

    .share-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}
