:root {
  --bg-grad: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #16213e 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-bg-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.05);
  --text: #e8e8f0;
  --muted: rgba(232, 232, 240, 0.7);
  --accent: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.4px;
  font-weight: 700;
}
.site-brand .author {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.site-nav {
  display: flex;
  gap: 8px;
}
.site-nav .nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0.85;
  transition: all 0.25s ease;
  position: relative;
}
.site-nav .nav-link:hover {
  opacity: 1;
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}
.site-nav .nav-link.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Main */
main#app {
  padding: 28px;
  flex: 1 1 auto;
  max-width: 1100px;
  margin: 24px auto;
  width: calc(100% - 56px);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  transition: all 0.25s ease;
}
.card:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

/* Hero */
.hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.hero .intro {
  max-width: 64%;
}
.hero h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.quick-grid .card {
  margin-bottom: 0;
  padding: 16px;
}
.quick-grid .card h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
}
.quick-grid .card p {
  margin: 0;
  font-size: 13px;
}

/* Blog list */
.post-list {
  display: grid;
  gap: 14px;
}
.post-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.post-item .btn {
  white-space: nowrap;
}
.post-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Article */
.article h2 {
  margin: 12px 0 8px 0;
  font-size: 24px;
  font-weight: 700;
}
.article h3 {
  margin: 20px 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}
.article p {
  line-height: 1.8;
  color: var(--muted);
  margin: 10px 0;
}
.article ul {
  color: var(--muted);
  line-height: 1.8;
  padding-left: 20px;
}
.article li {
  margin-bottom: 6px;
}
.article pre {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.article code {
  color: #c8d6e5;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
}
.article p code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Tools */
.tools-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.tool {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
}
.tool textarea,
.tool input {
  width: 100%;
  min-height: 110px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  resize: vertical;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
  transition: border-color 0.2s ease;
}
.tool input {
  min-height: auto;
  padding: 10px 12px;
}
.tool textarea:focus,
.tool input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
}
.tool .controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-block;
  text-decoration: none;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
}
.btn.small {
  font-size: 12px;
  padding: 6px 12px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
}
.about-grid > div > .card:first-child {
  margin-top: 0;
}
.profile {
  display: flex;
  gap: 16px;
  align-items: center;
}
.profile h2 {
  margin: 0 0 4px 0;
  font-size: 22px;
}
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 32px;
  color: #e8e8f0;
  flex-shrink: 0;
}
aside .card h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}
aside .card ul {
  margin: 0;
  padding-left: 16px;
}
aside .card li {
  margin-bottom: 6px;
  font-size: 13px;
}

/* Footer */
.site-footer {
  padding: 16px 28px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.2));
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Links */
a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #fff;
}

/* Section headings */
section.card > h2,
section.card > h3 {
  margin-top: 0;
}
section.card > h2 {
  font-size: 22px;
  margin-bottom: 6px;
}
section.card > h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }
  .site-nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .site-nav .nav-link {
    padding: 6px 12px;
    font-size: 13px;
  }
  main#app {
    padding: 16px;
    margin: 12px auto;
    width: calc(100% - 32px);
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hero .intro {
    max-width: 100%;
  }
  .hero h2 {
    font-size: 22px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .post-item {
    flex-direction: column;
    gap: 10px;
  }
  .post-item .btn {
    align-self: flex-start;
  }
  .profile {
    flex-direction: column;
    text-align: center;
  }
}
