/* LifeGrid OLED 12-Month Edition Styling */
:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-tertiary: #18181f;
  --card-bg: rgba(20, 20, 26, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.3);
  --text-primary: #f5f5f7;
  --text-secondary: #8e8e93;
  --text-muted: #5c5c62;
  --accent-white: #ffffff;
  --accent-green: #30d158;
  --accent-blue: #0a84ff;
  --accent-glow: rgba(255, 255, 255, 0.15);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.badge-green {
  background: rgba(48, 209, 88, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: #fff;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--accent-green) !important;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 48px;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Generator Grid Layout */
.generator-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 32px;
  align-items: start;
  margin-bottom: 64px;
}

@media (max-width: 992px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Style */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sub-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Control Group */
.control-group {
  margin-bottom: 22px;
}

.control-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.segment-btn, .lang-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.segment-btn:hover, .lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.segment-btn.active, .lang-btn.active {
  background: #fff;
  color: #000;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.segment-btn.active .style-tag {
  background: rgba(0, 0, 0, 0.15);
  color: #000;
}

.style-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* Form Input & Select */
.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-input optgroup {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.form-input option {
  background: var(--bg-secondary);
  color: #fff;
}

/* Color Pickers */
.color-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.color-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
}

.color-input-wrap input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

.color-input-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrap input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.color-code {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* URL Card */
.url-card {
  margin-top: 28px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.url-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.url-box input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: #a1a1aa;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 0.85rem;
  outline: none;
}

.actions-row {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: #fff;
  color: #000;
}

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-secondary {
  flex: 1;
  background: var(--accent-blue);
  color: #fff;
}

.btn-secondary:hover {
  background: #0071e3;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.btn-sm.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Preview Panel */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.preview-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.preview-status-badge {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}

.preview-status-badge .pulse-dot {
  width: 7px;
  height: 7px;
  background: #00E676;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #00E676;
}

/* iPhone Mockup Frame */
.device-mockup-wrapper {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.iphone-frame {
  position: relative;
  width: 320px;
  height: 693px; /* 约 1179x2556 等比缩放 (x 0.271) */
  background: #000;
  border-radius: 46px;
  box-shadow:
    0 0 0 4px #1c1c1e,
    0 0 0 6px #2c2c2e,
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.wallpaper-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.lockscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 18px;
  transition: opacity 0.25s ease;
}

.lockscreen-overlay.hidden {
  opacity: 0;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 27px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Status Bar */
.status-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  padding: 0 10px;
  margin-top: 2px;
  z-index: 5;
}

.status-time {
  margin-left: 6px;
}

.status-icons {
  display: flex;
  gap: 5px;
  font-size: 0.7rem;
  margin-right: 6px;
}

/* Clock & Date */
.apple-date {
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 48px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.apple-clock {
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Bottom Lockscreen Tools */
.bottom-tools {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 24px;
}

.tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
}

/* Tutorial Section */
.tutorial-section {
  margin-bottom: 64px;
}

.section-title {
  margin-bottom: 32px;
}

.section-title h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
}

.step-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* API Section */
.api-section {
  margin-bottom: 64px;
}

.table-wrap {
  overflow-x: auto;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.api-table th, .api-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}

.api-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
}

.api-table td code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #f5f5f7;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
