:root {
    --primary-color: #ff6f61;
    --secondary-color: #4a4a4a;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #333333;
    --header-height: 60px;
}

/* --- Global Styles --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding-top: var(--header-height);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--surface-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
}

.nav-logo {
    font-size: 1.5em;
    font-weight: bold;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li a {
    color: var(--secondary-color);
    padding: 20px 15px;
    font-weight: 500;
}
nav ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.hero h1 {
    font-size: 2.5em;
    color: var(--primary-color);
}
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1.2em;
    margin-top: 20px;
    transition: transform 0.2s;
}
.cta-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

/* --- Article List --- */
.article-list h2 {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 30px;
}
.article-list article {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.article-list article h3 {
    margin-top: 0;
}
.read-more {
    font-weight: bold;
}

/* --- Article Viewer (Modal) --- */
#article-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}
#article-viewer.hidden {
    display: none;
}
#article-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
#article-content h2 {
    margin-top: 0;
    color: var(--primary-color);
}
#close-article {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
}

/* --- Ad Container --- */
.ad-container {
    margin: 40px 0;
    text-align: center;
}

/* --- Tool Page Styles --- */
.tool-section-standalone {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}
#image-container {
    margin: 30px auto;
    border: 2px dashed #ccc;
    border-radius: 8px;
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}
#uploaded-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}
#label-container {
    margin-top: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    min-height: 40px;
}
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: 10px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 20px;
    color: #777;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    nav ul {
        display: none;
    }
    .hero h1 {
        font-size: 2em;
    }
    main {
        padding: 20px 15px;
    }
}