/* Tommy 的项目 · Project Hub design-v1
   Tokens adapted from Smart Invest A2 (personal site, not blog-bound) */

:root {
  --bg: #FFFFFF;
  --bg-soft: #F5F7FA;
  --text: #142033;
  --text-secondary: #5A6A7A;
  --line: #E6E9EE;
  --navy: #1E3A5F;
  /* Contrast: #A84A1F on #FFFFFF ≈ 5.73:1; on --bg-soft #F5F7FA ≈ 5.34:1 (AA ≥ 4.5). */
  --accent: #A84A1F;
  --pill: #EEF2F7;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.04), 0 4px 16px rgba(20, 32, 51, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.10);
  --status-online: #1A7F4B;
  --status-online-bg: #E8F7EF;
  --status-offline: #C0392B;
  --status-offline-bg: #FDECEA;
  --status-building: #B7791F;
  --status-building-bg: #FEF6E7;
  --status-example: #5A6A7A;
  --status-example-bg: #EEF2F7;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-soft);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 28px 24px 24px;
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.site-header__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.site-header__sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 36em;
}

/* ---------- Layout ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* ---------- Demo banner ---------- */
.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--status-building-bg);
  border: 1px solid #F0D9A8;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 28px;
  color: #7A5A14;
  font-size: 14px;
  line-height: 1.5;
}

.demo-banner__badge {
  flex-shrink: 0;
  /* Contrast: white text on #805C16 ≈ 6.07:1 (AA ≥ 4.5). */
  background: #805C16;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.demo-banner p { margin: 0; }

/* ---------- Tile grid ---------- */
/* Few projects → larger tiles: 1 / 2 / 3 columns (never 4) */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 700px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (min-width: 1080px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  min-height: 280px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  color: inherit;
  text-decoration: none;
  position: relative;
  outline: none;
}

a.tile:hover,
a.tile:focus-visible {
  box-shadow: var(--shadow-hover);
  border-color: #C9D2DE;
  transform: translateY(-2px);
  color: inherit;
}

a.tile:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.tile--muted {
  cursor: default;
}

.tile--add {
  border-style: dashed;
  border-color: #C9D2DE;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--text-secondary);
  cursor: default;
  pointer-events: none;
}

.tile--add .tile__add-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px dashed #C9D2DE;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.tile--add .tile__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tile__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--pill);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.tile__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__icon svg {
  width: 30px;
  height: 30px;
  color: var(--navy);
}

.tile__icon--vpn {
  background: #E8EEF5;
}

.tile__icon--sample {
  background: var(--pill);
  color: var(--text-secondary);
}

.tile__external {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--pill);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tile__external svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.tile__name {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 650;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.tile__desc {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta key-value under description — keep sparse */
.tile__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  flex: 1;
}

.tile__meta-span {
  grid-column: 1 / -1;
}

.tile__meta dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.tile__meta dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.tile__meta dd .demo-inline {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #7A5A14;
  background: var(--status-building-bg);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
}

.tile__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill--online {
  color: var(--status-online);
  background: var(--status-online-bg);
}

.status-pill--offline {
  color: var(--status-offline);
  background: var(--status-offline-bg);
}

.status-pill--building {
  color: var(--status-building);
  background: var(--status-building-bg);
}

.status-pill--example {
  color: var(--status-example);
  background: var(--status-example-bg);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.site-footer p { margin: 0; }

/* ---------- VPN detail page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.back-link:hover { color: var(--navy); }

.back-link:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 4px;
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.vpn-hero {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
}

.vpn-hero__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #E8EEF5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vpn-hero__icon svg {
  width: 28px;
  height: 28px;
  color: var(--navy);
}

.vpn-hero__body { flex: 1; min-width: 200px; }

.vpn-hero__title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.vpn-hero__meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.vpn-hero__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.vpn-hero__status .status-pill {
  font-size: 14px;
  padding: 6px 14px;
}

.vpn-hero__status .status-pill::before {
  width: 8px;
  height: 8px;
}

.vpn-hero__hint {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 639px) {
  .vpn-hero__status {
    align-items: flex-start;
    width: 100%;
  }
}

/* Metric cards */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
}

.metric-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.metric-card__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.metric-card__value {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-card__value small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}

.metric-card__hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.metric-card__hint .demo-tag {
  display: inline-block;
  background: var(--status-building-bg);
  color: #7A5A14;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

/* ---------- Live data states ---------- */
[hidden] { display: none; }

.grid-message {
  grid-column: 1 / -1;
  background: var(--bg);
  border: 1px dashed #C9D2DE;
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.resource-note {
  margin: -4px 0 20px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.resource-note .demo-tag {
  display: inline-block;
  background: var(--status-building-bg);
  color: #7A5A14;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.stale-hint {
  margin: -8px 0 20px;
  font-size: 13px;
  color: #7A5A14;
  background: var(--status-building-bg);
  border: 1px solid #F0D9A8;
  border-radius: var(--radius);
  padding: 10px 14px;
}
