:root {
  --background: #f7f8fa;
  --foreground: #2a2f3a;
  --card: #ffffff;
  --muted-foreground: #6b7280;
  --primary: #3b6fd4;
  --primary-foreground: #ffffff;
  --border: #e5e7eb;
  --accent: #eef2fb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --background: #16181d;
  --foreground: #e8eaed;
  --card: #20242c;
  --muted-foreground: #9aa1ad;
  --primary: #5b8bf0;
  --primary-foreground: #0f1115;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #2a3140;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* 헤더 */
.header {
  margin-bottom: 40px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.greeting {
  font-size: 15px;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.clock {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

/* 검색창 */
.search {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.search-btn {
  padding: 0 22px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.search-btn:hover {
  opacity: 0.9;
}

/* 그리드: 한 줄에 3개의 박스 */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .clock {
    font-size: 32px;
  }
}

/* 카테고리 카드 (박스) */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--foreground);
  transition: background 0.12s ease;
}

.link:hover {
  background: var(--accent);
}

.link-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent);
  font-size: 16px;
}

.link-name {
  font-size: 14px;
  font-weight: 600;
}

.link-desc {
  font-size: 12px;
  color: var(--muted-foreground);
}

.footer {
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
}