:root {
  --bg: #f6f7f9;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --down: #ef4444;
  --down-soft: rgba(239, 68, 68, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.07);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0a0c10;
  --surface: rgba(19, 23, 31, 0.78);
  --surface-solid: #13171f;
  --surface-hover: rgba(26, 31, 42, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --down: #f87171;
  --down-soft: rgba(248, 113, 113, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 4px 16px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.42);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* 柔和环境光背景 */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .glow {
  opacity: 0.22;
}

.glow-1 {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.42), transparent 70%);
}

.glow-2 {
  width: 460px;
  height: 460px;
  top: -100px;
  right: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
}

/* 页面容器 */
.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 44px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

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

.brand-logo {
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.status-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  position: relative;
  flex-shrink: 0;
}

.pulse-dot.is-ok::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--ok);
  opacity: 0.35;
  animation: pulse 2.2s ease-out infinite;
}

.pulse-dot.is-loading {
  background: var(--text-muted);
}

.pulse-dot.is-warn {
  background: var(--warn);
}

.pulse-dot.is-down {
  background: var(--down);
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.45; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* 通用玻璃卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Hero Bento Grid */
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
}

.profile-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  border: 3px solid var(--surface-solid);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.profile-name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.profile-bio {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* 右侧时钟与状态卡片 */
.clock-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.location-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-top: 14px;
}

.clock-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.clock-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0 16px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* 快捷搜索栏 */
.search-bar {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.engine-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.engine-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.engine-tab:hover {
  color: var(--text);
}

.engine-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 8px 0;
  min-width: 0;
}

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

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.3;
}

.search-submit {
  border: none;
  border-radius: 9px;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.18s ease;
}

.search-submit:hover {
  opacity: 0.88;
}

/* 板块标题 */
.section-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.18s ease;
}

.section-link svg {
  width: 14px;
  height: 14px;
}

.section-link:hover {
  color: var(--accent);
}

/* 服务卡片网格 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.service-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.service-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.service-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.service-icon svg {
  width: 20px;
  height: 20px;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.service-badge.is-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.service-badge.is-down {
  background: var(--down-soft);
  color: var(--down);
}

.service-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.service-body h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.service-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.service-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.service-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.service-card:hover .service-arrow {
  transform: translate(2px, -2px);
  color: var(--text);
}

/* 常用书签网格 */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.bookmark-card {
  padding: 15px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.bookmark-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow-sm);
}

.bookmark-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bookmark-icon svg {
  width: 17px;
  height: 17px;
}

.bookmark-info {
  min-width: 0;
}

.bookmark-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页脚 */
.footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--text);
}

.footer-sep {
  opacity: 0.45;
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .bookmarks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 16px 14px 32px;
  }
  .profile-card,
  .clock-card {
    padding: 20px;
  }
  .profile-name {
    font-size: 23px;
  }
  .clock-time {
    font-size: 36px;
  }
  .bookmarks-grid {
    grid-template-columns: 1fr;
  }
  .kbd-hint {
    display: none;
  }
}
