:root {
  --bg-primary: #f5f7fa;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-placeholder: #9ca3af;
  --border-color: #e5e7eb;
  --border-focus: #3b82f6;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.1);
  --success: #10b981;
  --error: #ef4444;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg-primary: #0f1419;
  --bg-card: #1c2128;
  --bg-input: #252c35;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-placeholder: #6e7681;
  --border-color: #30363d;
  --border-focus: #58a6ff;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-light: rgba(88, 166, 255, 0.15);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

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

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: background-color 0.3s;
}

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

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

.hint {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

input, select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s;
  outline: none;
}

input::placeholder {
  color: var(--text-placeholder);
}

input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.datetime-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.input-with-unit {
  display: flex;
  gap: 8px;
}

.input-with-unit input {
  flex: 1;
}

.input-with-unit select {
  width: 80px;
  flex-shrink: 0;
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

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

.btn-primary:active {
  transform: translateY(0);
}

.output-card {
  margin-top: 24px;
}

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

.output-header label {
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.output-code {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 180px;
  max-height: 400px;
  overflow: auto;
}

.output-code code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

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

.toast.success {
  background: var(--success);
  color: #fff;
}

.toast.error {
  background: var(--error);
  color: #fff;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .datetime-row {
    grid-template-columns: 1fr;
  }
  
  .header h1 {
    font-size: 1.25rem;
  }
}
