/* 意见建议页面样式 */

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-warm-end, #E8D5B7) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* 顶部导航 */
.page-header {
  background: linear-gradient(135deg, #C41E24 0%, #8B1519 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.2s;
}
.back-btn:active {
  background: rgba(255,255,255,0.3);
}

.page-title {
  flex: 1;
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.header-spacer {
  width: 32px;
}

/* 提交区域 */
.submit-section {
  padding: 16px;
}

.submit-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid #C41E24;
}

/* 表单 */
.suggestion-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.required {
  color: #C41E24;
}

.form-input {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #e0d5c8;
  border-radius: 8px;
  font-size: 14px;
  color: #1A1A1A;
  background: rgba(255,255,255,0.7);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.form-input:focus {
  border-color: #C41E24;
  background: #fff;
}

.form-textarea {
  padding: 10px 12px;
  border: 1.5px solid #e0d5c8;
  border-radius: 8px;
  font-size: 14px;
  color: #1A1A1A;
  background: rgba(255,255,255,0.7);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}
.form-textarea:focus {
  border-color: #C41E24;
  background: #fff;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
}

/* 类别选择 */
.category-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  padding: 6px 14px;
  border: 1.5px solid #e0d5c8;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-btn.active {
  background: #C41E24;
  color: #fff;
  border-color: #C41E24;
}
.cat-btn:active {
  transform: scale(0.95);
}

/* 图片上传 */
.image-upload-area {
  border: 2px dashed #d4c8b8;
  border-radius: 8px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.image-upload-area:active {
  border-color: #C41E24;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #999;
  font-size: 13px;
  padding: 16px;
}

.upload-preview {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.upload-preview img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  object-fit: contain;
}

.remove-img-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 表单行 */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-group--half {
  flex: 1;
  min-width: 0;
}

/* 提交按钮 */
.submit-btn {
  height: 44px;
  background: linear-gradient(135deg, #C41E24, #A01820);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 4px;
}
.submit-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 建议列表 */
.list-section {
  padding: 0 16px 30px;
}

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

.list-header .section-title {
  margin-bottom: 0;
}

.list-count {
  font-size: 13px;
  color: #999;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
}
.empty-state p {
  margin-top: 10px;
  font-size: 14px;
}

/* 建议卡片 */
.suggestion-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.suggestion-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sg-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sg-cat-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(196,30,36,0.1);
  color: #C41E24;
  font-weight: 600;
}

.sg-reply-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(76,175,80,0.1);
  color: #4CAF50;
  font-weight: 600;
}
.sg-reply-badge--pending {
  background: rgba(255,152,0,0.1);
  color: #FF9800;
}

.sg-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 6px;
  line-height: 1.4;
}

.sg-content-preview {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 8px;
}

.sg-thumb-wrap {
  margin-bottom: 8px;
}
.sg-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
}

.sg-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #999;
}

.sg-author::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D4A843;
  margin-right: 4px;
  vertical-align: middle;
}

/* 详情弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0ebe5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.detail-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  color: #1A1A1A;
  flex: 1;
  margin-right: 10px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f5f0eb;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-body {
  padding: 16px 20px 24px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.detail-cat {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(196,30,36,0.1);
  color: #C41E24;
  font-weight: 600;
}

.detail-author {
  font-size: 12px;
  color: #999;
}

.detail-time {
  font-size: 12px;
  color: #bbb;
}

.detail-content {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.detail-image-wrap {
  margin-bottom: 12px;
}

.detail-image {
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

/* 回复区域 */
.replies-section {
  border-top: 1px solid #f0ebe5;
  padding-top: 14px;
  margin-top: 4px;
}

.replies-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 10px;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reply-item {
  background: #faf6f1;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid #D4A843;
}

.reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.reply-replier {
  font-size: 12px;
  font-weight: 600;
  color: #D4A843;
}

.reply-time {
  font-size: 11px;
  color: #bbb;
}

.reply-content {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

/* 建议卡片操作按钮 */
.sg-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0ebe5;
}

.sg-action-btn {
  flex: 1;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.sg-action-btn:active {
  transform: scale(0.97);
}

.sg-action-btn--view {
  color: #666;
  border-color: #ddd;
}
.sg-action-btn--view:active {
  background: #f5f0eb;
}

.sg-action-btn--reply {
  color: #C41E24;
  border-color: rgba(196,30,36,0.3);
  background: rgba(196,30,36,0.05);
}
.sg-action-btn--reply:active {
  background: rgba(196,30,36,0.12);
}

.sg-action-btn--delete {
  color: #999;
  border-color: #eee;
}
.sg-action-btn--delete:active {
  color: #f44336;
  border-color: rgba(244,67,54,0.3);
  background: rgba(244,67,54,0.05);
}

/* 回复表单 */
.reply-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0ebe5;
}

.reply-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}

.reply-textarea:focus {
  border-color: #C41E24;
  outline: none;
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.reply-submit-btn {
  flex: 1;
  height: 36px;
  background: linear-gradient(135deg, #C41E24, #A01820);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.reply-submit-btn:active {
  opacity: 0.9;
}

.reply-cancel-btn {
  height: 36px;
  padding: 0 16px;
  background: #f5f0eb;
  color: #666;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  pointer-events: none;
}
