:root {
  --primary: #0D9488;
  --primary-light: #14B8A6;
  --primary-dark: #0F766E;
  --accent: #ff8f00;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #212121;
  --text-light: #757575;
  --border: #e0e0e0;
  --danger: #c62828;
  --success: #2e7d32;
  --warning: #f9a825;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
#root { min-height: 100vh; }

nav { background: var(--primary); color: white; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.nav-brand { font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-btn { background: none; border: none; color: white; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.2s; white-space: nowrap; position: relative; text-decoration: none; display: inline-flex; align-items: center; }
.nav-btn:hover { background: rgba(255,255,255,0.15); }
.nav-btn.active { background: rgba(255,255,255,0.25); }
.badge { background: var(--accent); color: white; border-radius: 10px; padding: 1px 6px; font-size: 11px; position: absolute; top: 2px; right: 2px; }
.nav-user { color: rgba(255,255,255,0.9); font-size: 14px; font-weight: 600; padding: 0 8px; }

.page-container { max-width: 800px; margin: 0 auto; padding: 16px; }
.page-full { max-width: 100%; padding: 0; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; border: 1px solid var(--border); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 16px; transition: border-color 0.2s; font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-outline { background: none; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

.hero { text-align: center; padding: 40px 16px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; margin: -16px -16px 24px; }
.hero h1 { font-size: 28px; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: 0.9; max-width: 500px; margin: 0 auto 24px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-btn { padding: 14px 28px; border-radius: 12px; font-size: 16px; font-weight: 700; border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.hero-btn-seek { background: white; color: var(--primary); }
.hero-btn-help { background: var(--accent); color: white; }

.landing { display: flex; flex-direction: column; height: calc(100vh - 56px); overflow: hidden; }
.landing-hero { flex: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, #0FA89E 50%, var(--primary-light) 100%); color: white; padding: 32px 24px; text-align: center; }
.landing-hero h1 { font-size: 44px; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.5px; max-width: 700px; line-height: 1.2; }
.landing-hero .subtitle { font-size: 18px; opacity: 0.95; max-width: 520px; line-height: 1.6; margin-bottom: 28px; }
.landing-info-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.info-btn { padding: 12px 28px; border-radius: 12px; font-size: 15px; font-weight: 600; border: 2px solid rgba(255,255,255,0.6); background: rgba(255,255,255,0.15); color: white; cursor: pointer; transition: all 0.2s; }
.info-btn:hover { background: rgba(255,255,255,0.3); border-color: white; transform: translateY(-1px); }
.landing-register-hint { font-size: 14px; opacity: 0.85; }
.subtitle-link { color: white; font-weight: 700; text-decoration: underline; white-space: nowrap; cursor: pointer; }
.subtitle-link:hover { opacity: 1; }
.landing-register-hint a { color: white; font-weight: 700; text-decoration: underline; }
.landing-register-hint a:hover { opacity: 1; }

.landing-bottom { flex: 2; display: flex; align-items: center; justify-content: center; gap: 24px; background: white; padding: 24px; flex-wrap: wrap; }
.action-btn { padding: 20px 48px; border-radius: 14px; font-size: 20px; font-weight: 800; letter-spacing: 0.5px; border: none; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.action-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,0.18); }
.action-btn-seek { background: var(--primary); color: white; }
.action-btn-seek:hover { background: var(--primary-dark); }
.action-btn-help { background: var(--accent); color: white; }
.action-btn-help:hover { background: #e68200; }

@media (max-width: 600px) {
  .landing-hero h1 { font-size: 28px; }
  .landing-hero .subtitle { font-size: 15px; margin-bottom: 20px; }
  .landing-info-btns { gap: 8px; }
  .info-btn { padding: 10px 18px; font-size: 13px; }
  .landing-bottom { flex-direction: column; gap: 14px; padding: 20px; }
  .action-btn { width: 100%; max-width: 300px; padding: 18px 24px; font-size: 18px; }
}

.need-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.need-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.need-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.need-category { display: inline-block; background: #CCFBF1; color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.need-time { color: var(--text-light); font-size: 12px; }
.need-desc { font-size: 15px; line-height: 1.5; margin-bottom: 12px; }
.need-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.need-user { color: var(--text-light); font-size: 13px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cat-item { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; transition: all 0.2s; font-size: 14px; font-weight: 500; }
.cat-item:hover { border-color: var(--primary); }
.cat-item.selected { border-color: var(--primary); background: #CCFBF1; }
.cat-icon { font-size: 28px; margin-bottom: 8px; }

.map-box { width: 100%; height: 400px; border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; border: 2px solid var(--border); position: relative; }
.map-toolbar { display: flex; gap: 8px; margin-bottom: 8px; position: relative; }
.map-toolbar input { flex: 1; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; }
.map-toolbar input:focus { border-color: var(--primary); outline: none; }
.map-toolbar button { white-space: nowrap; }
.map-search-results { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto; z-index: 1000; box-shadow: var(--shadow); }
.map-search-results div { padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border); }
.map-search-results div:hover { background: #CCFBF1; }
.map-search-results div:last-child { border-bottom: none; }
.locate-btn { background: var(--primary); color: white; border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s; }
.locate-btn:hover { background: var(--primary-dark); }
.location-display { font-size: 14px; color: var(--primary); font-weight: 500; min-height: 20px; margin-bottom: 12px; }
.browse-map { width: 100%; height: 450px; }

.chat-container { display: flex; flex-direction: column; height: calc(100vh - 160px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; font-size: 15px; line-height: 1.4; word-wrap: break-word; }
.chat-bubble.sent { background: var(--primary); color: white; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.received { background: #e8e8e8; border-bottom-left-radius: 4px; }
.chat-meta { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.chat-input-area { display: flex; gap: 8px; padding: 12px 16px; background: var(--card); border-top: 1px solid var(--border); }
.chat-input-area input { flex: 1; }

.disclaimer { background: #fff3e0; border: 1px solid #ffe0b2; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.disclaimer strong { color: var(--accent); }
.personal-info-warning { background: #fff3e0; border: 1px solid var(--warning); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #e65100; margin: 0 16px 8px; }
.trust-badge { display: inline-flex; align-items: center; gap: 4px; background: #CCFBF1; color: var(--primary); padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); padding-bottom: 4px; }
.tab { padding: 8px 16px; border: none; background: none; font-size: 14px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -6px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.stars { display: flex; gap: 4px; }
.star { font-size: 28px; cursor: pointer; color: #ddd; }
.star.filled { color: var(--accent); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: white; font-size: 13px; cursor: pointer; }
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

.stats-row { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.stat-box { text-align: center; padding: 16px; background: rgba(255,255,255,0.15); border-radius: var(--radius); min-width: 100px; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; opacity: 0.8; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: white; border-radius: var(--radius); padding: 24px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-bottom: 16px; }

.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { text-align: center; padding: 40px; }

.toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; pointer-events: none; }
.toast { background: var(--text); color: white; padding: 12px 20px; border-radius: 8px; margin-top: 8px; font-size: 14px; animation: slideUp 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.warning { background: var(--accent); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.empty { text-align: center; padding: 40px; color: var(--text-light); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 22px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-btn { width: 100%; max-width: 280px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stats-row { flex-wrap: wrap; }
}
