/* css/style.css - 基础样式和浅色主题 */
:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4895ef;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --card-bg: #fff;
    --border: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --success: #4ade80;
    --warning: #facc15;
    --danger: #f87171;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    background-color: var(--primary);
    color: white;
}

.theme-toggle button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text);
}

.theme-toggle button:hover {
    background-color: #f0f0f0;
}

/* 首页样式 */
.hero {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    padding: 40px 0;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-image {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
}

.btn.primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
}

.hero-cta {
    display: flex;
    gap: 15px;
}

/* 工具介绍部分 */
.tools-intro {
    margin-bottom: 60px;
}

.tools-intro h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    width: 80px;
    height: 80px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.tool-icon i {
    font-size: 2.5rem;
    color: var(--primary);
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.tool-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* 工具页样式 */
.tool-page {
    margin: 40px 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tool-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.tool-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text);
}

input, textarea, select {
    width: 100%;
    padding: 14px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

textarea {
    min-height: 150px;
    resize: vertical;
    font-family: monospace;
}

.tool-actions {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.result-container {
    margin-top: 30px;
    border-top: 1px solid var(--border);
    padding-top: 25px;
}

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

.result-box {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.btn.icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

/* 页脚样式 */
footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.2rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-info {
    text-align: center;
}

/* 密码生成器特定样式 */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

.btn-full {
    width: 100%;
    margin: 20px 0;
}

/* 密码强度计 */
.strength-meter {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.strength-0 { width: 20%; background: #f87171; }
.strength-1 { width: 40%; background: #f97316; }
.strength-2 { width: 60%; background: #facc15; }
.strength-3 { width: 80%; background: #4ade80; }
.strength-4 { width: 100%; background: #22c55e; }

.strength-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 正则表达式工具样式 */
.regex-flags {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.flag-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-area {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* 高亮匹配 */
.highlight {
    background-color: rgba(67, 97, 238, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--card-bg);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
    }
    
    .hero-content, .hero-image {
        width: 100%;
    }
    
    .navbar {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .tool-actions {
        flex-direction: column;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .tool-header h1 {
        font-size: 1.8rem;
    }
}