/* 
  Linear-style / Vercel-style Design System 
  Focus: Typography, Spacing, Subtle Borders, No Clutter
*/

:root {
  /* Reuse RadarAI main site tokens */
  --pm-bg: var(--bg-secondary);
  --pm-card-bg: var(--card-bg);
  --pm-text-primary: var(--text);
  --pm-text-secondary: var(--text-muted);
  --pm-text-tertiary: var(--text-muted);
  --pm-border: var(--border);
  --pm-border-hover: #cfcfcf;
  --pm-accent: var(--accent);
  --pm-accent-hover: var(--accent);
  --pm-accent-light: var(--accent-soft);
  --pm-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --pm-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --pm-shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --pm-radius: 12px;
  --pm-radius-sm: 8px;
  --pm-font-sans: "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pm-font-mono: "JetBrains Mono", "SF Mono", monospace;
  
  /* Feasibility Colors (5 Tiers) */
  --score-s: #10b981; /* Emerald 500 */
  --score-a: #3b82f6; /* Blue 500 */
  --score-b: #f59e0b; /* Amber 500 */
  --score-c: #f97316; /* Orange 500 */
  --score-d: #ef4444; /* Red 500 */
}

/* Base */
.pm-v2-body {
  background-color: var(--bg);
  color: var(--pm-text-primary);
  font-family: var(--pm-font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.pm-v2-body .container {
  max-width: 1280px;
}

.pm-v2-body .breadcrumb {
  margin-bottom: 0;
}

.pm-hero,
.status-bar,
.pm-dashboard {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.pm-hero {
  padding-top: 2.6rem;
  padding-bottom: 1.25rem;
}

/* Input Section - Hero Mode */
.pm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 430px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.pm-hero.collapsed {
  min-height: auto;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--pm-border);
  margin-bottom: 2rem;
  align-items: center;
}

.pm-title-wrap {
  text-align: center;
  margin-bottom: 3rem; /* Increased spacing */
  transition: all 0.5s ease;
}

.pm-hero.collapsed .pm-title-wrap {
  display: none; 
}

.pm-title {
  font-size: 2.8rem; /* Larger */
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}

.pm-subtitle {
  color: var(--pm-text-secondary);
  font-size: 1.2rem;
  font-weight: 400;
}

/* Input Box - Redesigned for "Airy" feel */
.pm-input-group {
  width: 100%;
  max-width: 720px; /* zh default */
  background: var(--pm-card-bg);
  border: 1px solid var(--pm-border);
  border-radius: 20px; /* Softer radius */
  box-shadow: 0 8px 30px rgba(0,0,0,0.08); /* Softer, deeper shadow */
  padding: 1rem; /* More internal padding */
  transition: all 0.3s ease;
  position: relative;
  box-sizing: border-box;
  margin: 0 auto;
}

.pm-icon {
  display: inline-block;
  flex-shrink: 0;
  color: currentColor;
}
.pm-btn-icon .pm-icon {
  opacity: 0.92;
}
.pm-btn-icon:hover .pm-icon,
.pm-btn-icon.active .pm-icon {
  opacity: 1;
}

/* 英文版：输入区略宽一点 */
html[lang="en"] .pm-hero,
html[lang="en"] .status-bar,
html[lang="en"] .pm-dashboard {
  max-width: 1200px;
}
html[lang="en"] .pm-input-group {
  max-width: 980px;
}

.pm-input-group:focus-within {
  border-color: var(--pm-accent); /* Radar Red focus */
  box-shadow: 0 12px 40px rgba(46, 134, 222, 0.12);
  transform: translateY(-2px);
}

.pm-textarea-v2 {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.5rem 0.5rem 1.5rem; /* Breathing room */
  font-size: 1.2rem; /* Larger text */
  font-family: var(--pm-font-sans);
  resize: none;
  min-height: 80px; /* Taller */
  outline: none;
  color: var(--pm-text-primary);
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}

.pm-textarea-v2::placeholder {
  color: #bbb;
  font-weight: 300;
}

.pm-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
  border-top: 1px solid #f0f0f0; /* Subtle divider */
  padding-top: 1rem;
  transition: border-color 0.2s;
}

.pm-input-group:focus-within .pm-controls {
  border-top-color: #eee;
}

.pm-options {
  display: flex;
  gap: 0.8rem;
}

.pm-btn-icon {
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  color: var(--pm-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  font-weight: 500;
}

.pm-btn-icon:hover, .pm-btn-icon.active {
  background: #fff;
  border-color: var(--pm-border);
  color: var(--pm-text-primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pm-btn-submit {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pm-btn-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(46, 134, 222, 0.18);
}

.pm-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Expanded Inputs (URL & Extra) */
.pm-extra-inputs {
  display: none;
  padding: 0 0.5rem 1.5rem;
  gap: 0.8rem;
  animation: slideDown 0.2s ease;
}

.pm-extra-inputs.show {
  display: flex;
  flex-direction: column;
}

.pm-input-line {
  width: 100%;
  border: 1px solid var(--pm-border);
  background: #fafafa;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}

.pm-input-line:focus {
  background: #fff;
  border-color: var(--pm-accent);
}

.pm-inline-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pm-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.pm-inline-help {
  font-size: 0.85rem;
  color: var(--pm-text-tertiary);
  line-height: 1.4;
}

/* Dashboard Grid (Bento) */
.pm-dashboard {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(100px, auto);
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  width: 100%;
}

.pm-dashboard.visible {
  opacity: 1;
  transform: translateY(0);
}

.pm-card-v2 {
  background: var(--pm-card-bg);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 1.8rem;
  box-shadow: var(--pm-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pm-card-v2:hover {
  border-color: var(--accent);
  box-shadow: var(--pm-shadow-md);
}

/* Card Specifics */
.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }
.col-span-3 { grid-column: span 3; }

/* Feasibility Card */
.card-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--pm-font-mono);
  color: var(--pm-text-primary);
}

.score-text {
  flex: 1;
  margin-left: 2rem;
}

.score-tier {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.score-reason {
  color: var(--pm-text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* List Items (MVP, Questions) */
.pm-list-item {
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
  min-width: 0;
}
.pm-list-item:last-child { border-bottom: none; }

.pm-item-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.3rem; overflow-wrap: anywhere; word-break: break-word; color: #222; }
.pm-item-desc { font-size: 0.9rem; color: var(--pm-text-secondary); overflow-wrap: anywhere; word-break: break-word; line-height: 1.5; }

/* Tech Stack */
.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.stack-tag {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--pm-font-mono);
  color: #444;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  padding: 0.8rem 1.2rem;
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 99px;
  font-size: 0.95rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: var(--pm-shadow-sm);
  color: var(--pm-text-secondary);
}
.status-bar.show { opacity: 1; }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--pm-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 768px) {
  .pm-dashboard { display: flex; flex-direction: column; }
  .pm-title { font-size: 2rem; }
  .pm-hero { padding-top: 2.5rem; min-height: auto; }
  .pm-controls { gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
  .pm-options { width: 100%; justify-content: flex-start; }
  .pm-btn-submit { width: 100%; justify-content: center; }
  .card-score { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .score-text { margin-left: 0; }
  .col-span-8, .col-span-4 { grid-column: span 12; }
}
