/**
 * 国际化工具平台 — 门户页样式
 */
:root {
  --bg-deep: #070b14;
  --bg-card: rgba(30, 41, 59, 0.55);
  --bg-card-solid: #151b2e;
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-glow: rgba(99, 102, 241, 0.35);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #818cf8;
  --accent-bright: #a5b4fc;
  --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #d946ef 100%);
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 20px 48px rgba(99, 102, 241, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 背景：渐变光斑 + 细网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(217, 70, 239, 0.12), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(56, 189, 248, 0.08), transparent),
    linear-gradient(180deg, #0a0f1a 0%, var(--bg-deep) 45%, #0a0e18 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.platform-wrap {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* Hero */
.platform-hero-shell {
  margin-bottom: 48px;
  padding: 48px 40px 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    145deg,
    rgba(30, 27, 75, 0.65) 0%,
    rgba(15, 23, 42, 0.75) 50%,
    rgba(30, 27, 75, 0.4) 100%
  );
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
}

@media (max-width: 640px) {
  .platform-hero-shell {
    padding: 36px 22px 32px;
  }
}

.platform-hero {
  text-align: center;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-bottom: 20px;
}

.platform-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.platform-hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(120deg, #fff 0%, #e0e7ff 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.platform-version {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-bright);
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.35);
  letter-spacing: 0.02em;
}

.platform-hero .hero-lead {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 24px;
}

.platform-meta-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-dim);
  max-width: 100%;
}

.platform-meta-box code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--accent-bright);
  background: rgba(99, 102, 241, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  word-break: break-all;
}

/* 分类区块 */
.category-block {
  margin-bottom: 44px;
}

.category-panel {
  padding: 28px 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@media (max-width: 640px) {
  .category-panel {
    padding: 22px 18px 26px;
  }
}

.category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.category-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.category-header .category-en {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.category-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.65;
  max-width: 720px;
}

/* 工具卡片网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.tool-card {
  display: block;
  position: relative;
  padding: 0;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
  opacity: 0.85;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: var(--shadow-hover);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tool-card-inner {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tool-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(129, 140, 248, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tool-card .badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(99, 102, 241, 0.18);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.tool-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  width: 100%;
}

.tool-card-heading h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.tool-card-version {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.tool-card h3 {
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.tool-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s ease, color 0.2s ease;
}

.tool-card:hover .cta {
  gap: 10px;
  color: var(--accent-bright);
}

.tool-card .cta-arrow {
  transition: transform 0.2s ease;
}

.tool-card:hover .cta-arrow {
  transform: translateX(3px);
}

/* 预留占位 */
.placeholder-box {
  padding: 28px 24px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.placeholder-box strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 8px;
}

/* 页脚 */
.platform-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.platform-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.platform-footer a:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

.platform-footer code {
  font-size: 12px;
  color: var(--text-muted);
}

/* 错误条 */
#error-banner {
  display: none;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 14px;
  line-height: 1.5;
}
