/* ===== AI API Gateway — Design System ===== */
:root {
  --accent: #6C47FF;
  --accent-end: #4F6AF5;
  --accent-gradient: linear-gradient(135deg, #6C47FF, #4F6AF5);
  --text: #111827;
  --text2: #4b5563;
  --text3: #6b7280;
  --text4: #9ca3af;
  --border: #e5e7eb;
  --border2: #f0f0f0;
  --bg: #ffffff;
  --bg2: #fafafa;
  --bg3: #f3f4f6;
  --radius: 8px;
  --radius2: 12px;
  --max-w: 1060px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-hv: 0 4px 20px rgba(0,0,0,0.04);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border2);
  height: 60px;
}
header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  margin-right: 8px;
  vertical-align: middle;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text3);
  transition: color 0.15s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-hdr {
  padding: 7px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
}
.btn-hdr:hover { border-color: #d1d5db; color: var(--text); }
.btn-hdr-primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,71,255,0.25);
}
.btn-hdr-primary:hover {
  box-shadow: 0 4px 14px rgba(108,71,255,0.35);
  transform: translateY(-1px);
}
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: #d1d5db; color: var(--text); }
.btn-primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,71,255,0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(108,71,255,0.35);
  transform: translateY(-1px);
  border-color: transparent;
}
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ===== Forms ===== */
.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.1);
}
.input::placeholder { color: var(--text4); }
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

/* ===== Cards ===== */
.card {
  border-radius: var(--radius2);
  border: 1px solid var(--border2);
  background: var(--bg);
  transition: all 0.2s;
}
.card-hv:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-hv);
}
.card-pad { padding: 32px; }

/* ===== Form Card (for login/register) ===== */
.form-card {
  max-width: 400px;
  margin: 120px auto 60px;
  padding: 40px;
  border-radius: var(--radius2);
  border: 1px solid var(--border2);
  background: var(--bg);
}
.form-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.form-card .sub {
  font-size: 14px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 20px; }
.form-actions { margin-top: 24px; }
.form-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  margin-top: 20px;
}
.form-foot a { color: var(--accent); font-weight: 500; }
.form-foot a:hover { text-decoration: underline; }

/* ===== Page header ===== */
.page-hdr {
  padding: 100px 24px 40px;
  background: linear-gradient(180deg, #f5f3ff 0%, #f0fdf4 80%, #fff 100%);
}
.page-hdr h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.page-hdr p {
  font-size: 15px;
  color: var(--text3);
  max-width: 560px;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius2);
  border: 1px solid var(--border2);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
  color: var(--text2);
}
tr:last-child td { border-bottom: none; }

/* ===== Badge/Tag ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.tag-green { background: #ecfdf5; color: #059669; }
.tag-gray { background: var(--bg3); color: var(--text3); }
.tag-purple { background: rgba(108,71,255,0.08); color: var(--accent); }

/* ===== Footer ===== */
footer {
  margin-top: 80px;
  padding: 40px 24px 28px;
  border-top: 1px solid var(--border2);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand { font-size: 14px; font-weight: 500; color: var(--text3); }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  font-size: 13px;
  color: var(--text4);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border2);
  font-size: 12px;
  color: #d1d5db;
  display: flex;
  justify-content: space-between;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .header-actions .btn-hdr:not(.btn-hdr-primary) { display: none; }
  .mobile-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border2);
  }
  .nav-links.open a { font-size: 15px; padding: 6px 0; }
  .nav-links a.active::after { bottom: -2px; }
  .form-card { padding: 28px 24px; margin: 100px 16px 40px; }
  footer .wrap { flex-direction: column; text-align: center; }
  .footer-copy { flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 768px) {
  .logo-img { height: 28px; width: 28px; }
}

/* ===== Logo image ===== */
.logo-img {
  height: 30px;
  width: 30px;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 7px;
  object-fit: cover;
}
@media (max-width: 768px) {
  .logo-img { height: 26px; width: 26px; }
}
