/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #2d3748;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ===== Header / Navbar ===== */
.navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo svg { width: 26px; height: 26px; }

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links li a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #64748b;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: #f1f5f9;
  color: #4f46e5;
}

/* ===== Main Content ===== */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}

/* Section titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  scroll-margin-top: 72px;
}

.section-title .icon { font-size: 20px; }

/* Primary section title (bookmarks) */
.section-title-primary {
  font-size: 22px;
  margin-bottom: 0;
}

.section-title-primary .icon { font-size: 24px; }

/* Secondary section title (tools, articles) */
.section-title-secondary {
  font-size: 16px;
  color: #475569;
}

.section-title-secondary .icon { font-size: 18px; }

/* ===== Bookmark Section (Primary) ===== */
.bookmark-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 28px 24px;
  margin-bottom: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  scroll-margin-top: 72px;
}

.bookmark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bookmark-update {
  font-size: 12px;
  color: #94a3b8;
}

.bookmark-notice {
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.text-green { color: #16a34a; font-weight: 600; }

.section-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 8px 0 32px;
}

/* ===== Tool Grid ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}

.tool-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.2s;
  cursor: pointer;
}

.tool-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}

.tool-card .tool-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.tool-card .tool-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 2px;
}

.tool-card .tool-info p {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

/* ===== Article List ===== */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}

.article-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.2s;
}

.article-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.article-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.article-card p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .article-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 12px;
}

/* ===== Bookmark / Domain Section ===== */
.bookmark-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bookmark-tab {
  padding: 8px 20px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.bookmark-tab:hover {
  background: #f1f5f9;
  color: #4f46e5;
}

.bookmark-tab.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.2s;
}

.bookmark-item:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  box-shadow: 0 2px 12px rgba(79,70,229,0.08);
  transform: translateY(-1px);
}

.bookmark-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bookmark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.bookmark-url {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge {
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-rec {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #16a34a;
}

.bookmark-date {
  font-size: 12px;
  color: #94a3b8;
}

.bookmark-arrow {
  color: #cbd5e1;
  transition: transform 0.2s;
}

.bookmark-item:hover .bookmark-arrow {
  transform: translateX(3px);
  color: #4f46e5;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #94a3b8;
  background: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .navbar-inner { padding: 0; }
  .nav-links li a { padding: 6px 10px; font-size: 13px; }
  .hero h1 { font-size: 22px; }
  .bookmark-section { padding: 20px 16px 18px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .article-list { grid-template-columns: 1fr; }
  .bookmark-date { display: none; }
}

@media (max-width: 380px) {
  .tool-grid { grid-template-columns: 1fr; }
  .bookmark-section { padding: 16px 12px 14px; }
}

/* ===== Animations ===== */
.fade-in {
  animation: fadeIn 0.35s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
