/* 火种小店经营助手 - 全局样式 */

:root {
  --primary: #E8590C;
  --primary-light: #FFF3E8;
  --primary-dark: #C44A00;
  --success: #2B8A3E;
  --warning: #E67700;
  --danger: #C92A2A;
  --gray-0: #F8F9FA;
  --gray-1: #F1F3F5;
  --gray-2: #E9ECEF;
  --gray-3: #DEE2E6;
  --gray-4: #CED4DA;
  --gray-5: #ADB5BD;
  --gray-7: #495057;
  --gray-8: #343A40;
  --gray-9: #212529;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-0);
  color: var(--gray-9);
  line-height: 1.6;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-2); color: var(--gray-8); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 16px 32px; font-size: 18px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-7);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-3);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary); }
textarea.form-input { min-height: 80px; resize: vertical; }

/* Badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-warning { background: #FFF3BF; color: #995A00; }
.badge-success { background: #D3F9D8; color: #1B6B2F; }
.badge-danger { background: #FFE3E3; color: #A51D1D; }
.badge-info { background: #D0EBFF; color: #155A8A; }

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 16px;
  text-align: center;
}
.header h1 { font-size: 20px; font-weight: 700; }
.header p { font-size: 14px; opacity: 0.85; margin-top: 4px; }

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.status-bar.success { background: #D3F9D8; color: #1B6B2F; }
.status-bar.info { background: #D0EBFF; color: #155A8A; }
.status-bar.warning { background: #FFF3BF; color: #995A00; }

/* Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* Responsive table */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--gray-2);
  white-space: nowrap;
}
th {
  background: var(--gray-1);
  font-weight: 600;
  color: var(--gray-7);
  position: sticky;
  top: 0;
}

/* Voice button */
.voice-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 40px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.voice-btn:active { transform: scale(0.9); }
.voice-btn.recording {
  background: var(--danger);
  animation: pulse 1s infinite;
}
.voice-btn.recording::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--danger);
  animation: ripple 1.5s infinite;
}
@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Mobile nav tabs */
.tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid var(--gray-2);
  overflow-x: auto;
}
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-5);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab:hover { color: var(--gray-7); }

/* Layout helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-gray { color: var(--gray-5); }
.font-bold { font-weight: 700; }
