<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
    <title>토이스 - 오늘의 이슈와 최신 트렌드 한눈에</title>

    <!-- PWA Meta Tags -->
    <meta name="theme-color" content="#03c75a" />
    <meta name="description" content="주요 한국 커뮤니티에서 실시간 핫이슈와 핫딜을 자동으로 수집하고, AI가 매일 주요 이슈를 요약해드립니다." />
    <meta name="keywords" content="투데이이슈, today issue, 최신뉴스, 실시간이슈, 트렌드뉴스, 핫이슈, 사회이슈, 경제이슈, IT뉴스, 테크뉴스, AI트렌드, 스타트업뉴스, 주식정보, 투자정보, 부동산뉴스, 정책이슈, 정부정책, 생활정보, 라이프스타일, 리뷰, 정보공유, 이슈정리, 뉴스요약, 빠른뉴스, 한국뉴스, 글로벌이슈, SNS트렌드, 인기검색어, 오늘의이슈, toiss, 커뮤니티, 이슈, 핫이슈, 미러, 뉴스, 소식, AI" />
    <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
    <meta name="googlebot" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
    <!-- canonical은 각 페이지 JS(Layout.tsx updateCanonical)에서 동적으로 주입됩니다 -->
    <link rel="canonical" href="https://toiss.kr/" />
    <link rel="manifest" href="/manifest.json" />
    <link rel="preconnect" href="https://api.toiss.kr" crossorigin />
    <link rel="dns-prefetch" href="https://api.toiss.kr" />
    <link rel="preconnect" href="https://cdn.toiss.kr" crossorigin />
    <link rel="dns-prefetch" href="https://cdn.toiss.kr" />

    <!-- PWA Meta Tags for mobile -->
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="default" />
    <meta name="apple-mobile-web-app-title" content="토이스" />
    <link rel="apple-touch-icon" href="/icons/icon-192x192.svg" />

    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="토이스 - 오늘의 이슈와 최신 트렌드 한눈에" />
    <meta property="og:site_name" content="토이스" />
    <meta property="og:description" content="주요 한국 커뮤니티에서 실시간 핫이슈와 핫딜을 자동으로 수집하고, AI가 매일 주요 이슈를 요약해드립니다." />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://toiss.kr" />
    <meta property="og:image" content="/og-image.png" />
    <meta property="og:locale" content="ko_KR" />
    <meta name="twitter:card" content="summary_large_image" />

    <meta name="naver-site-verification" content="5ca9aa6b8a7be9a9fe38e57f9ec3c45ce8b8b1cb" />
    <meta name="google-adsense-account" content="ca-pub-3337048763256924">

    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-TT2VL6T4J3"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-TT2VL6T4J3');
    </script>

    <!-- Google Tag Manager (data-cfasync=false: Cloudflare Rocket Loader 제외 — dataLayer race 방지) -->
    <script data-cfasync="false">window.dataLayer=window.dataLayer||[];window.dataLayer.push({'gtm.start':new Date().getTime(),event:'gtm.js'});window.addEventListener('load',function(){window.setTimeout(function(){var f=document.getElementsByTagName('script')[0],j=document.createElement('script');j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id=GTM-P9XBMBP2';f.parentNode.insertBefore(j,f);},120000);},{once:true});</script>
    <!-- Pretendard Variable dynamic-subset preload: only the highest-hit subset is warmed up.
         The remaining unicode-range subsets are fetched on demand by CSS to avoid font
         preloads occupying the first-view request queue. -->
    <!-- 로고는 SVG path 기반으로 렌더링 (별도 로고 웹폰트 로드 없음) -->

    <!-- JSON-LD Organization 구조화 데이터 -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "name": "토이스",
      "alternateName": "toiss",
      "url": "https://toiss.kr",
      "description": "주요 한국 커뮤니티에서 실시간 핫이슈와 핫딜을 자동으로 수집하고, AI가 매일 주요 이슈를 요약해드립니다.",
      "inLanguage": "ko-KR",
      "publisher": {
        "@type": "Organization",
        "name": "토이스",
        "url": "https://toiss.kr",
        "logo": {
          "@type": "ImageObject",
          "url": "https://toiss.kr/icons/icon-192x192.svg"
        }
      }
    }
    </script>
    <link rel="modulepreload" data-cfasync="false" crossorigin href="/assets/react-vendor-1Gbrf-nj.js">
    <link rel="modulepreload" data-cfasync="false" crossorigin href="/assets/ui-vendor-BqmdS6SR.js">
    <link rel="modulepreload" data-cfasync="false" crossorigin href="/assets/swr-vendor-P1Cud2Qp.js">
    <link rel="modulepreload" data-cfasync="false" crossorigin href="/assets/router-vendor-CH1a82mr.js">
    <link rel="modulepreload" data-cfasync="false" crossorigin href="/assets/icons-vendor-GZx7gRvl.js">
    <link rel="modulepreload" data-cfasync="false" data-toiss-route-preload="detail" crossorigin href="/assets/DetailPage-Dj-UpTg3.js">
<link rel="modulepreload" data-cfasync="false" data-toiss-route-preload="detail" crossorigin href="/assets/purify.es-Bc-0F0ao.js">
<script type="module" data-cfasync="false" crossorigin src="/assets/index-DzQIhhhS.js"></script>
    <link rel="stylesheet" data-cfasync="false" crossorigin href="/assets/index-FwJea3HB.css">
  </head>
  <body class="bg-white">
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P9XBMBP2" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <script>
      (function () {
        var patterns = [
          'Failed to fetch dynamically imported module',
          'Importing a module script failed',
          'is not a valid JavaScript MIME type',
          'error loading dynamically imported module',
          'does not provide an export named',
          'The requested module'
        ];
        var flag = 'toiss-stale-chunk-reloaded-v3';
        function messageOf(value) {
          if (!value) return '';
          if (typeof value === 'string') return value;
          return String(value.message || value.error?.message || value.reason?.message || value.reason || value);
        }
        function isStaleModuleError(message) {
          return patterns.some(function (pattern) { return message.indexOf(pattern) !== -1; });
        }
        async function clearRuntimeCaches() {
          try {
            if ('serviceWorker' in navigator) {
              var regs = await navigator.serviceWorker.getRegistrations();
              await Promise.all(regs.map(function (reg) { return reg.unregister().catch(function () {}); }));
            }
          } catch (e) {}
          try {
            if ('caches' in window) {
              var keys = await caches.keys();
              await Promise.all(keys.map(function (key) { return caches.delete(key).catch(function () {}); }));
            }
          } catch (e) {}
        }
        function recover(event) {
          var message = messageOf(event);
          if (!isStaleModuleError(message) || sessionStorage.getItem(flag)) return;
          sessionStorage.setItem(flag, '1');
          clearRuntimeCaches().finally(function () {
            var url = new URL(window.location.href);
            url.searchParams.set('_r', String(Date.now()));
            window.location.replace(url.toString());
          });
        }
        window.addEventListener('error', recover, true);
        window.addEventListener('unhandledrejection', recover, true);
        window.addEventListener('load', function () {
          window.setTimeout(function () { sessionStorage.removeItem(flag); }, 1500);
        });
      })();
    </script>
    <script data-cfasync="false">
      (function () {
        var path = window.location.pathname;
        var endpoint = null;
        if (path === '/' || path === '/posts/tags' || path === '/posts/community-rankings') {
          endpoint = '/api/bootstrap/home';
        } else if (path === '/deal' || path === '/deal/') {
          endpoint = '/api/deals?limit=30&sortBy=createdAt&sortOrder=desc';
        } else if (path === '/issue' || path === '/issue/') {
          endpoint = '/api/bootstrap/issue?page=1&limit=10';
        } else {
          var detail = path.match(/^\/issue\/(\d{1,7})\/?$/);
          if (detail) endpoint = '/api/bootstrap/issue/' + Number(detail[1]) + '?limit=30';
        }
        if (!endpoint) return;
        window.__TOISS_BOOTSTRAP_ENDPOINT = endpoint;
        window.__TOISS_BOOTSTRAP_PROMISE = new Promise(function (resolve) {
          window.setTimeout(function () {
            if (window.__TOISS_STATIC_BOOTSTRAP_ENDPOINT === endpoint && window.__TOISS_STATIC_BOOTSTRAP) {
              resolve(window.__TOISS_STATIC_BOOTSTRAP);
              return;
            }
            fetch(endpoint, {
              credentials: 'same-origin',
              headers: { 'Accept': 'application/json' }
            }).then(function (res) {
              return res.ok ? res.json() : null;
            }).then(function (payload) {
              window.__TOISS_STATIC_BOOTSTRAP_ENDPOINT = endpoint;
              window.__TOISS_STATIC_BOOTSTRAP = payload;
              try {
                if (payload && payload.route === 'issue' && payload.issueList && Array.isArray(payload.issueList.posts)) {
                  sessionStorage.setItem('toiss:issue-list-preview:v1', JSON.stringify({
                    savedAt: Date.now(),
                    posts: payload.issueList.posts.slice(0, 60)
                  }));
                }
              } catch (e) {}
              resolve(payload);
            }).catch(function () {
              resolve(null);
            });
          }, 0);
        });
      })();
    </script>
    <div id="root"></div>
    <script data-cfasync="false">
      (function () {
        var path = window.location.pathname;
        var endpoint = window.__TOISS_BOOTSTRAP_ENDPOINT || null;
        if (!endpoint) {
          if (path === '/issue' || path === '/issue/') endpoint = '/api/bootstrap/issue?page=1&limit=10';
          if (path === '/deal' || path === '/deal/') endpoint = '/api/deals?limit=30&sortBy=createdAt&sortOrder=desc';
        }
        if (!endpoint || !/^(\/issue\/?$|\/deal\/?$)/.test(path)) return;

        function escapeHtml(value) {
          return String(value || '').replace(/[&<>"']/g, function (ch) {
            return ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[ch];
          });
        }
        function isRootStillBlank(root) {
          if (!root || root.querySelector('[data-toiss-boot-fallback]')) return false;
          if (root.querySelector('a,button,img,[data-perf-ready]')) return false;
          return (root.textContent || '').trim().length < 5;
        }
        function postHref(item, route) {
          var id = item && (item.issueIdx || item.dealIdx || item.idx || item.redirectId || item._id);
          if (!id) return route;
          return route === 'deal' ? '/deal/' + encodeURIComponent(id) : '/issue/' + encodeURIComponent(id);
        }
        function imageOf(item) {
          var candidates = [item && item.thumbnailUrl, item && item.imageUrl, item && item.thumbnail];
          if (item && Array.isArray(item.images)) candidates = candidates.concat(item.images);
          for (var i = 0; i < candidates.length; i += 1) {
            var raw = candidates[i];
            if (!raw) continue;
            try {
              var url = new URL(String(raw), window.location.origin);
              if (/^\/(?:images|media)\//i.test(url.pathname)) return 'https://api.toiss.kr' + url.pathname + url.search;
              if (/^(api|cdn|media)\.toiss\.kr$/i.test(url.hostname)) {
                url.protocol = 'https:';
                if (/^(cdn|media)\.toiss\.kr$/i.test(url.hostname)) url.hostname = 'api.toiss.kr';
                return url.toString();
              }
            } catch (e) {}
          }
          return '';
        }
        function rowsFromPayload(payload) {
          if (!payload) return [];
          if (payload.issueList && Array.isArray(payload.issueList.posts)) return payload.issueList.posts;
          if (Array.isArray(payload.deals)) return payload.deals;
          if (Array.isArray(payload.posts)) return payload.posts;
          return [];
        }
        function renderFallback(payload) {
          var root = document.getElementById('root');
          if (!isRootStillBlank(root)) return;
          var route = path.indexOf('/deal') === 0 ? 'deal' : 'issue';
          var rows = rowsFromPayload(payload).slice(0, route === 'deal' ? 20 : 30);
          if (!rows.length) return;
          var html = ''
            + '<main data-toiss-boot-fallback style="max-width:960px;margin:0 auto;padding:16px;font-family:system-ui,-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,sans-serif;color:#111827;background:#fff;">'
            + '<nav style="display:flex;gap:12px;margin:0 0 16px;font-size:14px;"><a href="/" style="color:#2563eb;text-decoration:none;">Home</a><a href="/issue" style="color:#2563eb;text-decoration:none;">Issue</a><a href="/deal" style="color:#2563eb;text-decoration:none;">Deal</a></nav>'
            + '<h1 style="margin:0 0 14px;font-size:22px;line-height:1.3;">' + (route === 'deal' ? 'Deal' : 'Issue') + '</h1>'
            + '<div style="display:grid;gap:0;border-top:2px solid #111827;">';
          rows.forEach(function (item) {
            var title = escapeHtml(item && item.title || '');
            if (!title) return;
            var img = route === 'deal' ? imageOf(item) : '';
            html += '<a href="' + escapeHtml(postHref(item, route)) + '" style="display:flex;align-items:center;gap:12px;padding:11px 2px;border-bottom:1px solid #e5e7eb;color:#111827;text-decoration:none;">'
              + (img ? '<img src="' + escapeHtml(img) + '" alt="" loading="lazy" decoding="async" style="width:64px;height:64px;object-fit:cover;border-radius:6px;background:#f3f4f6;flex:0 0 auto;" />' : '')
              + '<span style="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;">' + title + '</span>'
              + '</a>';
          });
          root.innerHTML = html + '</div></main>';
        }
        function fetchFallback() {
          var promise = window.__TOISS_BOOTSTRAP_PROMISE || fetch(endpoint, {
            credentials: 'same-origin',
            headers: { 'Accept': 'application/json' }
          }).then(function (res) { return res.ok ? res.json() : null; }).catch(function () { return null; });
          Promise.resolve(promise).then(renderFallback).catch(function () {});
        }
        window.setTimeout(fetchFallback, 2800);
      })();
    </script>
  </body>
</html>
