/* Author: TDULinks - 广东星艺装饰集团有限公司 H5 留言页 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #b8860b;
  --primary-light: #d4a843;
  --primary-dark: #8b6914;
  --accent: #c9a962;
  --bg: #f5f2ed;
  --card: #ffffff;
  --dark: #1c1c1e;
  --text: #2c2c2e;
  --text-secondary: #6e6e73;
  --border: #e5e0d8;
  --error: #dc2626;
  --radius: 4px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 - 深色奢华风 */
.header {
  position: relative;
  padding: 48px 24px 56px;
  overflow: hidden;
  background: var(--dark);
}

.header-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(30deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent)),
    linear-gradient(150deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent)),
    linear-gradient(30deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent)),
    linear-gradient(150deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent));
  background-size: 40px 70px;
}

.header-gold-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header-content {
  position: relative;
  text-align: center;
  color: #fff;
}

.company-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  color: var(--accent);
}

.company-logo svg {
  width: 100%;
  height: 100%;
}

.company-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.company-slogan {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  font-weight: 300;
}

.company-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* 主内容 */
.main {
  flex: 1;
  padding: 0 16px 24px;
  margin-top: -28px;
  position: relative;
  z-index: 1;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: 0 8px 32px rgba(28, 28, 30, 0.1);
  border-top: 3px solid var(--accent);
}

.form-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.form-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-item {
  margin-bottom: 18px;
}

.form-item label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0.5px;
}

.required {
  color: var(--primary);
}

.form-item input,
.form-item textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text);
  background: #faf9f7;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-item input:focus,
.form-item textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.2);
  background: #fff;
}

.form-item textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  min-height: 16px;
}

/* 协议勾选 */
.agreement-section {
  margin: 22px 0;
  padding: 16px;
  background: #faf8f4;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 12px;
  position: relative;
}

.checkbox-item:last-of-type {
  margin-bottom: 0;
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #fff;
}

.checkbox-item input:checked + .checkbox-custom {
  background: var(--dark);
  border-color: var(--dark);
}

.checkbox-item input:checked + .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.checkbox-text a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.submit-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--accent);
}

.submit-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 24px 0 10px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 30, 0.6);
}

.modal-panel {
  position: relative;
  background: var(--card);
  width: 100%;
  max-height: 85vh;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--dark);
  color: #fff;
  border-radius: 8px 8px 0 0;
}

.modal-header h3 {
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--accent);
}

.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-body h4 {
  font-size: 14px;
  color: var(--dark);
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--accent);
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p,
.modal-body li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.modal-body ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.modal-body strong {
  color: var(--text);
}

.privacy-update {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  background: #faf8f4;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
}

.modal-footer {
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
}

.modal-btn:active {
  opacity: 0.9;
}

/* 成功弹窗 */
.success-panel {
  position: relative;
  background: var(--card);
  border-radius: 8px;
  padding: 36px 24px;
  margin: auto 32px;
  text-align: center;
  animation: fadeIn 0.3s ease;
  border-top: 3px solid var(--accent);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.success-panel h3 {
  font-size: 18px;
  color: var(--dark);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.success-panel p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .main {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .modal {
    align-items: center;
  }

  .modal-panel {
    max-width: 480px;
    border-radius: 8px;
    max-height: 80vh;
  }

  .modal-header {
    border-radius: 8px 8px 0 0;
  }
}
