/* --- Global & Base Styles --- */
body, html {
    margin: 0; padding: 0; width: 100%; min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #2c3e50;
    color: #ecf0f1;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

a { color: #3498db; text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #5dade2; }

h1 { font-size: 2.5rem; border-bottom: 2px solid #3498db; padding-bottom: 0.5rem; margin-top: 0; margin-bottom: 1rem; }
p { font-size: 1.2rem; line-height: 1.6; max-width: 600px; color: #bdc3c7; }

/* --- Layout Containers --- */
.container {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    min-height: 100vh; padding: 20px;
}
/* ▼▼▼ 【核心修改在这里】 ▼▼▼ */
.container > main, .tool-container {
    animation: fadeIn 1.5s ease-in-out;
    width: 100%; /* 确保 main 区域宽度正确 */
    flex-grow: 1; /* 允许此元素占据所有可用空间 */
    display: flex; /* 将其自身也变成一个 flex 容器 */
    flex-direction: column; /* 让其内部元素垂直排列 */
    justify-content: center; /* 将其内部元素垂直居中 */
    align-items: center; /* 将其内部元素水平居中 */
}

.page-header { width: 100%; max-width: 800px; padding: 20px 0; align-self: flex-start; text-align: left; }
.home-link { font-size: 1.5rem; font-weight: bold; color: #ecf0f1; }
.site-footer { font-size: 0.9rem; padding: 20px 0; margin-top: auto; }

/* --- Component: Navigation --- */
nav { margin-top: 40px; }
nav a { font-size: 1.1rem; margin: 0 15px; }

/* --- Component: Tool Form --- */
.tool-form {
    background-color: #34495e; padding: 20px 30px; border-radius: 8px; margin-top: 20px;
    display: flex; flex-direction: column; gap: 20px;
    width: 100%; max-width: 400px;
}
.tool-form input[type="file"] { color: #ecf0f1; cursor: pointer; }
.tool-form button {
    background-color: #3498db; color: white; border: none; padding: 12px 20px;
    font-size: 1rem; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease;
}
.tool-form button:hover { background-color: #2980b9; }

/* --- Component: Status & Results --- */
.status { margin-top: 20px; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.stats-counter {
    font-size: 0.9rem; color: #bdc3c7; background-color: #34495e;
    padding: 5px 10px; border-radius: 15px; display: inline-block; margin-top: 0;
}
.queue-status { font-size: 0.9rem; color: #f1c40f; margin-top: -5px; margin-bottom: 10px; font-weight: bold; }
#result-area {
    margin-top: 30px; background-color: #34495e; padding: 20px; border-radius: 8px;
    width: 100%; max-width: 400px; animation: fadeIn 0.5s;
}
.result-details p { margin: 10px 0; font-size: 1.1rem; }
.result-actions { margin-top: 20px; display: flex; justify-content: center; gap: 15px; }
.button {
    display: inline-block; background-color: #3498db; color: white !important; border: none;
    padding: 12px 20px; font-size: 1rem; border-radius: 5px; cursor: pointer;
}
.button:hover { background-color: #2980b9; }
.button-secondary {
    display: inline-block; background-color: transparent; color: #3498db; border: 2px solid #3498db;
    padding: 10px 18px; font-size: 1rem; border-radius: 5px; cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.button-secondary:hover { background-color: #3498db; color: white; }

/* --- Component: Helper Classes --- */
.highlight { color: #3498db; font-weight: bold; }

/* --- Animations --- */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
    border-top: 4px solid #fff; width: 20px; height: 20px; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Media Queries (Responsive) --- */
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    p { font-size: 1rem; }
    .tool-form { padding: 15px 20px; }
}