:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-secondary: #ec4899;
    --color-accent: #14b8a6;
    --color-bg-dark: #0f172a;
    --color-bg-darker: #020617;
    --color-bg-card: rgba(30, 41, 59, 0.7);
    --color-bg-card-hover: rgba(30, 41, 59, 0.85);
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-border: rgba(148, 163, 184, 0.2);
    --color-border-light: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg-darker);
    color: var(--color-text-primary);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    line-height: 1.5;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 20% -10%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, var(--color-bg-darker) 0%, var(--color-bg-dark) 100%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(10deg);
    }
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem 1rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero-section {
    text-align: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.hero-section.compact {
    padding: 0.25rem 0;
}

.hero-content {
    opacity: 0;
    transform: translateY(20px);
}

.animate-stagger {
    animation: fadeInUp 0.5s var(--ease-smooth) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reduced-motion .animate-stagger {
    animation: none;
    opacity: 1;
    transform: none;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    color: var(--color-primary-light);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    transition: var(--transition-base);
}

.hero-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-glass {
    background: var(--color-bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.card-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-base);
}

.card-glass:hover::after {
    opacity: 1;
}

.control-card {
    padding: 0.875rem;
}

.compact-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.375rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition-base);
    position: relative;
}

.tab-icon {
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--color-text-secondary);
    background: rgba(148, 163, 184, 0.1);
}

.tab-btn.active {
    color: var(--color-text-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.form-section {
    margin-bottom: 0;
}

.form-section.hidden {
    display: none;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.form-input.compact {
    padding: 0.5rem 0.75rem;
}

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

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.form-input:hover:not(:focus) {
    border-color: rgba(99, 102, 241, 0.3);
}

textarea.form-input {
    resize: none;
}

.wifi-fields, .vcard-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.customize-card {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.customize-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}

.customize-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.customize-header h3.highlight {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.toggle-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.toggle-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--color-primary-light);
}

.save-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.setting-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.color-presets-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
    .color-presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.color-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.375rem;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.color-preset:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.color-preset.active {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.preset-preview {
    display: flex;
    width: 100%;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.preset-dark {
    flex: 1;
    background: var(--dark, #0f172a);
}

.preset-light {
    flex: 1;
    background: var(--light, #ffffff);
}

.advanced-settings {
    margin-bottom: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border-light);
}

.advanced-settings.hidden {
    display: none;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label span:first-child {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.setting-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-light);
}

.range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transition: var(--transition-fast);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transition: var(--transition-fast);
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.mini-logo-upload {
    position: relative;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.5);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.logo-drop-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.logo-preview-mini {
    position: absolute;
    inset: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-preview-mini.hidden {
    display: none;
}

.logo-preview-mini img {
    max-height: 100%;
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.logo-remove-mini {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.logo-remove-mini:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.1);
}

.generate-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.generate-btn.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    color: white;
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition-base);
}

.generate-btn:hover::before {
    opacity: 1;
}

.generate-btn:hover {
    transform: translateY(-2px);
}

.generate-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-icon {
    display: flex;
    transition: var(--transition-base);
}

.generate-btn:hover .btn-icon {
    transform: translateX(4px);
}

.result-card {
    padding: 0.875rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
}

.result-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.motion-toggle-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(148, 163, 184, 0.1);
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.motion-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--color-primary-light);
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 0.625rem;
    position: relative;
    overflow: hidden;
}

.qr-container::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.05), transparent 50%);
    animation: rotate 10s linear infinite;
    opacity: 0;
    transition: var(--transition-slow);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.qr-container.has-qr::before {
    opacity: 1;
}

.placeholder {
    text-align: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.placeholder.hidden {
    display: none;
}

.placeholder-gradient {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.placeholder h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.placeholder p {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.qr-canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: var(--radius-md);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-xl);
}

.qr-canvas.hidden {
    display: none;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-buttons.hidden {
    display: none;
}

.action-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: var(--transition-base);
}

.action-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.action-btn.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--color-primary-light);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.footer {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.footer p {
    opacity: 0.7;
}

@media (max-width: 900px) {
    .container {
        padding: 0.75rem 1rem 1rem;
        height: auto;
        min-height: 100vh;
    }
    .main-content {
        flex: none;
    }
    .left-panel, .right-panel {
        min-height: auto;
    }
    .card-glass {
        padding: 0.875rem;
    }
    .settings-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0.5rem 0.75rem 0.75rem;
    }
    .card-glass {
        padding: 0.75rem;
    }
    .tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        min-width: calc(50% - 0.25rem);
    }
    .color-presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .action-buttons {
        grid-template-columns: 1fr;
    }
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastIn 0.3s ease;
}

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.info {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--color-text-primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 100px;
}