:root {
  --bg: #e8f0f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --primary: #1989cc;
  --primary-light: #e6f2ff;
  --error: #ff4d4f;
  --error-light: #fff1f0;
  --info: #faad14;
  --info-light: #fffbe6;
  --border: #d9d9d9;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部蓝色标题区 */
.top-banner {
  background: linear-gradient(135deg, #1989cc 0%, #40a9ff 100%);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.top-banner__icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.top-banner__year {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}

/* 卡片容器 */
.card-container {
  flex: 1;
  background: var(--card);
  margin: 16px 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.scan-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--primary-light);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.scan-btn:hover,
.scan-btn.active {
  background: var(--primary);
  color: white;
}

.scan-icon {
  display: inline-block;
}

.card-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--info-light);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.hint-icon {
  font-size: 14px;
  flex-shrink: 0;
}

/* 扫码容器 */
.scan-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.scan-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.scan-area video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

/* 输入区域 */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.label-icon {
  font-size: 16px;
}

.invoice-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.invoice-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(25, 137, 204, 0.2);
}

.submit-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

/* 按钮组件 */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: #0e5ba8;
  box-shadow: var(--shadow);
}

.btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn--large {
  min-width: 120px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
}

.btn--scan {
  min-width: 100px;
  padding: 14px 20px;
  border-radius: 6px;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn--scan:hover,
.btn--scan.active {
  background: var(--primary);
  color: white;
}

/* 消息提示 */
.message {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin: 12px 0;
}

.message--error {
  background: var(--error-light);
  color: var(--error);
  border-left: 3px solid var(--error);
}

.message--info {
  background: #f0f5ff;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  text-align: center;
  font-weight: 500;
}

/* 结果区域 */
.result-section {
  margin-top: 16px;
}

.result-header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  padding: 14px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid var(--border);
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.result-label {
  color: var(--text-muted);
  font-weight: 500;
}

.result-value {
  color: var(--text);
  font-weight: 600;
}

.result-value.win {
  color: #faad14;
}

.result-value.amount {
  color: var(--primary);
  font-size: 14px;
}

/* 底部区域 */
.footer-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

.footer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.footer-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 响应式设计 - 平板和大屏 */
@media (min-width: 768px) {
  .card-container {
    margin: 24px auto;
    max-width: 500px;
    padding: 28px;
  }

  .card-title {
    font-size: 28px;
  }

  .invoice-input {
    padding: 14px 16px;
    font-size: 15px;
  }

  .btn--large {
    padding: 14px 28px;
    font-size: 16px;
  }
}

/* 响应式设计 - 小屏设备 */
@media (max-width: 480px) {
  .page {
    min-height: 100vh;
  }

  .card-container {
    margin: 12px 8px 16px;
    padding: 16px;
    border-radius: 10px;
  }

  .card-title {
    font-size: 20px;
  }

  .scan-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .invoice-input {
    font-size: 16px;
    padding: 10px 12px;
  }

  .btn {
    font-size: 13px;
    padding: 10px 14px;
  }

  .btn--large {
    padding: 11px 16px;
    font-size: 15px;
  }

  .result-card {
    padding: 12px;
  }

  .result-row {
    font-size: 12px;
    padding: 5px 0;
  }
}

  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form__textarea:focus {
  border-color: rgba(42, 166, 95, 0.6);
}

.form__submit {
  width: 100%;
  margin-top: 16px;
  padding: 12px 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.message {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.message--error {
  background: #ffe7e7;
  color: #c34141;
}

.result {
  margin-top: 22px;
}

.result__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card__row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}

.card__row span:first-child {
  color: var(--muted);
}

.footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.footer__hint {
  margin-top: 8px;
  line-height: 1.45;
}
