:root {
  --bg: #08111f;
  --bg-2: #0d1727;
  --card: rgba(255,255,255,0.06);
  --card-2: rgba(255,255,255,0.09);
  --line: rgba(255,255,255,0.08);
  --text: #f3f7fd;
  --muted: #a6b2c8;
  --accent: #4da3ff;
  --accent-2: #6b7cff;
  --success: #48d27c;
  --warning: #f1c75b;
  --danger: #ff7d7d;
  --shadow: 0 22px 50px rgba(0,0,0,0.33);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(77,163,255,0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(107,124,255,0.18), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body {
  min-height: 100vh;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.hero,
.section {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.hero {
  padding: 18px 16px;
}

.compact-hero .hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.brand-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.brand-text {
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(77,163,255,0.14);
  border: 1px solid rgba(77,163,255,0.22);
  color: #cfe4ff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.02;
  font-weight: 800;
}

.hero-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 520px;
}

.admin-link {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.section {
  margin-top: 16px;
  padding: 18px 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(77,163,255,0.25), rgba(107,124,255,0.22));
  border-color: rgba(77,163,255,0.35);
  box-shadow: 0 0 0 1px rgba(77,163,255,0.10) inset;
}

.solve-panel {
  display: none;
  gap: 14px;
}

.solve-panel.active {
  display: grid;
}

.input-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.task-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 16px;
  font-size: 15px;
  line-height: 1.65;
  outline: none;
}

.task-input::placeholder {
  color: #8d9bb3;
}

.upload-box {
  display: block;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 20px;
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-inner {
  text-align: center;
}

.upload-icon {
  font-size: 34px;
  margin-bottom: 10px;
}

.upload-title {
  font-size: 17px;
  font-weight: 800;
}

.upload-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.photo-preview-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.photo-preview {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: contain;
  background: #0b1220;
}

.hidden {
  display: none !important;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, filter .15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.75;
  cursor: default;
}

.btn-main {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.status-section {
  padding-top: 14px;
  padding-bottom: 14px;
}

.status-box {
  background: rgba(77,163,255,0.10);
  border: 1px solid rgba(77,163,255,0.18);
  border-radius: 18px;
  padding: 14px 16px;
}

.status-box.success {
  background: rgba(72,210,124,0.10);
  border-color: rgba(72,210,124,0.20);
}

.status-box.error {
  background: rgba(255,125,125,0.10);
  border-color: rgba(255,125,125,0.20);
}

.status-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.status-text {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.result-grid {
  display: grid;
  gap: 14px;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.answer-card {
  border-color: rgba(72,210,124,0.25);
  box-shadow: 0 0 0 1px rgba(72,210,124,0.08) inset;
  background: linear-gradient(180deg, rgba(72,210,124,0.08), rgba(255,255,255,0.05));
}

.result-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

.result-body {
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.task-body {
  color: #e8eefb;
}

.answer-body {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.55;
}

.reasoning-body {
  color: #eef3fd;
}

.note-box {
  background: rgba(255, 196, 86, 0.08);
  border: 1px solid rgba(255, 196, 86, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
}

.note-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.note-text {
  color: #efe6bf;
  line-height: 1.65;
  font-size: 14px;
}

@media (max-width: 720px) {
  .page {
    padding: 10px 10px 22px;
  }

  .hero,
  .section {
    border-radius: 22px;
  }

  .compact-hero .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    align-items: center;
  }

  .hero h1 {
    font-size: 28px;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .section-head h2 {
    font-size: 22px;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .answer-body {
    font-size: 18px;
  }
}
