/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - Purple Theme */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-blue: #3b82f6;
    
    /* Password Strength Colors */
    --strength-weak: #ef4444;
    --strength-fair: #f59e0b;
    --strength-good: #10b981;
    --strength-strong: #059669;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    
    /* Flat Design - Minimal Shadows */
    --shadow-flat: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius - Flat */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    color: var(--gray-900);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================
   Background Shapes - Square Theme
   ========================================== */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.06;
    animation: float 30s infinite ease-in-out;
}

.shape-1 {
    width: 180px;
    height: 180px;
    background: var(--accent-purple);
    transform: rotate(15deg);
    top: 8%;
    left: 3%;
    animation-delay: 0s;
}

.shape-2 {
    width: 140px;
    height: 140px;
    background: var(--accent-indigo);
    transform: rotate(35deg);
    top: 65%;
    right: 5%;
    animation-delay: 7s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    background: var(--accent-blue);
    transform: rotate(55deg);
    bottom: 12%;
    left: 12%;
    animation-delay: 14s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    background: var(--primary);
    transform: rotate(25deg);
    top: 30%;
    right: 15%;
    animation-delay: 21s;
}

.shape-5 {
    width: 90px;
    height: 90px;
    background: var(--accent-purple);
    transform: rotate(45deg);
    bottom: 45%;
    left: 6%;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(15deg);
    }
    33% {
        transform: translate(15px, -10px) rotate(25deg);
    }
    66% {
        transform: translate(-10px, 15px) rotate(5deg);
    }
}

/* ==========================================
   Container
   ========================================== */
.container {
    width: 100%;
    max-width: 1200px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    animation: fadeInUp 0.5s ease-out;
    position: relative;
    z-index: 1;
}

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

/* ==========================================
   Header
   ========================================== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.title-icon {
    width: 40px;
    height: 40px;
}

.subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ==========================================
   Main Content - Two Column Layout
   ========================================== */
.main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

/* ==========================================
   Left Panel - Config
   ========================================== */
.config-panel {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-200);
}

/* ==========================================
   Right Panel - Result
   ========================================== */
.result-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ==========================================
   Password Display
   ========================================== */
.password-display-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
}

.password-display {
    flex: 1;
    height: 420px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.password-display:focus-within {
    border-color: var(--primary);
}

.password-text {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    word-break: break-all;
    text-align: center;
    user-select: all;
}

.password-text.placeholder {
    color: var(--gray-400);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
}

.password-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--gray-50);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn.success {
    background: var(--strength-good);
    border-color: var(--strength-good);
    color: var(--white);
}

.action-btn .icon {
    width: 20px;
    height: 20px;
}

/* ==========================================
   Strength Indicator
   ========================================== */
.strength-indicator {
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.strength-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.strength-text {
    font-weight: 600;
}

.strength-text.weak { color: var(--strength-weak); }
.strength-text.fair { color: var(--strength-fair); }
.strength-text.good { color: var(--strength-good); }
.strength-text.strong { color: var(--strength-strong); }

.strength-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

.strength-bar-fill.weak {
    width: 25%;
    background: var(--strength-weak);
}

.strength-bar-fill.fair {
    width: 50%;
    background: var(--strength-fair);
}

.strength-bar-fill.good {
    width: 75%;
    background: var(--strength-good);
}

.strength-bar-fill.strong {
    width: 100%;
    background: var(--strength-strong);
}

/* ==========================================
   Options Section
   ========================================== */
.option-group {
    margin-bottom: var(--spacing-md);
}

.option-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.option-value {
    color: var(--primary);
    font-weight: 700;
}

/* Slider */
.slider {
    width: 100%;
    height: 4px;
    border-radius: var(--radius-sm);
    background: var(--gray-300);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 28px;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.checkbox-label:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==========================================
   Buttons
   ========================================== */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-family: inherit;
    text-decoration: none;
    flex: 1;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ==========================================
   Batch Section
   ========================================== */
.batch-output {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    animation: slideDown 0.3s ease-out;
}

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

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.btn-copy-all {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.batch-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 300px;
    overflow-y: auto;
}

.batch-item {
    background: var(--white);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
    word-break: break-all;
}

/* ==========================================
   Error Message
   ========================================== */
.error-message {
    padding: 0.875rem;
    background: #fef2f2;
    color: var(--strength-weak);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--strength-weak);
    font-size: 0.9375rem;
}

/* ==========================================
   Security Tips
   ========================================== */
.security-tips {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--gray-200);
    margin-top: var(--spacing-md);
}

.tips-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: var(--gray-600);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.tips-list li:before {
    content: "•";
    position: absolute;
    left: 0.375rem;
    color: var(--primary);
    font-weight: 700;
}

/* ==========================================
   Links Section (友情链接)
   ========================================== */
.links-section {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.links-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.links-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.links-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-item {
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

.link-item:hover {
    color: var(--primary);
}

.link-item:not(:last-child)::after {
    content: '|';
    margin-left: 0.5rem;
    color: var(--gray-300);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* ==========================================
   Success Toast
   ========================================== */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--strength-good);
    color: var(--white);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9375rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ==========================================
   Responsive Design
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    
    .main-content {
        grid-template-columns: 280px 1fr;
        gap: var(--spacing-lg);
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .container {
        padding: var(--spacing-lg);
    }
    
    .header {
        margin-bottom: var(--spacing-lg);
    }
    
    .title {
        font-size: 1.75rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .title-icon {
        width: 36px;
        height: 36px;
    }
    
    .subtitle {
        font-size: 0.9375rem;
    }
    
    /* Single Column Layout */
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .config-panel {
        padding: var(--spacing-md);
    }
    
    .panel-title {
        font-size: 1rem;
    }
    
    .password-display-wrapper {
        flex-direction: column;
    }
    
    .password-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .password-text {
        font-size: 1.125rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .batch-header {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: flex-start;
    }
    
    .btn-copy-all {
        width: 100%;
    }
    
    .shape {
        opacity: 0.04;
    }
    
    .security-tips {
        padding: var(--spacing-sm);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .password-text {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .links-container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.text-center {
    text-align: center;
}
