:root {
  --bg: #f2f7ff;
  --card: #ffffff;
  --text: #0f2748;
  --accent: #0057b8;
  --accent-strong: #003f8a;
  --muted: #4d6585;
  --line: #b8d3f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rubik", "Inter", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(circle at top right, #dcecff, var(--bg) 55%);
  text-rendering: optimizeLegibility;
}

.hero {
  text-align: center;
  padding: 28px 16px 14px;
}

.hero h1 {
  margin: 0;
  font-family: "Rubik", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.15;
}

.hero p {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 8px 0 0;
}

.content-layout {
  width: min(1200px, 100% - 24px);
  margin: 0 auto 30px;
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: start;
}

.tabs {
  width: 180px;
  flex: 0 0 180px;
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(15, 39, 72, 0.1);
  z-index: 10;
}

.tab {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  width: 100%;
  min-height: 40px;
  font-size: 0.98rem;
  font-weight: 700;
  transition: 0.2s ease, transform 0.14s ease, box-shadow 0.2s ease;
  cursor: pointer;
  font-family: inherit;
}

.tab::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(0, 87, 184, 0.16), rgba(0, 87, 184, 0));
  transition: width 0.2s ease;
}

.tab:hover {
  background: #ffffff;
  border-color: #9dc0ec;
  box-shadow: 0 8px 18px rgba(15, 39, 72, 0.16);
  transform: translateY(-2px);
}

.tab:hover::after {
  width: 100%;
}

.tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #2a7bd2);
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(0, 87, 184, 0.26);
}

.grid {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d6e6fa;
  box-shadow: 0 8px 24px rgba(0, 87, 184, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(0, 87, 184, 0.2);
}

.new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: #d7263d;
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(215, 38, 61, 0.3);
}

.card img {
  width: 100%;
  height: 196px;
  object-fit: contain;
  background-color: #ffffff;
  padding: 8px;
  transition: transform 0.3s ease;
}

.card:hover img {
  transform: scale(1.04);
}

.content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
}

.content h2 {
  margin: 0 0 8px;
  font-family: "Rubik", "Inter", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.content p:not(.price):not(.time) {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price b:first-child {
  white-space: nowrap;
  display: inline-block;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.content a,
.copy-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  min-height: 40px;
  font-family: inherit;
  cursor: pointer;
}

.content a,
.copy-link-btn {
  flex: 1;
}

.content a:hover,
.copy-link-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.copy-link-btn.copied {
  background: #1e7f46;
  border-color: #1e7f46;
}

.time {
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .content-layout {
    display: block;
  }

  .tabs {
    display: none;
  }

  .grid {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --accent: #3b82f6;
    --accent-strong: #60a5fa;
    --muted: #94a3b8;
    --line: #334155;
  }

  body {
    background: radial-gradient(circle at top right, #1e293b, var(--bg) 55%);
  }

  .tabs {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  
  .tab {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text);
  }
  
  .tab:hover {
    background: #334155;
    border-color: #475569;
  }

  .tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #2563eb;
  }
  
  .card {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .card:hover {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  }

  .card img {
    background-color: #ffffff;
  }
}
