/* === Gene Editing Assistant - Framework CSS === */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(rgba(240,244,240,0.88), rgba(240,244,240,0.88)), url('/static/bg_page.png') center/cover no-repeat fixed;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px 80px;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* === Header === */
header {
  text-align: center;
  padding: 24px 0 16px;
}
header h1 {
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 50%, #43a047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
header h1 a {
  text-decoration: none;
  color: inherit;
}
.subtitle {
  font-size: 14px;
  color: #8d9a8d;
  margin-top: 10px;
}

/* === Edit Type Cards === */
.edit-cards {
  display: flex;
  gap: 14px;
  justify-content: center;
}
.edit-card {
  flex: 0 0 200px;
  background: #fff;
  border: 2px solid #e8ece8;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: #333;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 6px 14px rgba(0,0,0,0.06);
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.3s;
}
.edit-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.edit-card.selected {
  border-color: #4CAF50;
  box-shadow: 0 6px 12px rgba(76,175,80,0.12), 0 12px 28px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}
.edit-card-title {
  padding: 12px 16px 10px;
  font-size: 17px;
  font-weight: 700;
  color: #333;
}
.edit-card-img {
  height: 120px;
  background-size: cover;
  background-position: center;
  border-radius: 0 0 12px 12px;
}
.edit-card[data-type="knockout"] .edit-card-img {
  background-image: url('/static/bg_knockout.png');
}
.edit-card[data-type="knockin"] .edit-card-img {
  background-image: url('/static/bg_knockin.png');
}
.edit-card[data-type="mutation"] .edit-card-img {
  background-image: url('/static/bg_mutation.png');
}

/* === Tool Grid (首页) === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 10px 0;
}

.tool-card {
  flex: 0 0 200px;
  background: #fff;
  border: 2px solid #e8ece8;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: #333;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 6px 14px rgba(0,0,0,0.06);
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.3s;
}

.tool-card:hover {
  border-color: #4CAF50;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.tool-card-title {
  padding: 12px 16px 10px;
  font-size: 17px;
  font-weight: 700;
  color: #333;
}

.tool-card-desc {
  padding: 0 16px 16px;
  font-size: 12px;
  color: #8d9a8d;
  line-height: 1.5;
}

.tool-card-img {
  flex: 1;
  min-height: 100px;
  background-size: cover;
  background-position: center;
  border-radius: 0 0 12px 12px;
}
.tool-card[data-tool="knockout"] .tool-card-img {
  background-image: url('/static/bg_knockout.png');
}
.tool-card[data-tool="knockin"] .tool-card-img {
  background-image: url('/static/bg_knockin.png');
}
.tool-card[data-tool="mutation"] .tool-card-img {
  background-image: url('/static/bg_mutation.png');
}

/* === Card === */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.3s;
}

/* === Form === */
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.inline { flex-direction: row; align-items: center; }
.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: #556b55;
  min-width: 90px;
}

input[type="text"] {
  border: none;
  border-bottom: 2px solid #e0e5e0;
  padding: 10px 0;
  font-size: 15px;
  color: #333;
  outline: none;
  transition: border-color 0.25s;
  background: transparent;
  flex: 1;
}
input[type="text"]:focus { border-bottom-color: #4CAF50; }
input[type="text"]::placeholder { color: #bcc4bc; }

select {
  border: none;
  border-bottom: 2px solid #e0e5e0;
  padding: 10px 0;
  font-size: 15px;
  color: #333;
  outline: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}
select:focus {
  border-bottom-color: #4CAF50;
}

.form-row-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-row-group input {
  flex: 1;
}
.form-separator {
  font-size: 14px;
  color: #8d9a8d;
}

.transcript-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transcript-input-group select {
  width: 100%;
}

.radio-group { display: flex; gap: 20px; }
.radio {
  font-size: 14px;
  color: #555;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.radio input[type="radio"] { accent-color: #4CAF50; }
.radio input:disabled { opacity: 0.45; }

/* === Dev Note === */
.dev-note {
  font-size: 12px;
  color: #b0b8b0;
  font-style: italic;
  text-align: center;
}

/* === Buttons === */
.btn-primary {
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  width: 100%;
}
.btn-primary:hover { background: #43a047; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #a5d6a7; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: #4CAF50;
  border: 2px solid #4CAF50;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover {
  background: #4CAF50;
  color: #fff;
}
.btn-secondary:active { transform: scale(0.98); }

/* === Progress === */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #777;
}
.progress-header span:first-child { color: #333; font-weight: 500; }

.progress-bar-track {
  height: 6px;
  background: #e8f0e8;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #66bb6a, #4CAF50);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-log {
  font-size: 12px;
  color: #8d9a8d;
  max-height: 130px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* === Result === */
.result-status {
  font-size: 18px;
  font-weight: 700;
}
.result-status.success { color: #2e7d32; }
.result-status.error { color: #e53935; }

.result-info {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-warnings {
  font-size: 12px;
  color: #e67e22;
  line-height: 1.7;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

/* === Developer Credit === */
.dev-credit {
  position: fixed;
  bottom: 16px;
  right: 20px;
  font-size: 11px;
  color: #a0aba0;
}

/* === Utility === */
.hidden { display: none; }
