:root {
  --primary: #2D3748;
  --accent: #ED8936;
  --accent-hover: #d47516;
  --light-bg: #F7F9FC;
  --text: #2D3748;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --card-radius: 12px;
  --btn-radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --success: #059669;
  --error: #DC2626;
  --warning: #D97706;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang TC", "Microsoft JhengHei", "Apple SD Neoe", sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 20px;
  font-weight: 500;
}

.header .back-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.header .back-btn:hover {
  background: rgba(255,255,255,0.2);
}

.header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header .notifications {
  position: relative;
  cursor: pointer;
  font-size: 24px;
}

.header .notifications::after {
  content: "2";
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: white;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-error { background: #FEE2E2; color: #991B1B; }

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.stat-label { color: var(--text-muted); font-size: 14px; }
.stat-value { font-weight: 600; font-size: 14px; }

/* Payment page */
.payment-summary {
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  padding: 16px;
  margin-bottom: 16px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.payment-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--accent);
  margin-top: 8px;
  padding-top: 12px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.method-btn {
  padding: 16px;
  text-align: center;
  border-radius: var(--btn-radius);
  background: var(--light-bg);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  font-weight: 500;
}

.method-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child { border-bottom: none; }

.history-info { display: flex; flex-direction: column; gap: 2px; }
.history-date { font-size: 14px; font-weight: 500; }
.history-detail { font-size: 12px; color: var(--text-muted); }

.status-completed { color: var(--success); font-weight: 600; }
.status-pending { color: var(--warning); font-weight: 600; }
.status-overdue { color: var(--error); font-weight: 600; }

/* Packages */
.package-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  margin-bottom: 12px;
}

.package-info { flex: 1; }
.package-name { font-weight: 500; font-size: 15px; }
.package-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.pickup-code {
  background: var(--primary);
  color: white;
  padding: 20px;
  border-radius: var(--card-radius);
  text-align: center;
  margin: 20px 0;
}

.pickup-code .code {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 8px;
}

.pickup-code .label {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 6px;
}

.primary-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Intercom */
.visitor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  margin-bottom: 12px;
}

.visitor-name { font-weight: 500; font-size: 15px; }
.visitor-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.status-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.call-btn {
  background: var(--light-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.call-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.call-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.call-btn.primary:hover {
  background: var(--accent-hover);
}

.call-btn.large {
  width: 100%;
  padding: 18px;
  font-size: 16px;
  font-weight: 600;
}

/* Voting */
.vote-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.vote-option:hover {
  border-color: var(--accent);
  background: #fef9f0;
}

.vote-option.selected {
  border-color: var(--accent);
  background: #fef9f0;
}

.vote-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.vote-option label {
  flex: 1;
  cursor: pointer;
  font-size: 15px;
}

.vote-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
}

.vote-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f5a623);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.vote-progress-text {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
}

.submit-vote-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s;
}

.submit-vote-btn:hover { background: #1a212d; }
.submit-vote-btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

/* Rules */
.search-box {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.2);
}

.rule-category {
  background: white;
  border-radius: var(--btn-radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.rule-category-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rule-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.rule-item:last-child { border-bottom: none; }

.highlight { color: var(--accent); font-weight: 600; }

/* Interactive (Wishes + Repairs) */
.wish-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  margin-bottom: 12px;
}

.wish-name { font-weight: 500; font-size: 15px; }
.wish-votes { color: var(--text-muted); font-size: 14px; }

.vote-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.vote-btn:hover { background: var(--accent-hover); }
.vote-btn.voted { background: var(--success); }

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.2);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.photo-upload {
  display: inline-block;
  padding: 10px 20px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
  border: 1px dashed var(--border);
}

.photo-upload:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Settings */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child { border-bottom: none; }

.setting-label { font-size: 15px; font-weight: 500; }

.setting-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.setting-toggle input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(24px); }

.logout-btn {
  width: 100%;
  padding: 16px;
  background: #EF4444;
  color: white;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s;
}

.logout-btn:hover { background: #DC2626; }

/* Notifications */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--light-bg);
  border-radius: var(--btn-radius);
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
}

.notification-icon { font-size: 20px; flex-shrink: 0; }
.notification-content { flex: 1; }
.notification-title { font-weight: 600; font-size: 14px; }
.notification-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.notification-message { font-size: 13px; margin-top: 4px; color: var(--text); }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeIn 0.3s ease; }

/* Responsive */
@media (max-width: 480px) {
  .header { padding: 12px 16px; }
  .page-container { padding: 16px; }
  .card { padding: 16px; }
  .payment-methods { grid-template-columns: 1fr; }
}