* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
}

.nav {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.nav > a,
.nav > .dropdown > a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav > a:hover,
.nav > .dropdown > a:hover {
    background: #34495e;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: flex;
    align-items: stretch;
}

.dropdown > a {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    top: 100%;
    left: 0;
    border-radius: 0 0 4px 4px;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown-content a {
    color: #333;
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #ecf0f1;
}

.dropdown:hover > .dropdown-content {
    display: block;
}

.dropdown:hover > a {
    background: #34495e;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }
    
    .nav {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* 首页样式 */
.hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
}

.hero p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: white;
    padding: 1.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid #e1e8ed;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.tool-card h3 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.tool-card p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

/* 工具页面样式 */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.tool-page h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.description {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.tool-form {
    background: white;
    padding: 1.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e1e8ed;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.button-group {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.result-section {
    margin-top: 1.5rem;
}

.result-section h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.result-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
    word-break: break-all;
}

.result-box code {
    color: #2c3e50;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* 尾部样式 */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.ad-section {
    margin-bottom: 1.5rem;
}

.ad-placeholder {
    background: #34495e;
    padding: 1.5rem;
    text-align: center;
    border-radius: 4px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    font-size: 0.9rem;
}

.footer-content {
    text-align: center;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid #34495e;
    font-size: 0.9rem;
}

.footer-content p {
    margin: 0.5rem 0;
}

.footer-content a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #3498db;
}

.analytics {
    margin-top: 1rem;
}

/* 工具页脚导航 */
.tool-footer-nav {
    background: #ecf0f1;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid #bdc3c7;
}

.tool-footer-nav h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.footer-tool-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: white;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.footer-tool-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.footer-tool-link.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 500;
}
