/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90d9;
    --primary-dark: #357abd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #f5f7fa;
    --sidebar-bg: #2c3e50;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--primary-color);
}

.nav-menu {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section h3 {
    padding: 10px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

/* 顶部栏 */
.header {
    background: var(--card-bg);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 i {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 统计显示 */
.stats-display {
    display: flex;
    gap: 20px;
    margin-right: 20px;
    padding-right: 20px;
    border-right: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-light);
    background: #f8f9fa;
    padding: 8px 14px;
    border-radius: 20px;
    transition: all 0.3s;
}

.stat-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.stat-item i {
    color: var(--primary-color);
    font-size: 14px;
}

.stat-item span {
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Consolas', monospace;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 工具容器 */
.tool-container {
    padding: 30px;
}

.tool-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 输入/输出区域 */
.input-section, .output-section {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 16px;
    color: var(--text-color);
}

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

.section-header .info {
    font-size: 12px;
    color: var(--text-light);
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: none;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--card-bg);
}

textarea:focus {
    outline: none;
}

textarea[readonly] {
    background: #f8f9fa;
}

/* 工具选项 */
.tool-options {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tool-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.tool-options input[type="checkbox"],
.tool-options input[type="radio"] {
    cursor: pointer;
}

.tool-options select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* 时间戳转换器 */
.timestamp-converter {
    display: grid;
    gap: 20px;
}

.time-box, .converter-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.time-box h4, .converter-box h4 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.time-display {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timestamp-display {
    font-size: 14px;
    color: var(--text-light);
    font-family: monospace;
}

.converter-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
}

.converter-box .btn {
    margin-bottom: 10px;
}

.result {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: monospace;
    min-height: 40px;
}

/* UUID生成器 */
.uuid-generator, .password-generator, .qr-generator {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.uuid-options, .password-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.uuid-options label, .password-options label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uuid-output {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: monospace;
}

.uuid-item {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* 密码生成器 */
.password-output {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.password-output input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 16px;
}

.password-strength {
    margin-top: 10px;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
}

.strength-weak { background: var(--danger-color); }
.strength-medium { background: var(--warning-color); }
.strength-strong { background: var(--success-color); }

/* 二维码生成器 */
.qr-generator textarea {
    min-height: 100px;
    margin-bottom: 15px;
}

.qr-options {
    margin-bottom: 15px;
}

.qr-output {
    margin-top: 20px;
    text-align: center;
}

.qr-output img {
    max-width: 100%;
    height: auto;
}

/* 进制转换器 */
.radix-converter {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.radix-box {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.radix-box h4 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.radix-box h4::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 2px;
}

.radix-box input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.radix-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.radix-box input::placeholder {
    color: #aaa;
    font-size: 14px;
}

.radix-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .tool-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 选中文字样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

/* 提示框 */
.tooltip {
    position: fixed;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    display: none;
}

.tooltip.show {
    display: block;
}
