@import url('https://fonts.googleapis.com/css2?family=Inter:wght=400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
body { font-family: 'Inter', sans-serif; background: #1f2937; color: #f9fafb; }
.container { max-width: 500px; margin: 60px auto; padding: 0 20px; }
.card { background: #374151; border-radius: 12px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.gender-male { color: #3b82f6; font-weight: 600; }
.gender-female { color: #ec4899; font-weight: 600; }
.prob { font-size: 14px; color: #9ca3af; margin-left: 10px; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.fade-out { opacity: 0; transform: translateY(-10px); transition: all 0.2s ease; }
.fade-in { opacity: 1; transform: translateY(0); transition: all 0.3s ease; }
.history-item { background: #4b5563; padding: 12px; border-radius: 8px; margin-bottom: 8px; text-align: left; cursor: pointer; transition: background 0.2s; }
.history-item:hover { background: #586575; }
.history-remove { color: #ef4444; cursor: pointer; font-size: 12px; margin-left: 8px; }
.share-btn { background: #10b981; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; margin-top: 10px; transition: background 0.2s; }
.share-btn:hover { background: #059669; }
.copy-tip { font-size: 12px; color: #10b981; margin-top: 6px; display: none; }
.share-section { background: #4b5563/50; border-radius: 8px; padding: 16px; margin-top: 12px; }
.method-tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; margin-left: 8px; }
.tag-normal { background: #3b82f6/30; color: #3b82f6; }
.tag-reverse { background: #ef4444/30; color: #ef4444; }
.tag-opposite { background: #ec4899/30; color: #ec4899; }
.tag-random { background: #f59e0b/30; color: #f59e0b; }
.modified-badge { background: #8b5cf6/30; color: #8b5cf6; font-size: 10px; padding: 2px 6px; border-radius: 10px; margin-left: 8px; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #9ca3af; border-top-color: #8b5cf6; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading { opacity: 0.7; pointer-events: none; }
.mapping-sidebar {
    position: fixed; top: 0; left: -400px; width: 400px; height: 100vh;
    background: #1f2937; box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: left 0.3s ease; z-index: 1000; overflow-y: auto; padding: 20px;
    border-right: 1px solid #4b5563;
}
.mapping-sidebar.open { left: 0; }
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); visibility: hidden; opacity: 0;
    transition: visibility 0.3s, opacity 0.3s; z-index: 999;
}
.sidebar-overlay.active { visibility: visible; opacity: 1; }
.mapping-item {
    background: #374151; border-radius: 8px; padding: 12px; margin-bottom: 12px;
    position: relative;
}
.mapping-item input, .mapping-item select {
    width: 100%; padding: 6px 10px; margin-bottom: 8px; background: #4b5563;
    border: 1px solid #6b7280; border-radius: 6px; color: white;
}
.delete-item {
    position: absolute; top: 8px; right: 8px; background: #ef4444; color: white;
    border: none; border-radius: 4px; padding: 2px 6px; cursor: pointer; font-size: 12px;
}
.add-item-btn, .apply-mapping-btn, .debug-toggle-btn {
    background: #10b981; color: white; padding: 8px 16px; border: none;
    border-radius: 6px; cursor: pointer; margin-top: 12px; width: 100%;
}
.debug-toggle-btn { background: #f59e0b; }
.close-sidebar-btn { background: #6b7280; margin-top: 8px; }
.floating-btn {
    position: fixed; bottom: 20px; left: 20px; background: #8b5cf6; color: white;
    border-radius: 50%; width: 56px; height: 56px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s; z-index: 1001;
}
.floating-btn:hover { transform: scale(1.05); }
.debug-panel {
    background: #1e293b; border-radius: 8px; padding: 12px; margin-top: 16px;
    font-family: monospace; font-size: 12px; text-align: left; overflow-x: auto;
    max-height: 300px; overflow-y: auto;
}
.debug-panel pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; color: #e2e8f0; }
.debug-header { cursor: pointer; user-select: none; color: #fbbf24; font-weight: bold; margin-bottom: 8px; }

/* 页面全局加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #374151;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

/* 图标间距统一 */
.fa-solid {
    margin-right: 4px;
}