/* R260 style.css · split-panel · v1.0 */
:root {
  --primary: #2563EB;
  --secondary: #3B82F6;
  --accent: #F59E0B;
  --bg: #EFF6FF;
  --card: #FFFFFF;
  --text: #1E3A8A;
  --text-secondary: #3B82F6;
  --border: #BFDBFE;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --tile-bg: #DBEAFE;
  --contact-footer-h: 92px;
  --segment-h: 88px;
  --compare-bar-h: 52px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-chrome-h: calc(var(--contact-footer-h) + var(--safe-area-bottom));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}
body.has-contact-footer { padding-bottom: calc(var(--contact-footer-h) + var(--segment-h) + 12px + var(--safe-area-bottom)); }
body.has-compare-bar { padding-bottom: calc(var(--contact-footer-h) + var(--segment-h) + var(--compare-bar-h) + 12px + var(--safe-area-bottom)); }

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-header { padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.app-header h1 { font-size: 17px; }
.app-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
.header-share { font-size: 16px; padding: 8px; color: var(--primary); }

.segment-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 99;
}
.segment-btn {
  border: none;
  background: var(--tile-bg);
  color: var(--text);
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.segment-btn.active { background: var(--primary); color: #fff; }

#main { padding: 12px 16px 20px; min-height: 40vh; }

.btn { border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 600; min-height: 44px; cursor: pointer; display: inline-block; text-align: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: var(--card); border: 2px solid var(--border); color: var(--text); }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.form-group { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 4px; background: #fff; color: var(--text); }

.chip { border: 1px solid var(--border); background: var(--card); padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip-col { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--tile-bg); color: var(--primary); font-weight: 600; }
.badge-warn { background: #FEF3C7; color: #92400E; }
.mode-remote { background: #DBEAFE; color: #1D4ED8; }
.mode-offline { background: #FEE2E2; color: #B91C1C; }
.mode-hybrid { background: #EDE9FE; color: #6D28D9; }

.hero-block h2 { font-size: 18px; margin-bottom: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.stat-item { text-align: center; background: var(--tile-bg); border-radius: 10px; padding: 8px; }
.stat-icon { font-size: 20px; }
.stat-num { display: block; font-size: 18px; font-weight: 700; color: var(--primary); }
.hero-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.split-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 400px) {
  .split-panel { grid-template-columns: 38% 62%; align-items: start; }
}
.split-left { font-size: 12px; }
.split-title { font-size: 14px; margin-bottom: 8px; }
.split-right { min-width: 0; }

.project-list { display: flex; flex-direction: column; gap: 8px; }
.project-card { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.project-top { display: flex; gap: 10px; align-items: flex-start; }
.proj-emoji { font-size: 28px; flex-shrink: 0; }
.proj-emoji.large { font-size: 40px; }
.project-head { flex: 1; min-width: 0; }
.project-head strong { display: block; font-size: 14px; }
.match-badge { font-size: 11px; font-weight: 700; color: var(--success); white-space: nowrap; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.project-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.icon-btn { border: none; background: transparent; font-size: 18px; color: var(--text-secondary); cursor: pointer; }
.icon-btn.active { color: var(--warning); }

.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.qual-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.qual-row.ok { color: var(--success); }
.qual-row.fail { color: var(--danger); }

.info-list { list-style: none; }
.info-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-list li span { color: var(--text-secondary); }

.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sticky-actions .btn { min-height: 40px; font-size: 12px; padding: 8px; }

.step-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--tile-bg); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.step-dot.active { background: var(--primary); color: #fff; }
.step-dot.done { background: var(--success); color: #fff; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

.timeline { list-style: none; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-left: 2px solid var(--border); margin-left: 12px; padding-left: 16px; opacity: 0.5; }
.timeline-item.done { opacity: 1; border-left-color: var(--success); }
.timeline-item.active { opacity: 1; border-left-color: var(--primary); }
.timeline-item.active .tl-icon { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.tl-icon { font-size: 20px; }

.compare-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--contact-footer-h) + var(--safe-area-bottom));
  background: var(--card); border-top: 1px solid var(--border);
  padding: 8px 12px; display: flex; align-items: center; gap: 8px; z-index: 800; font-size: 12px;
}
.compare-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.compare-table th, .compare-table td { border: 1px solid var(--border); padding: 6px; }
.diff-row { background: #FEF9C3; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 950; }
.modal { max-width: 360px; width: 100%; max-height: 90vh; overflow-y: auto; }
.quiz-q { font-size: 15px; margin: 12px 0; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.poster-preview { max-width: 100%; border-radius: 8px; }

.theme-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-pill { border: 1px solid var(--border); background: var(--tile-bg); padding: 8px 12px; border-radius: 999px; font-size: 11px; cursor: pointer; }
.theme-pill.active { background: var(--primary); color: #fff; }

.empty-hint, .empty-state { text-align: center; padding: 20px; color: var(--text-secondary); font-size: 13px; }
.section-title { font-size: 16px; margin-bottom: 10px; }
.meta { font-size: 12px; color: var(--text-secondary); }
.back-btn { margin-bottom: 10px; }

.share-main { padding: 24px 16px; min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.share-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px; text-align: center; width: 100%; }
.share-icon { font-size: 40px; margin-bottom: 8px; }
.share-slogan { color: var(--text-secondary); font-size: 13px; margin: 8px 0 16px; }
.share-qr { display: flex; justify-content: center; margin: 12px 0; }
.share-link { font-size: 11px; color: var(--text-secondary); margin-bottom: 12px; word-break: break-all; }

.toast-container { position: fixed; left: 50%; bottom: calc(var(--bottom-chrome-h) + var(--segment-h) + 16px); transform: translateX(-50%); z-index: 9999; pointer-events: none; }
.toast-item { background: rgba(0,0,0,0.78); color: #fff; padding: 10px 16px; border-radius: 10px; margin-top: 6px; opacity: 0; transition: opacity 0.3s; font-size: 13px; max-width: 90vw; }
.toast-item.show { opacity: 1; }
.toast-warn { background: rgba(245, 158, 11, 0.92); }

.contact-footer { position: fixed; left: 0; right: 0; bottom: 0; background: #1a1a1a; z-index: 850; padding: 0.55rem 0.75rem calc(0.55rem + var(--safe-area-bottom)); min-height: var(--contact-footer-h); }
.contact-footer__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 88px)); justify-content: center; gap: 0.4rem; max-width: 320px; margin: 0 auto; }
.contact-footer__cta, .contact-footer__btn { display: flex; align-items: center; justify-content: center; min-height: 36px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.contact-footer__cta { background: #E87722 !important; color: #fff; }
.contact-footer__btn { background: #333; color: #fff; border: none; cursor: pointer; }
.contact-footer__brand { text-align: center; color: #888; font-size: 10px; margin-top: 6px; }

body.has-contact-footer .zw-root .zw-fab,
body.has-contact-footer .em-entry-btn {
  bottom: calc(var(--contact-footer-h) + var(--segment-h) + 12px + var(--safe-area-bottom)) !important;
}
.editable-field { outline: 2px dashed var(--warning); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
