/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #6366f1;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Input Section */
.input-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.input-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
}

#verify-btn {
  padding: 0.875rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#verify-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

#verify-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Example buttons */
.examples {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.example-btn {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s;
}

.example-btn:hover {
  background: #dbeafe;
}

/* Error Message */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  color: var(--danger);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Results */
.results-section {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Verdict Badge */
.verdict-badge {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.verdict-badge .verdict-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.verdict-badge .verdict-label {
  font-size: 1.25rem;
  font-weight: 700;
}

.verdict-badge .confidence-label {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

.verdict-supported {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: var(--success);
}

.verdict-partially_supported {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: var(--warning);
}

.verdict-not_supported {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  color: var(--danger);
}

.verdict-insufficient_evidence {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--info);
}

/* Tabs */
.tab-switcher {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--border);
  border-radius: 8px;
  padding: 3px;
}

.tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.summary-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* Papers */
.papers-section {
  margin-bottom: 1.5rem;
}

.papers-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.paper-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}

.paper-card:hover {
  box-shadow: var(--shadow-lg);
}

.paper-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--primary);
}

.paper-title a {
  color: inherit;
  text-decoration: none;
}

.paper-title a:hover {
  text-decoration: underline;
}

.paper-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.paper-relevance {
  font-size: 0.85rem;
  color: var(--text);
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

/* Limitations */
.limitations-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 1.5rem;
}

.limitations-box::before {
  content: "⚠ 検証の限界：";
  font-weight: 700;
  display: block;
  margin-bottom: 0.3rem;
}

/* Footer */
footer {
  margin-top: 2rem;
  text-align: center;
}

.disclaimer {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.credits {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.4rem;
  }

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