/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* 页面容器 */
.page {
  min-height: 100vh;
}

/* 登录页 */
.login-box {
  max-width: 360px;
  margin: 80px auto;
  padding: 40px 30px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-box p {
  color: #666;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.login-box input:focus {
  border-color: #e67e22;
}

.login-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 8px;
}

/* 主页面 */
.app-header {
  background: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 20px;
}

.btn-icon {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.stat-card {
  background: white;
  padding: 20px 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-num {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: #e67e22;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #666;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
}

.filter-bar select,
.filter-bar input {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: white;
}

.filter-bar select {
  min-width: 100px;
}

.filter-bar input {
  flex: 1;
}

/* 报价列表 */
.quote-list {
  padding: 0 16px 80px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.quote-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.quote-header h3 {
  font-size: 16px;
  margin: 0;
  flex: 1;
  padding-right: 10px;
}

.status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }
.status-paid { background: #cce5ff; color: #004085; }
.status-rejected { background: #f8d7da; color: #721c24; }

.quote-info {
  margin-bottom: 12px;
}

.quote-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.quote-actions {
  display: flex;
  gap: 8px;
}

.quote-actions button,
.quote-actions select {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  background: white;
  cursor: pointer;
}

.quote-actions button:first-child {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: white;
  border: none;
}

.btn-delete {
  color: #e74c3c;
  border-color: #e74c3c !important;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-content h2 {
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

/* 表单 */
#quote-form {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #e67e22;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 80px 60px 32px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.item-row input {
  padding: 10px;
  font-size: 14px;
}

.btn-remove {
  background: #f8d7da;
  color: #721c24;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.btn-add {
  width: 100%;
  padding: 12px;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 10px;
  color: #666;
  cursor: pointer;
  margin-top: 8px;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.form-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-cancel {
  background: #f0f0f0;
  border: none;
  color: #666;
}

.btn-submit {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  border: none;
  color: white;
}

/* 分享弹窗 */
.share-content {
  padding: 30px 20px;
  text-align: center;
}

.share-content h3 {
  margin-bottom: 8px;
}

.share-content p {
  color: #666;
  margin-bottom: 20px;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-link-box input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: #f8f9fa;
}

.share-link-box button {
  padding: 12px 20px;
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-close {
  padding: 12px 30px;
  background: #f0f0f0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* 响应式 */
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
