/**
 * 公共样式
 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 工具卡片通用样式 */
.tool-card {
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
}

/* 分类标题 */
.category-title {
    margin: 24px 0 16px;
    padding-left: 12px;
    border-left: 4px solid #00BCD4;
    font-weight: 500;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

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

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

.form-control:focus {
    outline: none;
    border-color: #00BCD4;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00BCD4 0%, #03A9F4 100%);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 文本区域 */
.textarea-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* 结果展示区域 */
.result-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    margin-top: 16px;
    min-height: 100px;
    max-height: 400px;
    overflow: auto;
}

/* 代码高亮 */
pre {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #00BCD4;
    background-color: rgba(0, 188, 212, 0.05);
}

.upload-area.dragover {
    border-color: #00BCD4;
    background-color: rgba(0, 188, 212, 0.1);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00BCD4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.alert-success {
    background-color: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.alert-error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    font-weight: 500;
    background-color: #f5f5f5;
}

.table tr:hover {
    background-color: #f9f9f9;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-primary {
    background-color: #e3f2fd;
    color: #1976d2;
}

.tag-success {
    background-color: #e8f5e9;
    color: #388e3c;
}

.tag-warning {
    background-color: #fff3e0;
    color: #f57c00;
}

/* 进度条 */
.progress {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00BCD4 0%, #03A9F4 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

/* 滑块 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00BCD4;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00BCD4;
    cursor: pointer;
    border: none;
}

/* 复选框和单选框 */
input[type="checkbox"],
input[type="radio"] {
    margin-right: 6px;
}

/* 响应式工具 */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}

/* 工具页面特定样式 */
.tool-page-title {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.tool-description {
    color: #666;
    margin-bottom: 20px;
}

/* 图片预览 */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 对比容器 */
.compare-container {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.compare-item {
    flex: 1;
    min-width: 200px;
}

.compare-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #666;
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, #00BCD4 0%, #03A9F4 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 帮助提示 */
.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 复制按钮 */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    font-size: 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.copy-btn:hover {
    background-color: #f5f5f5;
}

.code-container {
    position: relative;
}
