/* DADDY HOME Environment Patrol & Space Education UI Style */
/* Heytea-Style Editorial & Field Specimen Aesthetic */

:root {
  --primary: #654096;
  --primary-light: #f4eff9;
  --primary-hover: #523080;
  --accent: #e5a823;
  --accent-light: #fef9e8;
  --accent-stamp: #c0392b;
  --paper-bg: #fbf9f5;
  --paper-card: #ffffff;
  --paper-border: #e8e3d9;
  --text-main: #232323;
  --text-muted: #666666;
  --text-light: #999999;
  --font-editorial: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-handwriting: "Kaiti SC", "STKaiti", "PingFang SC", serif;
  --font-mono: "SF Mono", "Menlo", "Courier New", monospace;
  --shadow-paper: 0 4px 20px rgba(70, 50, 30, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-editorial);
  background-color: #f3efe6;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 249, 245, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(101, 64, 150, 0.25);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.brand-sub-title {
  font-size: 11px;
  color: var(--text-muted);
}

.area-switch-btn {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--paper-border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.area-switch-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Container */
.app-container {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* ============================================================ */
/* HEYTEA-STYLE REDESIGNED BADGE / SIGNAGE CARD                 */
/* ============================================================ */

.heytea-badge-container {
  position: relative;
  background: var(--paper-bg);
  border: 1.5px solid var(--paper-border);
  border-radius: 14px;
  padding: 24px 20px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}

/* Washi Tape Effect */
.washi-tape-top {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 110px;
  height: 22px;
  background: rgba(229, 168, 35, 0.55);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 2px dashed rgba(255,255,255,0.6);
  border-right: 2px dashed rgba(255,255,255,0.6);
  z-index: 10;
}

.badge-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee8dd;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.badge-campus-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #8c8273;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-serial {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #eee8dd;
  color: #555;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.badge-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge-title-group {
  flex: 1;
}

.badge-title-cn {
  font-size: 26px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.badge-title-en {
  font-size: 11px;
  font-weight: 600;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.badge-doodle-icon {
  width: 44px;
  height: 44px;
  border: 1.5px dashed #c4b9a3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: #ffffff;
  transform: rotate(4deg);
}

/* Handwritten Tagline */
.badge-handwritten-quote {
  font-family: var(--font-handwriting);
  font-size: 14px;
  color: var(--primary);
  font-style: italic;
  margin: 8px 0 14px;
  line-height: 1.4;
  padding-left: 2px;
}

/* Functional Tags (Minimal Brackets Style) */
.badge-tags-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.badge-tag-pill {
  font-size: 11px;
  font-weight: 600;
  color: #44403c;
  background: #f0ebe1;
  border: 1px solid #ddd5c7;
  padding: 2px 8px;
  border-radius: 4px;
}

/* QR Code Display Box */
.badge-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 16px;
}

.badge-qr-frame {
  background: #ffffff;
  padding: 12px;
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Verified Stamp Seal */
.badge-stamp-seal {
  position: absolute;
  bottom: 60px;
  right: 18px;
  border: 2px solid var(--accent-stamp);
  color: var(--accent-stamp);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  transform: rotate(-10deg);
  opacity: 0.85;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.7);
  mask-image: linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.85));
}

/* Dual Scan Action Notes */
.badge-dual-action-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.badge-action-item {
  background: #ffffff;
  border: 1px solid var(--paper-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #444;
  line-height: 1.4;
}

.badge-action-item strong {
  color: var(--primary);
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}

/* Tabs & Panels */
.view-tabs {
  display: flex;
  background: #e9e3d8;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #777;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Educational Cards */
.edu-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--paper-border);
  box-shadow: var(--shadow-paper);
}

.edu-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.edu-intro-text {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
}

.principle-item {
  background: var(--paper-bg);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
}

.principle-item:last-child {
  margin-bottom: 0;
}

.principle-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

.principle-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}

.edu-photo-wrap {
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.edu-photo {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

/* Patrol Form Elements */
.form-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--paper-border);
  box-shadow: var(--shadow-paper);
}

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

.form-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #222;
}

.quick-select-all-btn {
  background: #eef7ee;
  color: #1e7e34;
  border: 1px solid #c8e6c9;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

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

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

.form-select, .form-input, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--paper-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #222;
  background: #fff;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.check-item-label.checked {
  background: var(--primary-light);
  border-color: rgba(101, 64, 150, 0.3);
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #bbb;
  border-radius: 4px;
  margin-top: 1px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.check-item-label.checked .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.check-item-text {
  font-size: 13px;
  color: #222;
  line-height: 1.4;
}

.photo-uploader-box {
  border: 2px dashed #c4b9a3;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: var(--paper-bg);
  cursor: pointer;
  display: block;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumb-wrap {
  position: relative;
  display: inline-block;
}

.preview-thumb {
  width: 65px;
  height: 65px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--paper-border);
}

.thumb-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  background: #e53e3e;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ratings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rating-box {
  background: var(--paper-bg);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--paper-border);
}

.rating-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.stars-row {
  color: #f59e0b;
  font-size: 15px;
  margin-top: 2px;
}

.submit-btn {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(101, 64, 150, 0.25);
  margin: 12px 0 30px;
}

.submit-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
  box-shadow: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--paper-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #888;
  cursor: pointer;
}

.modal-body {
  padding: 10px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.area-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--paper-border);
  background: var(--paper-bg);
  cursor: pointer;
}

.area-modal-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.modal-item-icon {
  font-size: 20px;
}

.modal-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

.modal-item-sub {
  font-size: 11px;
  color: #777;
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #222;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.25s ease;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}
