/* --- 全局样式与变量 --- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --bg-light: #fafbfc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

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

/* --- 顶部导航 --- */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 36px;
    color: var(--primary);
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--gray);
    font-size: 16px;
}

/* --- 工具导航栏 --- */
.tools-nav {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.tools-nav-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.tools-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-right: auto;
}

.nav-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.tools-nav-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.tools-nav-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.nav-tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
}

.nav-tool-item:hover {
    background-color: var(--bg-light);
}

.nav-tool-item.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-tool-item i {
    font-size: 18px;
}

.nav-tool-name {
    font-size: 14px;
    font-weight: 500;
}

/* --- 工具容器 --- */
.tool-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon i {
    font-size: 26px;
    color: white;
}

.tool-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.tool-description {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
}

/* --- 表单与控件 --- */
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

textarea, select, input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: inherit;
}

textarea:focus, select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

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

.btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

/* --- 通知 --- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: #ef4444;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* --- 响应式设计 --- */
@media (max-width: 768px) {
    .tools-nav-content {
        grid-template-columns: 1fr;
    }
    
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
    }
}