:root {
  color-scheme: light dark;
  --bg: #eef0f5;
  --surface: rgba(255,255,255,0.86);
  --surface-hover: rgba(255,255,255,0.94);
  --surface-soft: rgba(255,255,255,0.64);
  --text: #1b1c2e;
  --muted: #7a7b8c;
  --line: rgba(0,0,0,0.08);
  --accent: #6366f1;
  --accent-2: #a855f7;
  --glow: rgba(99,102,241,0.12);
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --star-bg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20300%22%20width%3D%22300%22%20height%3D%22300%22%3E%3Cstyle%3E.p%7Bfill%3Anone%3Bstroke%3Argba%2899%2C102%2C241%2C0.18%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.s%7Bfill%3Anone%3Bstroke%3Argba%28168%2C85%2C247%2C0.14%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.d%7Bfill%3Argba%2899%2C102%2C241%2C0.14%29%3B%7D%3C/style%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.5%202.2%20A7.2%206.8%200%201%200%2015.8%2013.8%20A6.2%206.2%200%201%201%208.5%202.2%20Z%22%20transform%3D%22translate%2830%2C%2040%29%20scale%281.2%29%20rotate%28-10%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28120%2C%2070%29%20scale%280.9%29%20rotate%2815%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28240%2C%2050%29%20scale%280.75%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%2870%2C%20150%29%20scale%280.8%29%22%20/%3E%3Cpath%20class%20%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28220%2C%20160%29%20scale%281.1%29%20rotate%28-20%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28130%2C%20220%29%20rotate%2840%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%2840%2C%20250%29%20scale%280.85%29%20rotate%2845%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%28250%2C%20260%29%20scale%280.9%29%20rotate%2812%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2890%2C%2090%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%2030%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28280%2C%20120%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28170%2C%20110%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2820%2C%20200%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28290%2C%20210%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2880%2C%20280%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%20280%29%22%20/%3E%3C/svg%3E");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d16;
    --surface: rgba(18,19,31,0.90);
    --surface-hover: rgba(24,25,40,0.96);
    --surface-soft: rgba(24,25,40,0.72);
    --text: #e8e9f0;
    --muted: #8a8b9a;
    --line: rgba(255,255,255,0.07);
    --glow: rgba(129,140,248,0.12);
    --star-bg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20300%22%20width%3D%22300%22%20height%3D%22300%22%3E%3Cstyle%3E.p%7Bfill%3Anone%3Bstroke%3Argba%28129%2C140%2C248%2C0.22%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.s%7Bfill%3Anone%3Bstroke%3Argba%28192%2C132%2C252%2C0.18%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.d%7Bfill%3Argba%28129%2C140%2C248%2C0.18%29%3B%7D%3C/style%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.5%202.2%20A7.2%206.8%200%201%200%2015.8%2013.8%20A6.2%206.2%200%201%201%208.5%202.2%20Z%22%20transform%3D%22translate%2830%2C%2040%29%20scale%281.2%29%20rotate%28-10%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28120%2C%2070%29%20scale%280.9%29%20rotate%2815%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28240%2C%2050%29%20scale%280.75%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%2870%2C%20150%29%20scale%280.8%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28220%2C%20160%29%20scale%281.1%29%20rotate%28-20%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28130%2C%20220%29%20rotate%2840%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%2840%2C%20250%29%20scale%280.85%29%20rotate%2845%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%28250%2C%20260%29%20scale%280.9%29%20rotate%2812%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2890%2C%2090%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%2030%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28280%2C%20120%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28170%2C%20110%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2820%2C%20200%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28290%2C%20210%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2880%2C%20280%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%20280%29%22%20/%3E%3C/svg%3E");
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f5;
  --surface: rgba(255,255,255,0.86);
  --surface-hover: rgba(255,255,255,0.94);
  --surface-soft: rgba(255,255,255,0.64);
  --text: #1b1c2e;
  --muted: #7a7b8c;
  --line: rgba(0,0,0,0.08);
  --accent: #6366f1;
  --accent-2: #a855f7;
  --glow: rgba(99,102,241,0.12);
  --star-bg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20300%22%20width%3D%22300%22%20height%3D%22300%22%3E%3Cstyle%3E.p%7Bfill%3Anone%3Bstroke%3Argba%2899%2C102%2C241%2C0.18%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.s%7Bfill%3Anone%3Bstroke%3Argba%28168%2C85%2C247%2C0.14%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.d%7Bfill%3Argba%2899%2C102%2C241%2C0.14%29%3B%7D%3C/style%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.5%202.2%20A7.2%206.8%200%201%200%2015.8%2013.8%20A6.2%206.2%200%201%201%208.5%202.2%20Z%22%20transform%3D%22translate%2830%2C%2040%29%20scale%281.2%29%20rotate%28-10%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28120%2C%2070%29%20scale%280.9%29%20rotate%2815%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28240%2C%2050%29%20scale%280.75%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%2870%2C%20150%29%20scale%280.8%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28220%2C%20160%29%20scale%281.1%29%20rotate%28-20%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28130%2C%20220%29%20rotate%2840%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%2840%2C%20250%29%20scale%280.85%29%20rotate%2845%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%28250%2C%20260%29%20scale%280.9%29%20rotate%2812%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2890%2C%2090%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%2030%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28280%2C%20120%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28170%2C%20110%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2820%2C%20200%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28290%2C%20210%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2880%2C%20280%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%20280%29%22%20/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d16;
  --surface: rgba(18,19,31,0.90);
  --surface-hover: rgba(24,25,40,0.96);
  --surface-soft: rgba(24,25,40,0.72);
  --text: #e8e9f0;
  --muted: #8a8b9a;
  --line: rgba(255,255,255,0.07);
  --accent: #818cf8;
  --accent-2: #c084fc;
  --glow: rgba(129,140,248,0.12);
  --star-bg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20300%22%20width%3D%22300%22%20height%3D%22300%22%3E%3Cstyle%3E.p%7Bfill%3Anone%3Bstroke%3Argba%28129%2C140%2C248%2C0.22%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.s%7Bfill%3Anone%3Bstroke%3Argba%28192%2C132%2C252%2C0.18%29%3Bstroke-width%3A1.5%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3B%7D.d%7Bfill%3Argba%28129%2C140%2C248%2C0.18%29%3B%7D%3C/style%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.5%202.2%20A7.2%206.8%200%201%200%2015.8%2013.8%20A6.2%206.2%200%201%201%208.5%202.2%20Z%22%20transform%3D%22translate%2830%2C%2040%29%20scale%281.2%29%20rotate%28-10%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28120%2C%2070%29%20scale%280.9%29%20rotate%2815%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28240%2C%2050%29%20scale%280.75%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%2870%2C%20150%29%20scale%280.8%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%28220%2C%20160%29%20scale%281.1%29%20rotate%28-20%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M12.5%201.5%20C12.2%208.8%209.8%209.5%2018.5%2010.2%20C11.2%2010.8%2010.5%2010.2%209.8%2018.5%20C9.5%2011.2%208.8%2010.5%201.5%209.8%20C8.8%209.5%209.8%208.2%2012.5%201.5%20Z%22%20transform%3D%22translate%28130%2C%20220%29%20rotate%2840%29%22%20/%3E%3Cpath%20class%3D%22s%22%20d%3D%22M12.5%201.8%20L15.2%208.2%20L22.5%208.8%20L16.8%2013.5%20L18.2%2020.8%20L12.2%2016.5%20L6.2%2020.5%20L7.8%2013.8%20L2.5%209.2%20L9.5%208.5%20Z%22%20transform%3D%22translate%2840%2C%20250%29%20scale%280.85%29%20rotate%2845%29%22%20/%3E%3Cpath%20class%3D%22p%22%20d%3D%22M8.2%201.8%20L7.8%2014.2%20M1.8%207.8%20L14.2%208.2%22%20transform%3D%22translate%28250%2C%20260%29%20scale%280.9%29%20rotate%2812%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2890%2C%2090%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%2030%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28280%2C%20120%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28170%2C%20110%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2820%2C%20200%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28290%2C%20210%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%2880%2C%20280%29%22%20/%3E%3Cpath%20class%3D%22d%22%20d%3D%22M3%203%20A1%201%200%201%201%202.9%203%20Z%22%20transform%3D%22translate%28180%2C%20280%29%22%20/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    /* deep-space nebula blobs */
    radial-gradient(ellipse 90% 55% at 20% 15%, rgba(99,102,241,0.10), transparent 55%),
    radial-gradient(ellipse 70% 45% at 80% 30%, rgba(168,85,247,0.08), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 75%, rgba(99,102,241,0.06), transparent 55%),
    radial-gradient(ellipse 45% 35% at 60% 50%, rgba(129,140,248,0.05), transparent 50%),
    /* top accent bloom */
    radial-gradient(ellipse 100% 35% at 50% 0%, rgba(99,102,241,0.06), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
  ═══════════════════════════════════════════
  COSMIC STARFIELD — 「阿涛的工具宇宙」
  ═══════════════════════════════════════════
  5-layer procedural starfield inspired by space telescopes.
  Each layer uses coprime grid sizes so the overall
  pattern is aperiodic — no visible tiling.

  Layer  De…  Size   Spacing   Color
  ───── ──── ────── ───────── ──────────
  L1    dust  1px    43px      accent 15%
  L2    ★     3.5px  67px      accent 38%
  L3    ★     3.5px  71px      accent-2 32%
  L4    ★★    5px    127px     accent 36%
  L5    ★★★   7px +  223px     accent 48% + white core
         glow
*/

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;

  background-image: var(--star-bg);
  background-repeat: repeat;
  background-size: 320px 320px;

  mask-image:
    linear-gradient(180deg, #000 8%, rgba(0,0,0,0.82) 35%, rgba(0,0,0,0.28) 68%, transparent 95%);
}

a { color: inherit; text-decoration: none; }

/* ════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(200px, 440px) auto;
  gap: 20px;
  align-items: center;
  margin: 0 auto;
  width: min(1240px, calc(100% - 48px));
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px var(--glow);
}

/* ── Search ── */

.search { position: relative; display: block; }

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px 0 42px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
}

.search input::placeholder { color: var(--muted); }

.search input:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 4px var(--glow);
}

/* ── Top buttons ── */

.top-actions {
  display: inline-flex;
  justify-self: end;
  gap: 8px;
}

.top-action {
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-action:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 4px 16px var(--glow);
  transform: translateY(-1px);
}

.top-action.primary-action {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--glow);
}
.top-action.primary-action:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, var(--accent-2) 30%);
  transform: translateY(-1.5px);
}

.btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); box-shadow: 0 4px 16px var(--glow); }
.theme-toggle svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}

/* ════════════════════════════════════════
   SHELL
   ════════════════════════════════════════ */

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 120px;
}

/* ── Hero ── */

.overview {
  display: grid;
  grid-template-columns: minmax(0, 660px) minmax(260px, 340px);
  gap: clamp(32px, 8vw, 100px);
  align-items: center;
  margin-bottom: 44px;
}

h1, h2, p, dl { margin: 0; }

h1 {
  max-width: 580px;
  font-size: clamp(36px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overview p {
  max-width: 540px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

/* ── Metrics ── */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.metrics div {
  min-height: 82px;
  padding: 20px 24px;
  border-left: 1px solid var(--line);
}
.metrics div:first-child { border-left: 0; }

.metrics dt { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.metrics dd { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ── Tabs ── */

.tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 32px;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text); }

.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 650;
  box-shadow: 0 4px 14px var(--glow);
}
.tab.active:hover { color: #fff; }

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  transition: all 0.2s ease;
}

.tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ── Content Grid ── */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

/* ── Section Head ── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
}

.section-head h2 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-head span,
.category-title span {
  color: var(--muted);
  font-size: 13px;
}

/* ── Directory ── */

.directory { display: grid; gap: 36px; }
.category { display: grid; gap: 16px; }

.category-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.category-title h2 {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

/* ════════════════════════════════════════
   CARDS — glass morphism
   ════════════════════════════════════════ */

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

.site-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.site-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--site-accent, var(--accent)) 6%, transparent),
    color-mix(in srgb, var(--site-accent, var(--accent)) 0%, transparent) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.site-card:hover {
  border-color: color-mix(in srgb, var(--site-accent, var(--accent)) 45%, var(--line));
  transform: translateY(-4px);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.08),
    0 0 20px color-mix(in srgb, var(--site-accent, var(--accent)) 20%, transparent);
}
.site-card:hover::after { opacity: 1; }

.site-card.is-updated {
  border-color: color-mix(in srgb, var(--site-accent, var(--accent)) 45%, var(--line));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--site-accent, var(--accent)) 10%, transparent);
}

.site-card.is-down {
  opacity: 0.40;
  filter: grayscale(0.5);
}

.site-card.is-down:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}

.site-card.is-down:hover::after {
  opacity: 0;
}

/* ── Card Icon ── */

.icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--site-accent, var(--accent)) 16%, var(--surface-soft)),
    color-mix(in srgb, var(--site-accent, var(--accent)) 8%, var(--surface-soft)));
  color: var(--site-accent, var(--accent));
  flex-shrink: 0;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--site-accent, var(--accent)) 14%, transparent);
}
.icon svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}

/* ── Card Body ── */

.site-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 22px;
  border-radius: 999px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--site-accent, var(--accent)) 10%, var(--surface-soft));
  color: var(--site-accent, var(--accent));
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  display: inline-block;
}

/* Status dot heartbeat ping animation */
.site-card:not(.is-down) .status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: status-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes status-ping {
  75%, 100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Keyword Highlights */
mark.highlight {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
  font-weight: inherit;
}

.url {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card p {
  min-height: 0;
  max-height: 36px;
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--site-accent, var(--accent));
  box-shadow: 0 0 6px color-mix(in srgb, var(--site-accent, var(--accent)) 30%, transparent);
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.card-action:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--glow);
}

/* ════════════════════════════════════════
   SIDEBAR — glass
   ════════════════════════════════════════ */

.rail {
  position: sticky;
  top: 100px;
}

.panel {
  display: flex;
  max-height: calc(100vh - 140px);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-close { display: none; }
.fab-timeline { display: none; }

.panel h2 { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; margin: 0; }

.panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ── Timeline ── */

.timeline {
  display: grid;
  gap: 0;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.timeline::-webkit-scrollbar { width: 4px; }
.timeline::-webkit-scrollbar-track { background: transparent; }
.timeline::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line); }

.time-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 0 0 20px;
  align-items: start;
  text-decoration: none;
  color: inherit;
}

/* Vertical line centered behind the dot on the left */
.time-item::after {
  content: "";
  position: absolute;
  left: 8px; /* Centered in the 18px column */
  top: 14px;
  bottom: -6px;
  width: 1.5px;
  background: var(--line);
  z-index: 1;
}

.time-item:last-child {
  padding-bottom: 0;
}

.time-item:last-child::after {
  display: none;
}

/* Center column container for the dot */
.time-badge {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: start;
  height: 100%;
  padding-top: 5px;
  z-index: 2;
}

.time-badge::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--site-accent, var(--accent));
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px var(--line),
    0 0 8px color-mix(in srgb, var(--site-accent, var(--accent)) 50%, transparent);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.time-item:hover .time-badge::before {
  transform: scale(1.35);
  background: #fff;
  box-shadow:
    0 0 0 2px var(--site-accent, var(--accent)),
    0 0 12px var(--site-accent, var(--accent));
}

.time-body {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.time-body strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.time-item:hover strong {
  color: var(--site-accent, var(--accent));
}

.time-date {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.time-item.is-updated .time-date {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.15);
}

.time-date.pending {
  background: var(--surface-soft);
  color: var(--muted);
}

.time-details {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Empty ── */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* ════════════════════════════════════════
   OVERVIEW MODAL
   ════════════════════════════════════════ */

.overview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 36px;
}
.overview-modal.open { display: flex; }

.overview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ov-fade 0.2s ease;
}
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }

.overview-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px 24px;
  background: var(--surface);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
  animation: ov-scale 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes ov-scale {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.overview-header h2 { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }

.overview-close {
  display: grid;
  width: 36px; height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.overview-close:hover { background: var(--surface-hover); border-color: var(--accent); }
.overview-close svg { width: 16px; height: 16px; }

/* ── Overview Stats ── */

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.ov-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  text-align: left;
  outline: none;
}

.ov-stat:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--glow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.ov-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--line);
  color: var(--muted);
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.ov-stat-icon svg {
  width: 18px;
  height: 18px;
}

.ov-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Color indicators for non-active states */
.ov-stat[data-filter="all"] .ov-stat-icon {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
}
.ov-stat[data-filter="up"] .ov-stat-icon {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.ov-stat[data-filter="down"] .ov-stat-icon {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.ov-stat[data-filter="updated"] .ov-stat-icon {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

:root[data-theme="dark"] .ov-stat[data-filter="up"] .ov-stat-icon {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
:root[data-theme="dark"] .ov-stat[data-filter="down"] .ov-stat-icon {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
:root[data-theme="dark"] .ov-stat[data-filter="updated"] .ov-stat-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-stat[data-filter="up"] .ov-stat-icon {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="down"] .ov-stat-icon {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="updated"] .ov-stat-icon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
  }
}

.ov-stat.active {
  background: var(--surface);
  transform: translateY(-1px);
}

.ov-stat[data-filter="all"].active {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--glow);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.ov-stat[data-filter="all"].active .ov-stat-icon {
  background: var(--accent);
  color: #fff;
}

.ov-stat[data-filter="up"].active {
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
  background: rgba(16, 185, 129, 0.06);
}
.ov-stat[data-filter="up"].active .ov-stat-icon {
  background: #10b981;
  color: #fff;
}

.ov-stat[data-filter="down"].active {
  border-color: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.06);
}
.ov-stat[data-filter="down"].active .ov-stat-icon {
  background: #ef4444;
  color: #fff;
}

.ov-stat[data-filter="updated"].active {
  border-color: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.06);
}
.ov-stat[data-filter="updated"].active .ov-stat-icon {
  background: #f59e0b;
  color: #fff;
}

:root[data-theme="dark"] .ov-stat[data-filter="up"].active {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}
:root[data-theme="dark"] .ov-stat[data-filter="up"].active .ov-stat-icon {
  background: #34d399;
  color: #111;
}

:root[data-theme="dark"] .ov-stat[data-filter="down"].active {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}
:root[data-theme="dark"] .ov-stat[data-filter="down"].active .ov-stat-icon {
  background: #f87171;
  color: #111;
}

:root[data-theme="dark"] .ov-stat[data-filter="updated"].active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}
:root[data-theme="dark"] .ov-stat[data-filter="updated"].active .ov-stat-icon {
  background: #fbbf24;
  color: #111;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-stat[data-filter="up"].active {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.1);
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="up"].active .ov-stat-icon {
    background: #34d399;
    color: #111;
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="down"].active {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.1);
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="down"].active .ov-stat-icon {
    background: #f87171;
    color: #111;
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="updated"].active {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
  }
  :root:not([data-theme="light"]) .ov-stat[data-filter="updated"].active .ov-stat-icon {
    background: #fbbf24;
    color: #111;
  }
}

.ov-stat-value {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.ov-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.ov-up    { color: #10b981; }
.ov-down  { color: #ef4444; }
.ov-updated { color: #f59e0b; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-up    { color: #34d399; }
  :root:not([data-theme="light"]) .ov-down  { color: #f87171; }
  :root:not([data-theme="light"]) .ov-updated { color: #fbbf24; }
}
:root[data-theme="dark"] .ov-up    { color: #34d399; }
:root[data-theme="dark"] .ov-down  { color: #f87171; }
:root[data-theme="dark"] .ov-updated { color: #fbbf24; }

/* ── Overview Grid ── */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.ov-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--surface-soft);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.ov-error-diagnostic {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-error-diagnostic {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
  }
}
:root[data-theme="dark"] .ov-error-diagnostic {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}
.ov-card:hover {
  border-color: color-mix(in srgb, var(--site-accent, var(--accent)) 35%, var(--line));
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.ov-icon {
  display: grid;
  width: 26px; height: 26px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--site-accent, var(--accent)) 16%, var(--surface-soft)),
    color-mix(in srgb, var(--site-accent, var(--accent)) 6%, var(--surface-soft)));
  color: var(--site-accent, var(--accent));
}
.ov-icon svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}

.ov-body { min-width: 0; }
.ov-body strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-url {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.ov-status.up      { background: rgba(16,185,129,0.12); color: #059669; }
.ov-status.updated { background: rgba(245,158,11,0.12); color: #b45309; }
.ov-status.down    { background: rgba(239,68,68,0.12); color: #dc2626; }
.ov-status.unknown { background: var(--surface-soft); color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ov-status.up      { background: rgba(16,185,129,0.16); color: #6ee7b7; }
  :root:not([data-theme="light"]) .ov-status.updated { background: rgba(245,158,11,0.16); color: #fcd34d; }
  :root:not([data-theme="light"]) .ov-status.down    { background: rgba(239,68,68,0.16); color: #fca5a5; }
}
:root[data-theme="dark"] .ov-status.up      { background: rgba(16,185,129,0.16); color: #6ee7b7; }
:root[data-theme="dark"] .ov-status.updated { background: rgba(245,158,11,0.16); color: #fcd34d; }
:root[data-theme="dark"] .ov-status.down    { background: rgba(239,68,68,0.16); color: #fca5a5; }

.overview-footer {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */

/* ── Medium screens: 3→2 columns ── */
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-card { min-height: 120px; padding: 16px; }
  .site-card h3 { font-size: 14px; }
  .site-card p { font-size: 12px; max-height: 40px; }
}

/* ── Tablet / narrow desktop ── */
@media (max-width: 860px) {
  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    border-radius: 0;
    margin: 0;
    width: 100%;
    padding: 10px 18px;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }
  .brand span:last-child { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell { padding: 24px 0 72px; }
  .overview, .content-grid { grid-template-columns: 1fr; }
  .overview { margin-bottom: 28px; gap: 24px; }
  .rail { position: static; }
  .panel { max-height: none; }
  .timeline { max-height: 340px; }
  .overview-stats, .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { padding: 3px; margin-bottom: 24px; }
  .tab { height: 32px; padding: 0 13px; font-size: 12px; }
}

/* ── Phone (< 600px) — complete redesign ── */
@media (max-width: 600px) {
  /* --- Variables --- */
  :root {
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 20px;
  }

  body {
    background-attachment: scroll;
  }
  body::before {
    /* slightly denser stars on small screens */
    background-size: 160px 160px;
    mask-image: linear-gradient(180deg, #000 5%, rgba(0,0,0,0.8) 35%, rgba(0,0,0,0.2) 65%, transparent 94%);
  }

  /* --- Topbar: inline brand mark, search input, and twin action buttons --- */
  .topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.03);
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
  }
  .brand {
    font-size: 15px;
    gap: 8px;
  }
  .brand span:last-child { display: none; } /* Hide brand text on mobile since a massive h1 is right below it */
  .brand-mark { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; flex-shrink: 0; }
  
  .search {
    flex: 1;
    min-width: 0;
  }
  .search input {
    height: 36px;
    font-size: 13px;
    border-radius: 11px;
    padding: 0 12px 0 34px;
  }
  .search svg {
    left: 12px;
    width: 14px;
    height: 14px;
  }

  .top-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }
  .top-action {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  .top-action span {
    display: none; /* Hide the word '总览' on mobile */
  }
  .top-action svg.btn-icon {
    margin: 0;
    width: 16px;
    height: 16px;
  }
  .top-action.primary-action {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px var(--glow);
  }
  .theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--surface);
  }

  /* --- Shell --- */
  .shell {
    width: min(100% - 48px, 1180px); /* Contracted sides slightly for a cleaner centered look on mobile */
    padding: 18px 0 72px;
  }

  /* --- Hero --- */
  .overview {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--text) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .overview p {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.65;
  }

  /* --- Metrics — horizontal 3-column, compact --- */
  .metrics {
    grid-template-columns: repeat(3, 1fr);
    border-radius: var(--radius);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .metrics div {
    min-height: 56px;
    padding: 12px 14px;
    border-left: 1px solid var(--line);
  }
  .metrics div:first-child { border-left: 0; }
  .metrics dt { font-size: 20px; }
  .metrics dd { font-size: 11px; margin-top: 2px; }

  /* --- Tabs — compact scrollable chips with premium scroll indicators --- */
  .tabs {
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 22px;
    border-radius: var(--radius);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
  .tab {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  /* --- Content grid: full width, sidebar below --- */
  .content-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-head { margin-bottom: 14px; }
  .section-head h2 { font-size: 11px; }

  /* --- Directory + Category --- */
  .directory { gap: 32px; }
  .category { gap: 10px; }
  .category-title h2 { font-size: 17px; }

  /* ── CARDS — full-width, readable ── */
  .cards { grid-template-columns: 1fr; gap: 10px; }

  .site-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    min-height: auto;
    padding: 16px;
    border-radius: var(--radius);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-card h3 { font-size: 16px; }
  .site-card p {
    font-size: 13px;
    max-height: none;
    -webkit-line-clamp: unset;
    display: block;
    margin: 8px 0 12px;
    line-height: 1.55;
  }
  .site-card .url { font-size: 11px; }

  .icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .icon svg { width: 20px; height: 20px; }

  .status-pill {
    height: 20px;
    padding: 0 8px;
    font-size: 10px;
    border-radius: 999px;
  }
  .tag { font-size: 11px; }

  .card-action {
    height: 30px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
  }

  /* ── Sidebar ── */
  /* ── Sidebar & Floating Timeline Modal ── */
  .rail {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: ov-fade 0.2s ease;
    padding: 20px;
  }
  .rail.open {
    display: flex;
  }
  .panel {
    width: min(480px, 100%);
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--surface);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    animation: ov-scale 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .panel h2 { font-size: 16px; }
  .panel p { font-size: 13px; }
  
  .panel-close {
    display: grid;
    width: 36px; height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .panel-close:hover { background: var(--surface-hover); border-color: var(--accent); }
  .panel-close svg { width: 16px; height: 16px; }

  .fab-timeline {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px var(--glow), 0 8px 24px rgba(99, 102, 241, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    outline: none;
  }
  .fab-timeline:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px var(--glow), 0 10px 28px rgba(99, 102, 241, 0.3);
  }
  .fab-timeline:active {
    transform: scale(0.95);
  }
  .fab-timeline svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
  }
  .fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
  }
  .fab-badge.visible {
    display: inline-flex;
  }

  .timeline { max-height: 380px; }
  .time-item { padding-bottom: 16px; }
  .time-body strong { font-size: 13px; }
  .time-details { font-size: 11px; }

  /* ── Overview Modal ── */
  .overview-modal { padding: 0; }
  .overview-panel {
    padding: 20px 16px;
    border-radius: 0;
    max-height: 100vh;
    max-height: 100dvh;
  }
  .overview-header { margin-bottom: 16px; }
  .overview-header h2 { font-size: 17px; }
  .overview-close { width: 40px; height: 40px; }
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .overview-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ov-stat { padding: 10px 12px; gap: 8px; }
  .ov-stat-icon { width: 32px; height: 32px; border-radius: 8px; }
  .ov-stat-icon svg { width: 16px; height: 16px; }
  .ov-stat-value { font-size: 16px; }
  .ov-stat-label { font-size: 10px; }
  .ov-card { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
