/* ========================================
   夸克批量转存分享工具 - 样式表
   Modern Dark Theme with Glass Morphism
   ======================================== */

:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #22d3ee;
    --accent-hover: #67e8f9;
    --accent-glow: rgba(34, 211, 238, 0.4);
    --success: #10b981;
    --success-hover: #34d399;
    --warning: #f59e0b;
    --error: #ef4444;
    --error-hover: #f87171;
    
    /* Dark Theme Colors */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --bg-card-hover: rgba(30, 30, 54, 0.9);
    --bg-input: rgba(15, 15, 26, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #22d3ee;
    
    /* Border Colors */
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-focus: var(--primary);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--primary-glow);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Background Effects
   ======================================== */
.background-effects {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.2) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { filter: drop-shadow(0 0 8px var(--primary-glow)); }
    50% { filter: drop-shadow(0 0 20px var(--primary-glow)); }
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.title-group h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-group .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--error);
    animation: blink 2s ease-in-out infinite;
}

.status-indicator.connected .status-dot {
    background: var(--success);
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ========================================
   Section Cards
   ======================================== */
.section-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.section-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.section-card.full-height {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(99, 102, 241, 0.5) 100%);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.card-icon.input-icon {
    background: linear-gradient(135deg, var(--accent) 0%, rgba(34, 211, 238, 0.5) 100%);
}

.card-icon.output-icon {
    background: linear-gradient(135deg, var(--success) 0%, rgba(16, 185, 129, 0.5) 100%);
}

.card-title {
    flex: 1;
}

.card-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.card-title p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Cookie Section
   ======================================== */
.cookie-section {
    animation: fadeIn 0.6s ease 0.1s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.proxy-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}

.proxy-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-md);
}

.proxy-url-input {
    flex: 1;
    min-width: 220px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.8125rem;
}

.proxy-url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.cookie-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.cookie-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    resize: vertical;
    transition: all var(--transition-fast);
}

.cookie-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.cookie-textarea::placeholder {
    color: var(--text-muted);
}

.cookie-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

.login-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-status {
    font-size: 0.875rem;
    color: var(--success);
}

/* ========================================
   Transfer Section
   ======================================== */
.transfer-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    animation: fadeIn 0.6s ease 0.2s both;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.input-panel, .output-panel {
    animation: fadeIn 0.6s ease;
}

.input-panel { animation-delay: 0.3s; }
.output-panel { animation-delay: 0.4s; }

.url-count {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.url-count span {
    color: var(--accent);
    font-weight: 600;
}

.textarea-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.links-textarea {
    flex: 1;
    width: 100%;
    min-height: 280px;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.8;
    resize: none;
    transition: all var(--transition-fast);
}

.links-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.links-textarea::placeholder {
    color: var(--text-muted);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-md);
}

/* ========================================
   Results Container
   ======================================== */
.results-container {
    flex: 1;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.result-item {
    padding: var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.result-item.success {
    border-left: 3px solid var(--success);
}

.result-item.failed {
    border-left: 3px solid var(--error);
}

.result-item.processing {
    border-left: 3px solid var(--accent);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.result-title {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.result-status {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: var(--space-md);
}

.result-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.result-status.failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.result-status.processing {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent);
    animation: pulse 1s ease-in-out infinite;
}

.result-link {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-family: 'Space Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-accent);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.result-link a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.result-link a:hover {
    text-decoration: underline;
}

.copy-btn {
    flex-shrink: 0;
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.result-error {
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--error);
}

.result-stats {
    display: flex;
    gap: var(--space-md);
}

.stat {
    font-size: 0.875rem;
    font-weight: 500;
}

.stat.success span {
    color: var(--success);
}

.stat.failed span {
    color: var(--error);
}

.results-actions {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-default);
    margin-top: var(--space-lg);
}

/* ========================================
   Action Bar
   ======================================== */
.action-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
}

.action-group {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-sm);
    width: 0%;
    transition: width var(--transition-base);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-text span:last-child {
    color: var(--accent);
    font-weight: 600;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-lg svg {
    width: 22px;
    height: 22px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #67e8f9 100%);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Footer
   ======================================== */
.app-footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--accent); }

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-default);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
    max-height: 50vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-default);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .app-container {
        padding: var(--space-md);
    }
    
    .app-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .title-group h1 {
        font-size: 1.5rem;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .section-card {
        padding: var(--space-lg);
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .action-group {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
