/* 在线Useragent随机生成工具样式 */

/* 全局过渡动画 */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 容器样式 */
#useragent-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

/* 顶部工具栏 */
.top-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 2px solid #5568d3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.toolbar-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.toolbar-btn.fullscreen-btn {
    background: rgba(255,255,255,0.9);
    color: #667eea;
    font-weight: 600;
}

.toolbar-btn.ai-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-weight: 600;
}

.toolbar-btn.ai-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: translateY(-1px) scale(1.02);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 配置面板 */
.config-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
}

.panel-header {
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #5568d3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.panel-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

/* 配置区块 */
.config-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.config-section:last-child {
    border-bottom: none;
}

.section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* 复选框选项 */
.browser-options,
.os-options,
.device-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-option:hover {
    background: #f0f7ff;
    border-color: #667eea;
}

.checkbox-option input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:checked + .option-text {
    color: #667eea;
    font-weight: 600;
}

.option-text {
    font-size: 13px;
    color: #333;
    user-select: none;
}

/* 数字输入框 */
.input-number {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.input-number:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 模板按钮 */
.template-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.template-btn {
    padding: 8px 12px;
    font-size: 12px;
    border: 1px solid #667eea;
    background: #fff;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.template-btn:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-1px);
}

/* 分隔条 */
.resizer {
    width: 4px;
    background: #dee2e6;
    cursor: col-resize;
    transition: background 0.2s;
    position: relative;
}

.resizer:hover {
    background: #667eea;
}

.resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 40px;
    background: transparent;
}

/* 结果面板 */
.result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow-y: auto;
}

.result-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #667eea;
    background: #fff;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #667eea;
    color: #fff;
}

/* 当前结果 */
.current-result {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.result-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.useragent-display {
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    line-height: 1.6;
    min-height: 60px;
}

/* 信息解析 */
.useragent-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.info-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-key {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

/* 历史记录 */
.history-section {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.count-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #667eea;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.history-item {
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: #f0f7ff;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-time {
    font-size: 11px;
    color: #666;
}

.history-delete {
    padding: 2px 6px;
    font-size: 11px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.history-ua {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #333;
    word-break: break-all;
    line-height: 1.5;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 快捷键面板 */
.shortcuts-panel,
.history-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.shortcuts-panel .panel-header,
.history-panel .panel-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shortcuts-panel .panel-header button,
.history-panel .panel-header button {
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.shortcuts-panel .panel-body,
.history-panel .panel-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.shortcut-item:nth-child(odd) {
    background: #f0f7ff;
}

.shortcut-key {
    padding: 4px 10px;
    background: #667eea;
    color: #fff;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
}

.shortcut-desc {
    font-size: 13px;
    color: #333;
}

/* 历史详情 */
.history-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-detail-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.history-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-detail-time {
    font-size: 12px;
    color: #666;
}

.history-detail-actions {
    display: flex;
    gap: 6px;
}

.history-detail-btn {
    padding: 3px 8px;
    font-size: 11px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy {
    background: #667eea;
    color: #fff;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
}

.history-detail-ua {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    line-height: 1.6;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.panel-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* 全屏退出按钮 */
.exit-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1001;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.exit-fullscreen-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

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

/* 消息提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
}

/* 暗黑模式 */
.dark-mode #useragent-container {
    background: #1e1e1e;
}

.dark-mode .config-panel {
    background: #252525;
    border-right-color: #333;
}

.dark-mode .result-panel {
    background: #1e1e1e;
}

.dark-mode .panel-body {
    background: #252525;
}

.dark-mode .config-section {
    border-bottom-color: #333;
}

.dark-mode .section-label {
    color: #e0e0e0;
}

.dark-mode .checkbox-option {
    background: #1e1e1e;
    border-color: #333;
}

.dark-mode .checkbox-option:hover {
    background: #2a2a4a;
    border-color: #667eea;
}

.dark-mode .option-text {
    color: #e0e0e0;
}

.dark-mode .input-number {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

.dark-mode .current-result,
.dark-mode .useragent-info,
.dark-mode .history-section {
    background: #252525;
}

.dark-mode .useragent-display,
.dark-mode .history-item {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

.dark-mode .info-key {
    color: #999;
}

.dark-mode .info-value {
    color: #e0e0e0;
}

.dark-mode .result-label {
    color: #e0e0e0;
}

.dark-mode .empty-state {
    color: #666;
}

.dark-mode .shortcuts-panel,
.dark-mode .history-panel {
    background: #252525;
}

.dark-mode .shortcut-item,
.dark-mode .history-detail-item {
    background: #1e1e1e;
}

.dark-mode .shortcut-desc {
    color: #e0e0e0;
}

.dark-mode .history-detail-ua {
    background: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .panel-footer {
    background: #1e1e1e;
    border-top-color: #333;
}

/* 全屏模式 */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fullscreen-mode .main-content {
    height: calc(100vh - 50px) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .config-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .resizer {
        display: none;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
    }
    
    .toolbar-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .info-display {
        grid-template-columns: 1fr;
    }
    
    .shortcuts-panel,
    .history-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .exit-fullscreen-btn {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
}
