/* meta-matic - Minimal Style */

@import url('https://fonts.googleapis.com/css2?family=Rampart+One&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #00b390;
    --color-primary-hover: #008870;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-light: #f9fafb;
    --color-border: #e5e7eb;
}

body {
    font-family: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Announcement Banner */
.announcement {
    padding: 0.3rem 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    animation: subtlePulse 2s ease-in-out infinite;
}
.announcement--info {
    background: #3b82f6;
    color: #fff;
}
.announcement--warning {
    background: #f59e0b;
    color: #fff;
}
.announcement--error {
    background: #ef4444;
    color: #fff;
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Header */
.header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: inline-block;
}

.nav a:hover {
    color: var(--color-text);
}

.nav > a {
    padding: 4px 0;
    position: relative;
}

.nav > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width 0.2s ease;
}

.nav > a:hover::after {
    width: 100%;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
    display: inline-block;
    width: auto;
    flex: 0 0 auto;
}

.lang-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text);
    padding: 0;
    margin: 0;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
}

.lang-toggle:hover {
    color: var(--color-text);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: auto;
    right: 0;

    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* ここが重要：縦並びを強制 */
    display: none;
    flex-direction: column;
    align-items: stretch;

    /* 幅は中身に合わせつつ、最低幅だけ持たせる */
    width: max-content;
    min-width: 8rem;

    z-index: 1000;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.lang-switcher:hover .lang-menu,
.lang-switcher:focus-within .lang-menu {
    /* block ではなく flex で表示 */
    display: flex;
}

/* 基本スタイル（PC ドロップダウン・モバイル両方に適用） */
.lang-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
}

.lang-link:last-child {
    border-bottom: none;
}

.lang-link:hover {
    background: var(--color-bg-light);
    color: var(--color-text);
}

.lang-link.active {
    background: var(--color-primary);
    color: white;
}

.lang-link.active:hover {
    background: var(--color-primary-hover);
}

/* PC ドロップダウン内の差分のみ */
.lang-menu .lang-link {
    width: 100%;
    text-align: center;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-family: 'Rampart One', "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--color-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 0;
    font-weight: 400;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: var(--color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--color-primary-hover);
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer p {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Generators Section */
.generators {
    padding: 8rem 2rem;
    border-top: none;
}

.generators-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.generator-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.generator-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.2s ease;
    cursor: pointer;
}

.generator-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
}

.generator-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generator-card.disabled:hover {
    transform: none;
}

.generator-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
    background-color: var(--color-bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
}

.generator-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: var(--color-bg-light);
}

.generator-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.generator-card:hover .generator-img img {
    transform: scale(1.1);
}

.generator-card-text {
    padding: 2rem;
    text-align: center;
}

.generator-card h3 {
    font-family: 'Rampart One', "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--color-primary);
}

.generator-card p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.5;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 3rem 2rem;
}

.page-inner {
    max-width: 640px;
    margin: 0 auto;
}

.page-content h1 {
    font-family: 'Rampart One', "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.page-description {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.feature-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

/* Spec Tags */
.spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.spec-tag {
    display: inline-flex;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
}

.spec-label {
    padding: 0.375rem 0.625rem;
    background-color: var(--color-bg-light);
    color: var(--color-text-light);
    font-weight: 500;
}

.spec-value {
    padding: 0.375rem 0.625rem;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-weight: 600;
}

/* Form Styles */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Radio Button Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.95rem;
    margin: 0;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--color-primary);
}

.radio-label input[type="radio"]:hover,
.radio-label input[type="checkbox"]:hover {
    accent-color: var(--color-primary-hover);
}

.input-with-unit {
    display: flex;
    align-items: stretch;
}

.input-with-unit input,
select {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background-color: var(--color-bg);
    color: var(--color-text);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23008870' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.input-with-unit input:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 179, 144, 0.1);
}

.input-with-unit .unit {
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--color-text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.form-warning {
    font-size: 0.8rem;
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #fecaca;
    margin-top: 0.25rem;
}

.section-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #ddd;
}

.form-info {
    background-color: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.form-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-light);
}

.form-caution {
    margin-top: 2rem;
    border-left: 8px solid #ff9800;
    background-color: #fff3e0;
    padding: 1rem;
}

.form-caution h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #e65100;
}

.form-caution p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.info-table td:first-child {
    color: var(--color-text-light);
}

.info-table td:last-child {
    text-align: right;
    font-weight: 500;
    font-family: monospace;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
}

/* Error Box */
.error-box {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.error-box ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #991b1b;
}

.error-box li {
    margin-bottom: 0.25rem;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
    transform-origin: center;
}

/* ☰ → ✕ アニメーション */
.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 0.5rem 0;
}

.mobile-menu.is-open {
    display: flex;
}

.mobile-nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover {
    color: var(--color-text);
}

.mobile-lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-light);
    font-family: inherit;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.mobile-lang-toggle:hover {
    color: var(--color-text);
}

.mobile-lang-arrow {
    font-size: 0.75rem;
    margin-left: auto;
}

.mobile-lang-list {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.mobile-lang-list.is-open {
    display: flex;
}

.mobile-lang-link {
    display: block;
    padding: 0.7rem 2rem;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid var(--color-border);
}

.mobile-lang-link:last-child {
    border-bottom: none;
}

.mobile-lang-link:hover {
    color: var(--color-text);
}

.mobile-lang-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
    }

    .nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 6rem 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .generators {
        padding: 0 2rem 8rem 2rem;
        border-top: none;
    }

    .generator-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .generator-card {
        border-radius: 8px;
        background-color: var(--color-bg-light);
    }

    .generator-card p {
        display: none;
    }

    .generator-card-text {
        padding: 0.75rem;
    }

    .generator-card h3 {
        font-family: inherit;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--color-text);
        margin: 0;
    }

    .generator-img {
        aspect-ratio: auto;
        height: 72px;
        background-color: var(--color-bg-light);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .generator-img img {
        width: auto;
        height: 100%;
        object-fit: contain;
    }

    .page-content {
        padding: 2rem 1.5rem;
    }

    /* モバイル: ダウンロードページボタンを縦並び */
    .download-page .btn {
        display: block;
        margin-bottom: 0.5rem;
    }

    .download-page .btn-secondary {
        margin-left: 0;
    }
}

/* Download Page */
.download-page {
    text-align: center;
}

.tag-page {
    text-align: center;
}

.tag-page-footer {
    margin-top: -3rem;
    padding-bottom: 3rem;
}

.success-icon {
    color: var(--color-primary);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.download-message {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.download-page .form-info {
    text-align: left;
    margin-bottom: 2rem;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    margin-left: 0.5rem;
}

.btn-secondary:hover {
    background-color: var(--color-bg-light);
    border-color: var(--color-primary-hover);
    color: var(--color-primary-hover);
}

.manual-download {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.manual-download a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.manual-download a:hover {
    text-decoration: underline;
}

/* Disclaimer */
footer .disclaimer {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* License Page */
.doc-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.doc-content h1 {
    font-family: 'Rampart One', "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    color: var(--color-primary);
}

.doc-section {
    margin-bottom: 3rem;
}

.doc-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.doc-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.doc-section h4 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.doc-section a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.doc-section a:hover {
    text-decoration: underline;
}

.doc-section-last {
    margin-bottom: 0;
}

.doc-last-updated {
    text-align: right;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.doc-box {
    border-radius: 8px;
    padding: 1.5rem;
    background-color: var(--color-bg-light);
    margin-bottom: 1.5rem;
}

.doc-box-primary {
    background-color: rgba(0, 179, 144, 0.05);
}

.doc-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

.doc-list li {
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.doc-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1rem;
}

.doc-list-prohibited li::before {
    content: "✗";
    color: #ef4444;
}

.code-block {
    background-color: #f3f4f6;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border-radius: 4px;
}

.code-block p {
    margin: 0;
    line-height: 1.5;
}

.code-block code {
    background-color: #e5e7eb;
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
    font-size: 0.85em;
}

.note {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: 0.75rem;
}

.contact-box {
    background-color: #fffae5;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.contact-box h3 {
    margin-top: 0;
    color: #92400e;
}

.contact-box p {
    margin-bottom: 0.75rem;
}

.definition-list ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.definition-list li {
    margin-bottom: 0.5rem;
}

.contact-links {
    margin-top: 1rem;
}

.contact-links p {
    margin-bottom: 0.5rem;
}

.contact-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-links a:hover {
    text-decoration: underline;
}

.changelog-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.changelog-table th {
    background-color: var(--color-bg-light);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.changelog-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.changelog-table tr:last-child td {
    border-bottom: none;
}

.changelog-table tr:hover {
    background-color: rgba(0, 179, 144, 0.02);
}

/* Responsive Doc Pages */
@media (max-width: 768px) {
    .doc-content {
        padding: 2rem 1rem;
    }

    .doc-content h1 {
        font-size: 1.5rem;
    }

    .doc-section h2 {
        font-size: 1.2rem;
    }

    .doc-box {
        padding: 1rem;
    }

    .code-block {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* ===== ローディングオーバーレイ ===== */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(215, 215, 215, 0.5);
    backdrop-filter: blur(1.6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.25rem;
    pointer-events: none;
}

.loading-overlay.is-active {
    display: flex;
    pointer-events: auto;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 6px solid transparent;
    border-top-color: rgba(0, 179, 144, 0.6);
    border-right-color: rgba(0, 179, 144, 0.6);
    border-radius: 50%;
    animation: loading-spin 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
    box-shadow: 0 0 60px rgba(0, 179, 144, 0.5);
}

.loading-spinner::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 3px solid transparent;
    border-bottom-color: rgba(0, 179, 144, 0.5);
    border-left-color: rgba(0, 179, 144, 0.5);
    border-radius: 50%;
    animation: loading-spin-reverse 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
    opacity: 0.6;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

@keyframes loading-spin-reverse {
    to { transform: rotate(-360deg); }
}

.loading-text {
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-top: 2rem;
    animation: loading-breathe 0.7s ease-in-out infinite;
}

@keyframes loading-breathe {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.03);
    }
}

/* 3D viewer */
.viewer-section {
    margin: 2rem 0 1rem;
    overflow: hidden;
    background-color: #1a1a2e;
    position: relative;
}

.viewer-canvas {
    width: 100%;
    height: 360px;
    display: block;
    touch-action: none;
}

.viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #1a1a2e;
    color: #d1d5db;
    font-size: 0.95rem;
}

.viewer-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00b390;
    border-radius: 50%;
    animation: viewer-spin 0.8s linear infinite;
}

.viewer-error-msg {
    padding: 2rem;
    text-align: center;
    color: #d1d5db;
    font-size: 0.95rem;
}

.viewer-hints {
    display: none;
    gap: 1.5rem;
    justify-content: right;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: -1.2rem;
    margin-bottom: 2rem;
}

@keyframes viewer-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .viewer-canvas {
        height: 260px;
    }

    .viewer-hints {
        gap: 1rem;
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
}

/* ===== タグ・関連機能セクション ===== */
.related-section {
    max-width: 640px;
    margin: 3rem auto 2rem;
    border-top: 2px solid var(--color-border);
    padding-top: 2rem;
    text-align: left;
}

.tags-section {
    margin-bottom: 2rem;
}

.tags-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-chip {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-chip:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 179, 144, 0.2);
}

.related-features-section {
    margin-top: 2rem;
}

.related-features-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.related-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    padding: 0.85rem;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
    min-height: 0;
}

.related-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 179, 144, 0.15);
    transform: translateY(-2px);
}

.related-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    margin-bottom: 0.5rem;
}

.related-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.related-card-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.related-card-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
    text-align: center;
    margin: 0;
}

.no-related {
    padding: 2rem;
    text-align: center;
    background-color: var(--color-bg-light);
    border-radius: 8px;
    color: var(--color-text-light);
}

@media (max-width: 768px) {
    .related-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .related-card {
        padding: 0.75rem;
        min-height: 0;
    }

    .related-card-image {
        height: 72px;
        margin-bottom: 0.45rem;
    }

    .related-card-content h4 {
        font-size: 0.82rem;
    }

    .tags {
        gap: 0.5rem;
    }

    .tag-chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* ================================================
   フィードバックウィジェット
   ================================================ */

#fbw-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: var(--color-primary);
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 14px 8px;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.05em;
    box-shadow: -2px 2px 8px rgba(0,0,0,.18);
    transition: background .2s;
}
#fbw-tab:hover { background: var(--color-primary-hover); }

#fbw-panel {
    position: fixed;
    right: -340px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    width: 320px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 4px 20px rgba(0,0,0,.15);
    padding: 20px;
    transition: right .3s ease;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}
#fbw-panel.fbw-open { right: 0; }

.fbw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.fbw-header h3 {
    margin: 0;
    font-size: 15px;
    color: var(--color-text);
}
#fbw-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-text-light);
    line-height: 1;
    padding: 0 2px;
}
#fbw-close:hover { color: var(--color-text); }

.fbw-radio-group {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.fbw-radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    cursor: pointer;
    color: var(--color-text);
}

.fbw-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 5px;
}
#fbw-body {
    width: 100%;
    height: 110px;
    resize: vertical;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    box-sizing: border-box;
    font-family: inherit;
    color: var(--color-text);
    line-height: 1.5;
}
#fbw-body:focus { outline: 2px solid var(--color-primary); border-color: transparent; }

.fbw-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 3px;
    margin-bottom: 12px;
}
.fbw-char-count.fbw-over { color: #e53e3e; }

#fbw-submit {
    width: 100%;
    padding: 10px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
#fbw-submit:hover:not(:disabled) { background: var(--color-primary-hover); }
#fbw-submit:disabled { opacity: .6; cursor: not-allowed; }

#fbw-msg {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}
#fbw-msg.fbw-success { color: var(--color-primary); }
#fbw-msg.fbw-error   { color: #e53e3e; }

