* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 30px 0;
  background: #fff;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  padding: 28px 20px 22px;
  text-align: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}

.header .subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 6px;
}

/* 区块 */
.section {
  padding: 16px 20px;
  border-bottom: 8px solid #f5f5f5;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a73e8;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid #1a73e8;
}

/* 表单元素 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-group input:disabled {
  background: #f5f5f5;
  color: #999;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* 必填标记 */
.required::after {
  content: ' *';
  color: #e53935;
}

/* 错误提示 */
.error-msg {
  font-size: 12px;
  color: #e53935;
  margin-top: 4px;
  min-height: 0;
}

.error-msg:empty {
  display: none;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #e53935;
}

.rating-card.has-error {
  border-color: #e53935;
}

/* Radio 网格布局（项目类型） */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-grid .radio-item {
  display: flex;
  align-items: center;
  padding: 8px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.radio-grid .radio-item:active {
  background: #e3f2fd;
}

.radio-grid .radio-item input[type="radio"] {
  margin-right: 4px;
  flex-shrink: 0;
}

.radio-grid .radio-item input[type="radio"]:checked + span {
  color: #1a73e8;
  font-weight: 500;
}

.radio-grid .radio-item:has(input:checked) {
  border-color: #1a73e8;
  background: #e8f0fe;
}

/* 满意度评价卡片 */
.rating-card {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.rating-question {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.5;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rating-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  text-align: center;
}

.rating-options label:active {
  background: #e3f2fd;
}

.rating-options label input[type="radio"] {
  display: none;
}

.rating-options label span {
  font-size: 13px;
  color: #555;
}

.rating-options label:has(input:checked) {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.rating-options label:has(input:checked) span {
  color: #1a73e8;
  font-weight: 600;
}

/* 搜索下拉框 */
.search-select {
  position: relative;
}

.search-select input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-select input[type="text"]:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-group.has-error .search-select input[type="text"] {
  border-color: #e53935;
}

.search-select input[type="text"].selected-tag {
  background: #e8f0fe;
  color: #1a73e8;
  border-color: #1a73e8;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-dropdown-list .search-item {
  padding: 10px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}

.search-dropdown-list .search-item:last-child {
  border-bottom: none;
}

.search-dropdown-list .search-item:active,
.search-dropdown-list .search-item.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.search-dropdown-list .search-item .highlight {
  color: #1a73e8;
  font-weight: 600;
}

.search-dropdown-empty {
  padding: 16px 12px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* 亮点选择 */
.radio-inline {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.radio-inline label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
}

.radio-inline label input[type="radio"] {
  margin-right: 6px;
}

/* 提交按钮 */
.submit-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 20px auto 0;
  padding: 14px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 2px;
  transition: opacity 0.2s;
}

.submit-btn:active {
  opacity: 0.85;
}

.submit-btn:disabled {
  background: #bbb;
  cursor: not-allowed;
}

/* 成功页面 */
.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.success-content h2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 12px;
}

.success-content p {
  font-size: 15px;
  color: #777;
  line-height: 1.6;
}

/* 不支持 :has() 的浏览器回退 */
@supports not selector(:has(input:checked)) {
  .radio-grid .radio-item.selected {
    border-color: #1a73e8;
    background: #e8f0fe;
  }

  .rating-options label.selected {
    border-color: #1a73e8;
    background: #e8f0fe;
  }

  .rating-options label.selected span {
    color: #1a73e8;
    font-weight: 600;
  }
}
