/* 平台全局样式 - CSS 变量由后台主题配置动态注入 */

:root {
  --primary: #4f46e5;
  --primary-dark: #6366f1;
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 12px;
  --shadow: 0 1px 3px 0 rgb(0 0 0/.1), 0 1px 2px -1px rgb(0 0 0/.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0/.1), 0 2px 4px -2px rgb(0 0 0/.1);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1rem;
}
.site-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.site-nav a:hover { color: var(--primary); }
.lang-switch {
  font-size: .85rem;
  padding: .25rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .85rem;
  color: var(--text-muted);
  padding: .75rem 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: .4; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* Tool grid (homepage) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.tool-card__icon {
  width: 36px; height: 36px;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.tool-card__name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
}
.tool-card__desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tool page layout */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 0;
}
@media (max-width: 768px) {
  .tool-layout { grid-template-columns: 1fr; }
}
.tool-main {}
.tool-sidebar {}

/* Tool header */
.tool-header {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 1.25rem;
}
.tool-header__icon {
  width: 48px; height: 48px;
  color: var(--primary);
  flex-shrink: 0;
}
.tool-header__title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.tool-header__desc { color: var(--text-muted); font-size: .925rem; margin: .25rem 0 0; }

/* Content sections */
.content-section { margin-top: 1.5rem; }
.content-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 .875rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}
.content-section p { margin: .5rem 0; }
.content-section ul, .content-section ol { padding-left: 1.5rem; }
.content-section li { margin: .3rem 0; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: .875rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; font-size: .95rem; cursor: pointer; }
.faq-a { color: var(--text-muted); font-size: .9rem; margin-top: .5rem; line-height: 1.6; }

/* Operations sidebar */
.ops-card { display: flex; flex-direction: column; gap: .75rem; }
.ops-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: all .15s;
  width: 100%;
  text-decoration: none;
}
.ops-btn:hover { border-color: var(--primary); color: var(--primary); }
.ops-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.ops-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.ops-btn svg { width: 16px; height: 16px; }

/* Related tools */
.related-list { display: flex; flex-direction: column; gap: .625rem; margin-top: .75rem; }
.related-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem .875rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .875rem;
  transition: all .15s;
}
.related-item:hover { border-color: var(--primary); color: var(--primary); }
.related-item svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Section heading */
.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
