body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    /* max-width removed for a fully fluid layout */
    margin: 0;
    padding: 20px; /* Provides space from screen edges */
    flex-grow: 1;
}

h1 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-top: 1em;
    margin-bottom: 0.5em;
    text-align: center;
}

h2 {
    font-size: 1.6em;
    color: #34495e;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

textarea {
    width: 100%; /* Default to full width */
    min-height: 300px;
    padding: 10px;
    margin: 10px 0; /* Add some vertical margin */
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    resize: vertical;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 0.9em;
}

button {
    padding: 10px 20px;
    margin-top: 10px;
    margin-right: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #2980b9;
}

.container-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Add gap between flex items */
}

.input-group, .output-group {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.output-group p {
    margin: 5px 0;
}

.output-group pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #eef;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dde;
}

.error {
    color: red;
    font-weight: bold;
}

.success {
    color: green;
    font-weight: bold;
}

.note {
    color: #777;
    font-size: 0.9em;
    margin-top: 10px;
}

header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 0; /* Restore overall vertical padding */
    text-align: center; /* Center everything in the header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header h1 {
    margin: 0;
    font-size: 2.5em;
}
header p {
    margin-top: 0.5em;
    font-size: 1.1em;
}
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1.5em 0;
    margin-top: 30px;
    font-size: 0.9em;
}
footer a {
    color: #3498db;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Dropdown Navigation */
.navbar {
    background-color: #333;
    overflow: hidden;
    display: flex;
    justify-content: flex-start;
    margin-top: 0; /* Add some margin between subtitle and navbar */
    padding: 0; /* Let anchor tags handle padding */
}

.navbar a {
    font-size: 16px;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

.dropdown {
    overflow: hidden;
}

.dropdown .dropbtn {
    font-size: 16px;
    border: none;
    outline: none;
    color: white;
    padding: 14px 16px;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    cursor: pointer;
}

.navbar a:hover, .dropdown:hover .dropbtn {
    background-color: #555;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}



/* Rule for textareas within a flex container */
.container-flex textarea {
    flex-grow: 1;   /* 允许元素扩展以填充可用空间 */
    flex-basis: 0;  /* 从0开始计算宽度，确保公平分配 */
    width: auto;      /* 覆盖通用的 width: 49% 设置 */
}

/* Styles for Navbar Logo */
.navbar a.logo-link {
    padding: 8px 16px; /* Adjust padding to vertically center the logo area */
}

.navbar .logo-link img {
    height: 28px; /* Set logo height to fit navbar */
    vertical-align: middle; /* Ensures logo aligns well with text on other nav items */
}

/* --- Responsive Navbar Styles --- */

/* Wrapper for the dropdown links */
.navbar-links {
    display: flex;
    align-items: center;
}

/* Hamburger icon, hidden by default on desktop */
.hamburger-icon {
    display: none;
    cursor: pointer;
    padding: 14px 16px;
    color: white;
    font-size: 20px;
	text-decoration: none;
}

/* Media query for mobile screens */
@media screen and (max-width: 860px) { /* Adjusted breakpoint */
    
    .navbar {
        /* Change alignment to space between logo and hamburger */
        justify-content: space-between;
    }

    /* Hide the container of links on mobile */
    .navbar-links {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 2; /* Ensure it appears below the logo/hamburger line */
    }

    /* Show the hamburger icon */
    .hamburger-icon {
        display: block;
        order: 1; /* Keep it on the top line */
    }
    
    .navbar a.logo-link {
        order: 0; /* Keep logo on the top line */
    }

    /* The 'responsive' class is added via JS on hamburger click */
    .navbar.responsive {
        flex-wrap: wrap; /* Allow wrapping */
    }

    .navbar.responsive .navbar-links {
        display: flex; /* Show the links */
    }
    
    .navbar.responsive .dropdown {
        width: 100%;
    }
    
    .navbar.responsive .dropdown .dropbtn {
        text-align: left;
        width: 100%;
    }
    
    .navbar.responsive .dropdown-content {
        position: relative;
        width: 100%;
    }
}
/* Homepage specific styles */

.container {
    min-width: 300px; /* Prevent it from becoming too narrow on very small screens */
    margin: 10px auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-grow: 1;
}
.category {
    margin-bottom: 2.5em;
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.category h2 {
    font-size: 1.8em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5em;
    margin-bottom: 1.2em;
    margin-top: 0; /* Changed margin-top to 0 */
}
.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: flex-start; /* Align items to the start (left) */
}
.category-links a {
    display: inline-block;
    padding: 0.8em 1.5em;
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    text-decoration: none;
    color: #34495e;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}
.category-links a:hover {
    background-color: #3498db;
    border-color: #2980b9;
    color: #fff;
    transform: translateY(-2px);
}

h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
h2 {
    color: #34495e;
    margin-top: 30px;
    margin-bottom: 15px;
}
p {
    margin-bottom: 15px;
}