html, body { 
  height: 100%; 
}

html { 
  -webkit-text-size-adjust: 100%; 
}

*, *::before, *::after { 
  box-sizing: border-box; 
}

body {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 12px;
  background: #f8f9fa;
  color: #111;
}

.header {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 800;
  color: #1a73e8;
}

.subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 0;
}

/* 统计数据 - 一行显示 */
.stats {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  text-align: center;
}

.stats-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-number.total {
  color: #1a73e8;
}

.stat-number.ready {
  color: #137333;
}

.stat-number.processing {
  color: #f9ab00;
}

.stat-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.controls {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 表单布局调整 */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  flex: 1;
}

/* 添加手机号行和搜索行 - 同一行布局 */
.add-phone-row, .search-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.add-phone-row .form-group, .search-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

input[type="text"], input[type="search"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="search"]:focus {
  outline: none;
  border-color: #1a73e8;
}

.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.btn-primary {
  background: #1a73e8;
  color: white;
}

.btn-primary:hover {
  background: #1557b0;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f1f3f4;
  color: #333;
}

.btn-secondary:hover {
  background: #e8eaed;
}

.data-container {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-header {
  background: #f8f9fa;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-title {
  font-weight: 600;
  color: #333;
}

.list {
  max-height: calc(100vh - 400px);
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e1e5e9;
  transition: all 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  align-items: flex-start;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 8px;
}

.row:hover {
  background: #f8f9fa;
  padding: 12px 16px;
  margin: 0 -16px;
}

.col-label {
  width: 80px;
  flex: 0 0 80px;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  padding-top: 2px;
}

.col-value {
  flex: 1;
  font-size: 16px;
  word-break: break-all;
  color: #333;
  text-decoration: none;
}

.col-value.waiting {
  color: #f9ab00;
  font-style: italic;
}

.col-value.empty {
  color: #ccc;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #137333;
}

.toast.error {
  background: #d93025;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* 响应式布局 */
@media (max-width: 768px) {
  /* 小屏幕下统计保持一行但缩小 */
  .stat-number {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  .stats-grid {
    gap: 12px;
  }
  
  /* 小屏幕下表单元素堆叠 */
  .form-row, .add-phone-row, .search-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .add-phone-row .btn, .search-row .btn {
    margin-top: 8px;
  }
  
  .col-label {
    width: 70px;
    flex: 0 0 70px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  .header {
    padding: 16px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  .stats {
    padding: 16px;
  }
  
  .stat-number {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 11px;
  }
  
  .controls {
    padding: 16px;
  }
}