/* Aimuc · 实用工具 — site styles */
:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --bg-card: #162033;
  --border: #2a3a52;
  --text: #e7ecf3;
  --text-muted: #9aa8bc;
  --accent: #3b9eff;
  --accent-hover: #62b2ff;
  --accent-soft: rgba(59, 158, 255, 0.12);
  --success: #3dd68c;
  --danger: #f07178;
  --warning: #ffcc66;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --max: 1080px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b9eff, #7c5cff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  text-decoration: none;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    width: 100%;
  }
}

/* Main */
.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 auto 1.5rem;
  max-width: 36rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #061018;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #061018;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--text);
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.section {
  margin: 2.5rem 0;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
}
.section-header a {
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 800px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
}
a.card {
  color: inherit;
  text-decoration: none;
  display: block;
}
a.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
}
.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 0.35rem;
}

/* Ad slots */
.ad-slot {
  min-height: 90px;
  margin: 1.5rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow: hidden;
}
.ad-slot[data-ad-loaded="true"] {
  border-style: solid;
  min-height: auto;
}
.ad-slot-label::before {
  content: "广告位";
}

/* Tool UI */
.tool-layout {
  display: grid;
  gap: 1.25rem;
}
.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.tool-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
label.field {
  display: block;
  margin-bottom: 0.85rem;
}
label.field span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
textarea,
input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.5;
}
textarea:focus,
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.3em;
}
.status.ok {
  color: var(--success);
}
.status.err {
  color: var(--danger);
}
.output-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 3rem;
}

/* Article */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.page-header .lead {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.05rem;
}

.prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  max-width: 720px;
}
.prose h2 {
  margin-top: 1.75rem;
  font-size: 1.25rem;
}
.prose h3 {
  margin-top: 1.35rem;
  font-size: 1.05rem;
}
.prose p,
.prose li {
  color: var(--text);
}
.prose ul,
.prose ol {
  padding-left: 1.25rem;
}
.prose code {
  font-family: var(--mono);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}
.prose a {
  text-decoration: underline;
}

.article-list {
  display: grid;
  gap: 1rem;
}
.article-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.article-item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.article-item h2 a {
  color: var(--text);
  text-decoration: none;
}
.article-item h2 a:hover {
  color: var(--accent);
}

.related {
  margin-top: 2rem;
}
.related h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.5rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links {
  display: flex;
  gap: 1rem;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--text);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--accent);
}
