/* EyeCon — スタイルシート */
:root {
    color-scheme: light dark;

    /* ダークテーマ（デフォルト） */
    --color-bg: #1a1a2e;
    --color-surface: #16213e;
    --color-surface-2: #1e1e3a;
    --color-text: #e0e0e0;
    --color-text-muted: #aaa;
    --color-text-dim: #888;
    --color-text-faint: #666;
    --color-border: #0f3460;

    --color-accent: #e94560;
    --color-accent-hover: #c73a52;
    --color-accent-text: #fff;

    --color-disabled-bg: #444;
    --color-disabled-text: #777;

    --color-success-bg: #1b5e20;
    --color-success-text: #a5d6a7;
    --color-warning-bg: #e65100;
    --color-warning-text: #ffcc80;
    --color-neutral-bg: #333;
    --color-neutral-text: #888;

    --color-danger-bg: #8b0000;
    --color-danger-text: #fff;

    --color-link: #4fc3f7;
    --color-log-bg: #111;
    --color-log-text: #999;
}

@media (prefers-color-scheme: light) {
    :root {
        --color-bg: #f5f5f8;
        --color-surface: #fff;
        --color-surface-2: #f0f0f4;
        --color-text: #1a1a2e;
        --color-text-muted: #555;
        --color-text-dim: #777;
        --color-text-faint: #aaa;
        --color-border: #d0d0d8;

        --color-accent: #d63a55;
        --color-accent-hover: #b8304a;
        --color-accent-text: #fff;

        --color-disabled-bg: #ddd;
        --color-disabled-text: #999;

        --color-success-bg: #c8e6c9;
        --color-success-text: #1b5e20;
        --color-warning-bg: #fff3e0;
        --color-warning-text: #e65100;
        --color-neutral-bg: #e0e0e0;
        --color-neutral-text: #777;

        --color-danger-bg: #c62828;
        --color-danger-text: #fff;

        --color-link: #1565c0;
        --color-log-bg: #f0f0f0;
        --color-log-text: #555;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--color-surface) 78%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.amazon-associate {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.5);
    margin: 0;
    text-align: right;
    line-height: 1.3;
}

.home-link,
.site-title-link {
    color: var(--color-text);
    text-decoration: none;
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.home-link:hover,
.site-title-link:hover {
    color: var(--color-link);
}

.home-link:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.site-title-link {
    font-size: 14px;
    font-weight: 700;
}

.page-shell {
    width: min(600px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 32px;
    flex: 1;
}

h1 { font-size: 20px; color: var(--color-accent); margin-bottom: 4px; }
.subtitle { font-size: 12px; color: var(--color-text-faint); margin-bottom: 20px; }
.text-muted { font-size: 12px; color: var(--color-text-muted); }
.text-hint { font-size: 11px; color: var(--color-text-dim); }

.section {
    background: var(--color-surface); border-radius: 8px; padding: 16px;
    margin-bottom: 12px; border: 1px solid var(--color-border);
}
.section-title {
    font-size: 12px; text-transform: uppercase;
    color: var(--color-text-dim); margin-bottom: 10px;
}

.compatibility-note {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-2);
}

.compatibility-note__title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
}

.compatibility-note__list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.compatibility-note__list li + li {
    margin-top: 4px;
}

.btn {
    padding: 8px 16px; border: none; border-radius: 5px;
    font-size: 13px; cursor: pointer; transition: 0.15s;
}
.btn-primary { background: var(--color-accent); color: var(--color-accent-text); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled { background: var(--color-disabled-bg); color: var(--color-disabled-text); cursor: default; }
.btn-secondary {
    background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-accent); }
.btn-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: bold;
}
.badge-ok { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-warn { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-off { background: var(--color-neutral-bg); color: var(--color-neutral-text); }

.row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.row + .row { margin-top: 8px; }
.hidden { display: none !important; }

/* 完了メッセージ */
.done-box {
    text-align: center; padding: 16px;
}
.done-icon { font-size: 48px; margin-bottom: 8px; }
.done-title {
    font-size: 18px; font-weight: bold; color: var(--color-success-text); margin-bottom: 8px;
}
.done-box p { font-size: 13px; color: var(--color-text-muted); line-height: 1.6; }
.done-hint { margin-top: 8px; }

.section-row-head { justify-content: space-between; }
.section-title-inline { margin-bottom: 0; }
.log-panel { margin-top: 8px; }

/* ログ */
#log {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 11px; color: var(--color-log-text); background: var(--color-log-bg);
    padding: 8px; border-radius: 4px;
    max-height: 200px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-all;
}

/* 関連製品グリッド */
.product-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.product-card {
    display: block; padding: 12px; border-radius: 6px;
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    text-decoration: none; color: var(--color-text); transition: 0.15s;
}
.product-card:hover {
    border-color: var(--color-accent); background: var(--color-bg);
}
.product-name {
    display: block; font-size: 13px; font-weight: bold;
    color: var(--color-link); margin-bottom: 2px;
}
.product-desc {
    display: block; font-size: 11px; color: var(--color-text-dim);
}

/* モーダル */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); display: flex;
    align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 24px; max-width: 400px;
    text-align: center;
}
.modal-icon { font-size: 48px; margin-bottom: 8px; }
.modal-title {
    font-size: 16px; font-weight: bold; color: var(--color-text);
    margin-bottom: 12px;
}
.modal-box p {
    font-size: 13px; color: var(--color-text-muted); line-height: 1.6;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.modal-product {
    margin: 16px 0; padding: 12px; border-radius: 8px;
    background: var(--color-bg); border: 1px solid var(--color-border);
}
.modal-product-label {
    font-size: 11px; color: var(--color-text-dim); margin-bottom: 8px;
}
.modal-product .product-card { margin-bottom: 8px; }
.modal-product .affiliate-disclosure { margin-top: 8px; text-align: center; }

::selection { background: var(--color-accent); color: var(--color-accent-text); }

@media (max-width: 640px) {
    .site-header__inner {
        align-items: flex-start;
        gap: 10px;
    }

    .amazon-associate {
        max-width: 180px;
    }

    .page-shell {
        width: calc(100% - 24px);
    }

    .site-header {
        padding: 12px;
    }
}
