/* style.css — EMS stop-gain 突变体检索 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1a1a2e; --ink-light: #4a5568;
  --blue: #2F6BFF; --blue-light: #4FB6FF; --blue-bg: #EAF1FF;
  --green: #16a34a; --green-bg: #f0fdf4;
  --red: #e11d48; --red-bg: #fef2f2;
  --amber: #d97706; --amber-bg: #fffbeb;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
  --gray-300: #d1d5db; --gray-500: #6b7280; --gray-700: #374151;
  --gray-900: #111827;
  --white: #fff; --surface: #f8fafc;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--surface); color: var(--ink); line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--ink) 0%, #1e293b 100%);
  color: var(--white); position: sticky; top: 0; z-index: 100;
}
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--white); }
.logo-icon-svg { flex-shrink: 0; }
.logo-text { font-size: 1.1rem; font-weight: 400; }
.logo-text strong { font-weight: 700; }
.header-nav { display: flex; gap: 8px; }
.nav-badge { background: rgba(255,255,255,.12); color: var(--white); padding: 4px 12px; border-radius: 20px; font-size: .82rem; text-decoration: none; transition: background .15s; }
.nav-badge:hover { background: rgba(255,255,255,.2); }

/* Main */
.main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; }

.hero-section { text-align: center; margin-bottom: 28px; position: relative; }
.hero-section h1 { font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.hero-desc { margin-top: 6px; color: var(--gray-500); font-size: .92rem; }
.btn-logout { position: absolute; top: 0; right: 0; background: none; border: 1px solid var(--gray-300); color: var(--gray-500); padding: 6px 14px; border-radius: 20px; font-size: .8rem; cursor: pointer; }
.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* Login */
.login-wrap { display: flex; justify-content: center; padding-top: 48px; }
.login-card { width: 100%; max-width: 420px; }
.login-hint { color: var(--gray-500); font-size: .88rem; margin-bottom: 16px; }
.input { width: 100%; padding: 12px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .95rem; color: var(--ink); background: var(--white); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.login-card .input { margin-bottom: 14px; }

/* Search panel (top) + results (bottom) */
.search-panel { margin-bottom: 20px; }
.search-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-input { flex: 1 1 320px; min-width: 240px; }
.search-btn { width: auto; padding: 12px 28px; flex: 0 0 auto; }
.tip-inline { margin-top: 12px; font-size: .8rem; color: var(--gray-500); }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--gray-100); }
.card-header h2 { font-size: .9rem; font-weight: 700; color: var(--gray-700); }
.card-body { padding: 16px 18px; }

/* Fields */
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio { display: flex; align-items: center; gap: 5px; font-size: .84rem; color: var(--gray-700); cursor: pointer; padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: 20px; white-space: nowrap; }
.radio input { accent-color: var(--blue); }
.radio:has(input:checked) { background: var(--blue-bg); border-color: var(--blue); }

/* Run button */
.btn-run {
  width: 100%; padding: 14px; font-size: 1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--blue), #1a5af0);
  color: var(--white); border: none; border-radius: var(--radius);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s, transform .1s;
}
.btn-run:hover { opacity: .92; transform: translateY(-1px); }

/* Status message */
.status-msg { min-height: 20px; margin-top: 10px; font-size: .84rem; color: var(--red); text-align: center; }
.status-msg.ok { color: var(--green); }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty-icon { font-size: 2.4rem; margin-bottom: 8px; }

/* Results */
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-actions { display: flex; gap: 8px; }
.btn-sm { background: var(--gray-50); border: 1px solid var(--gray-300); color: var(--gray-700); padding: 5px 12px; border-radius: var(--radius-sm); font-size: .8rem; cursor: pointer; }
.btn-sm:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }

.table-scroll { padding: 0; overflow-x: auto; }
.result-table { width: 100%; border-collapse: collapse; font-size: .82rem; white-space: nowrap; }
.result-table thead th {
  position: sticky; top: 0; background: var(--gray-50); color: var(--gray-700);
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); font-weight: 600;
}
.result-table tbody td { padding: 9px 14px; border-bottom: 1px solid var(--gray-100); color: var(--ink-light); }
.result-table tbody tr:hover { background: var(--gray-50); }
.result-table td.gene { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .78rem; color: var(--ink); font-weight: 600; }
.result-table td.stop { color: var(--red); font-weight: 600; }
.result-table td.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .78rem; }
.result-table td.aa-change { font-weight: 600; color: var(--ink); white-space: nowrap; }

.arath-link { color: var(--blue); text-decoration: none; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .78rem; }
.arath-link:hover { text-decoration: underline; }

.result-table td.blast { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .74rem; color: var(--gray-500); white-space: nowrap; }
.result-table td.func { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.zyg { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.zyg-hom { background: var(--red-bg); color: var(--red); }
.zyg-het { background: var(--blue-bg); color: var(--blue); }

/* Responsive */
@media (max-width: 860px) {
  .btn-logout { position: static; display: inline-block; margin-top: 10px; }
}
@media (max-width: 540px) {
  .header-inner { padding: 0 14px; }
  .main { padding: 20px 14px 36px; }
  .hero-section h1 { font-size: 1.3rem; }
  .result-actions { flex-direction: column; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search-btn { width: 100%; }
  .radio-row { justify-content: center; }
}
