/* 编码转换器样式 */

.tool-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 标签页样式 */
.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1px;
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #4a90e2;
}

.tab-btn.active {
    color: #4a90e2;
    border-bottom: 2px solid #4a90e2;
}

.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
}

.conversion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* Unix时间戳工具样式 */
.unix-timestamp-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.encoding-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.encoding-option {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.encoding-option:hover {
    background-color: #e0e0e0;
}

.encoding-option.active {
    background-color: #4a90e2;
    color: white;
    border-color: #3a80d2;
}

/* 转换区域样式 */
.conversion-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

@media (min-width: 768px) {
    .conversion-area {
        flex-direction: row;
    }
    
    /* 添加中间分隔线和交换按钮 */
    .conversion-area::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 80%;
        width: 1px;
        background-color: #ddd;
        pointer-events: none;
    }
    
    body.dark-mode .conversion-area::after {
        background-color: #444;
    }
}

.input-area, .output-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

/* 添加区域悬停效果 */
.input-area:hover, .output-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

body.dark-mode .input-area:hover, 
body.dark-mode .output-area:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.area-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.area-actions {
    display: flex;
    gap: 8px;
}

.text-area {
    width: 100%;
    height: 250px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background-color: #f9f9f9;
    line-height: 1.5;
    transition: all 0.3s ease;
    overflow: auto;
}

.text-area:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.output-text {
    background-color: #f0f7ff;
}

/* 添加行号效果 */
.text-area.with-line-numbers {
    padding-left: 3.5em;
    background-image: linear-gradient(to right, #f0f0f0 3em, #ddd 3em, #ddd calc(3em + 1px), transparent calc(3em + 1px));
    background-attachment: local;
    background-repeat: no-repeat;
    line-height: 1.6em;
    counter-reset: line;
}

body.dark-mode .text-area.with-line-numbers {
    background-image: linear-gradient(to right, #2a2a2a 3em, #444 3em, #444 calc(3em + 1px), transparent calc(3em + 1px));
}

/* 滚动条美化 */
.text-area::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.text-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.text-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.text-area::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

body.dark-mode .text-area::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark-mode .text-area::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode .text-area::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.char-count {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background-color: #357abf;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn i {
    font-size: 14px;
}

body.dark-mode .btn-primary {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .btn-secondary {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 转换控制区域 */
.conversion-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.conversion-type-container {
    margin-bottom: 20px;
}

.conversion-type-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.conversion-type-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 历史记录样式 */
.history-container {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: none;
}

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

.history-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.history-item:hover {
    background-color: #f5f9ff;
}

.history-item:last-child {
    border-bottom: none;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.history-type {
    font-weight: 500;
    color: #4a90e2;
}

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

.history-content {
    font-size: 14px;
}

.history-input, .history-output {
    margin-bottom: 5px;
    word-break: break-all;
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.success {
    background-color: #f0fff0;
    border-left: 4px solid #52c41a;
    color: #52c41a;
}

.error {
    background-color: #fff1f0;
    border-left: 4px solid #ff4d4f;
    color: #ff4d4f;
}

.warning {
    background-color: #fffbe6;
    border-left: 4px solid #faad14;
    color: #faad14;
}

.info {
    background-color: #e6f7ff;
    border-left: 4px solid #1890ff;
    color: #1890ff;
}

/* 交换图标样式 */
.swap-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-icon:hover {
    background-color: #e0e0e0;
}

.swap-icon svg {
    width: 20px;
    height: 20px;
    fill: #666;
}

/* 选项容器样式 */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.option-group {
    flex: 1;
    min-width: 250px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-group input {
    margin-right: 8px;
}

/* 信息区域样式 */
.info-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.info-content {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 15px;
}

.info-content p {
    margin-bottom: 10px;
}

/* 底部推荐工具样式 */
.bottom-recommendations {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 图片预览区域样式 */
.image-preview {
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

/* 增强用户体验的新样式 */
.text-area-wrapper {
    position: relative;
    flex: 1;
}

.text-area-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.text-area-wrapper:hover .text-area-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #ddd;
}

.action-btn:hover {
    background-color: #fff;
    border-color: #4a90e2;
}

.action-btn i {
    font-size: 14px;
    color: #666;
}

/* 输入提示样式 */
.input-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #aaa;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.input-placeholder.hidden {
    opacity: 0;
    transform: translate(-50%, -60%);
}

.input-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    color: #ccc;
}

.input-placeholder span {
    font-size: 14px;
    color: #999;
}

/* 输入区域焦点效果 */
.text-area-wrapper:focus-within {
    position: relative;
}

.text-area-wrapper:focus-within::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 6px;
    border: 2px solid rgba(74, 144, 226, 0.3);
    pointer-events: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(74, 144, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0); }
}

/* 键盘快捷键提示 */
.keyboard-shortcut {
    display: inline-block;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
    margin-left: 5px;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .conversion-area {
        flex-direction: column;
    }
    
    .options-container {
        flex-direction: column;
    }
    
    .option-group {
        width: 100%;
    }
    
    .conversion-buttons {
        justify-content: center;
    }
}

/* 暗色模式支持 */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .tool-content {
    background-color: #1f1f1f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .text-area {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .output-text {
    background-color: #2a3a4a;
}

body.dark-mode .btn-secondary {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background-color: #4a4a4a;
}

body.dark-mode .info-content, 
body.dark-mode .options-container {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .tab-btn {
    color: #bbb;
}

body.dark-mode .tab-btn.active {
    color: #6ab0ff;
    border-bottom-color: #6ab0ff;
}

body.dark-mode .tabs {
    border-bottom-color: #444;
}

body.dark-mode .history-item {
    background-color: #2d2d2d;
    border-color: #444;
}

body.dark-mode .history-item:hover {
    background-color: #3a3a3a;
}

body.dark-mode .option-tip {
    color: #6ab0ff;
}

/* 系统暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    body:not(.light-mode) .tool-content {
        background-color: #1f1f1f;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    body:not(.light-mode) .text-area {
        background-color: #2d2d2d;
        color: #e0e0e0;
        border-color: #444;
    }
    
    body:not(.light-mode) .output-text {
        background-color: #2a3a4a;
    }
    
    body:not(.light-mode) .btn-secondary {
        background-color: #3a3a3a;
        color: #e0e0e0;
    }
    
    body:not(.light-mode) .btn-secondary:hover {
        background-color: #4a4a4a;
    }
    
    body:not(.light-mode) .info-content, 
    body:not(.light-mode) .options-container {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    body:not(.light-mode) .tab-btn {
        color: #bbb;
    }
    
    body:not(.light-mode) .tab-btn.active {
        color: #6ab0ff;
        border-bottom-color: #6ab0ff;
    }
    
    body:not(.light-mode) .tabs {
        border-bottom-color: #444;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: #4a90e2;
    animation: spin 1s ease-in-out infinite;
}

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

/* 结果高亮 */
.highlight {
    background-color: rgba(74, 144, 226, 0.1);
    animation: highlight-fade 1.5s ease-out;
}

@keyframes highlight-fade {
    from { background-color: rgba(74, 144, 226, 0.2); }
    to { background-color: transparent; }
}

/* 全屏模式 */
.text-area.fullscreen {
    font-size: 16px;
    line-height: 1.6;
    padding: 20px;
    border-radius: 0;
    border: none;
    outline: none;
}

/* 选项提示图标 */
.option-tip {
    display: inline-block;
    margin-left: 5px;
    color: #4a90e2;
    cursor: help;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 输入占位符 */
.input-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.input-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ccc;
}

.input-placeholder span {
    color: #999;
    font-size: 14px;
}

/* 改进的按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn i {
    font-size: 14px;
}

/* 改进的标签页样式 */
.tab-btn {
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4a90e2;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.tab-btn:hover::after {
    transform: translateX(0);
}

.tab-btn.active::after {
    transform: translateX(0);
}
