:root {
  --bg: #EAEFEF;
  --surface: #FFFFFF;
  --border: #BFC9D1;
  --border-light: #D4DCE0;
  --text: #25343F;
  --text-secondary: #818D97;
  --text-muted: #BFC9D1;
  --primary: #FF9B51;
  --primary-hover: #E58B49;
  --primary-light: #FFF0E5;
  --primary-text: #C46A28;
  --header-bg: #25343F;
  --header-text: #FFFFFF;
  --success: #3B9E6D;
  --success-hover: #2E8A5D;
  --success-light: #E8F5EE;
  --success-text: #1E6B46;
  --warning: #D98A3C;
  --warning-light: #FDF0E2;
  --warning-text: #A66124;
  --danger: #D14545;
  --danger-hover: #B33A3A;
  --danger-light: #FBE8E8;
  --danger-text: #992B2B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Inter, sans-serif;
  --touch-min: 44px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding-top: 56px;
}

h1 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 56px;
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  box-shadow: 0 1px 3px rgba(37,52,63,0.15);
}

.page-header-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-2);
  padding-top: var(--space-2);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--space-2);
  position: relative;
}

.card-accent {
  border-left: 3px solid var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--touch-min);
  padding: 10px var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  font-family: inherit;
  -webkit-user-select: none;
  user-select: none;
}

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

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

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-success {
  background: var(--success);
  color: white;
}

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

.btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg);
}

.field-group {
  margin-bottom: var(--space-2);
}

.field-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 10px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 155, 81, 0.2);
}

.field-group input.error {
  border-color: var(--danger);
}

.hint {
  font-size: 0.78125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.error-text {
  font-size: 0.8125rem;
  color: var(--danger-text);
  margin-top: 6px;
  display: none;
}

.error-text.show {
  display: block;
}

.notification {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 200;
  display: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - var(--space-4));
}

.notification.show {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.notification.success {
  background: var(--success);
}

.notification.error {
  background: var(--danger);
}

.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(37, 52, 63, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  max-width: 340px;
  width: 88%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.dialog h3 {
  margin-bottom: var(--space-1);
}

.dialog p {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  line-height: 1.5;
}

.dialog .btn {
  margin-bottom: 8px;
}

.dialog .btn:last-child {
  margin-bottom: 0;
}

.app-footer {
  text-align: center;
  padding: var(--space-3) var(--space-2) var(--space-4);
  font-size: 0.75rem;
  color: var(--text-muted);
}
