:root {
  --brand: #1e5fa8;
  --brand-dark: #14457e;
  --brand-light: #e9f1fb;
  --accent: #2eb47a;
  --warn: #d97706;
  --danger: #c0392b;
  --text: #1a1f2b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f9fc;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

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

.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-header .brand-link {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--brand-dark); text-decoration: none;
}
.site-header .brand-link:hover { text-decoration: none; }
.site-header .brand-logo {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; display: block; flex-shrink: 0;
  border: 1px solid var(--border);
}
.site-header .brand { font-weight: 700; color: var(--brand-dark); font-size: 20px; line-height: 1.1; }
.site-header .brand-sub { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 4px; }
.site-header nav a { margin-left: 18px; color: var(--text); font-weight: 500; }
.site-header nav a:hover { color: var(--brand); }
@media (max-width: 480px) {
  .site-header .brand-sub { display: none; }
  .site-header .brand { font-size: 17px; }
  .site-header nav a { margin-left: 10px; font-size: 14px; }
}

main { padding: 32px 0 64px; }

.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; color: var(--brand-dark); }
.hero p { font-size: 18px; color: var(--muted); margin: 0 auto; max-width: 600px; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.action-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(30,95,168,.12);
}
.action-card .icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand);
  display: grid; place-items: center; font-size: 28px;
}
.action-card h2 { font-size: 20px; margin: 4px 0 0; color: var(--brand-dark); }
.action-card p { margin: 0; color: var(--muted); font-size: 15px; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}
.panel h1 { margin-top: 0; color: var(--brand-dark); }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30,95,168,.15);
}

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-group label {
  flex: 1; min-width: 140px; cursor: pointer; font-weight: 500;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; display: flex; align-items: center; gap: 10px;
}
.radio-group input[type="radio"] { accent-color: var(--brand); }
.radio-group label:has(input:checked) {
  border-color: var(--brand); background: var(--brand-light);
}

.btn {
  display: inline-block;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 14px 24px; font-size: 17px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .05s ease;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #94a3b8; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }
.btn.secondary { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.secondary:hover { background: var(--brand-light); color: var(--brand-dark); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #962a1f; }

.alert {
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid; margin: 12px 0;
}
.alert.info { background: var(--brand-light); border-color: #bcd2ee; color: var(--brand-dark); }
.alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.help-actions {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px;
}
.help-actions .btn { flex: 1; min-width: 180px; }

/* AI chat */
.chat-window {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; padding: 16px; min-height: 280px;
  max-height: 60vh; overflow-y: auto; margin-bottom: 16px;
}
.chat-msg { margin-bottom: 14px; display: flex; }
.chat-msg .bubble {
  padding: 12px 16px; border-radius: 14px; max-width: 85%;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-msg.user { justify-content: flex-end; }
.chat-msg.user .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .bubble { background: var(--brand-light); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.system { justify-content: center; }
.chat-msg.system .bubble { background: #f1f5f9; color: var(--muted); font-size: 14px; font-style: italic; }

.chat-input { display: flex; gap: 8px; }
.chat-input textarea {
  flex: 1; padding: 12px 14px; font-size: 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); resize: none; min-height: 48px; max-height: 120px;
  font-family: inherit;
}
.chat-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 14px; color: var(--muted);
}

.kb-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 720px) {
  .kb-list { grid-template-columns: 1fr 1fr; }
}
.kb-list a {
  display: block;
  padding: 18px 20px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
}
.kb-list a:hover { border-color: var(--brand); background: var(--brand-light); text-decoration: none; }
.kb-list a strong { display: block; color: var(--brand-dark); margin-bottom: 4px; font-size: 17px; }
.kb-list a span { color: var(--muted); font-size: 14px; }

.kb-article h1 { color: var(--brand-dark); }
.kb-article h2 { color: var(--brand-dark); margin-top: 28px; font-size: 22px; }
.kb-article ol, .kb-article ul { padding-left: 24px; }
.kb-article ol li, .kb-article ul li { margin-bottom: 10px; }
.kb-article .tip {
  background: var(--brand-light); border-left: 4px solid var(--brand);
  padding: 12px 16px; border-radius: 6px; margin: 16px 0;
}
.kb-article .warn {
  background: #fffbeb; border-left: 4px solid var(--warn);
  padding: 12px 16px; border-radius: 6px; margin: 16px 0;
}
.kb-back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 15px; }

.footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 24px 0;
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.footer a { color: var(--muted); }
.footer .designed { margin-top: 8px; font-size: 13px; }
