/* frontend/css/style.css */

/* --- 主页样式 --- */
body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.background {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    z-index: -1;
    transition: opacity 1s ease-in-out;
    opacity: 1;
}
.card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    margin: 0 auto;
    position: relative;
}
.title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}
.uniform-height { margin-top: 20px; }
.control-button {
    position: absolute;
    top: 10px;
    background: none; border: none;
    color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 22px;
    transition: color 0.3s ease;
}
.control-button:hover { color: rgba(0, 0, 0, 0.6); }
#viewCacheBtn { right: 10px; }
#compressionToggleBtn { right: 50px; }
#intelligentModeBtn { right: 90px; }
#intelligentModeBtn.active { color: #007bff; }
#cacheContent {
    margin-top: 20px; max-height: 200px;
    border-radius: 5px; overflow-y: auto;
    text-align: left;
}
.cache-item {
    display: block; cursor: pointer;
    border-radius: 4px; padding: 10px;
    transition: background-color 0.3s ease;
}
.cache-item:hover { background-color: #e9ecef; }
.project-link {
    font-size: 14px; text-align: center;
    margin-top: 15px; margin-bottom: 0;
}
textarea.form-control {
    max-height: 200px; overflow-y: hidden; resize: none;
}

/* --- 管理后台样式 --- */
.header {
    position: sticky; top: 0;
    background-color: #ffffff; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px; flex-wrap: wrap;
}
.header-left, .header-right { display: flex; align-items: center; gap: 15px; }
.header-right.hidden { display: none; }
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 20px;
}
.media-container {
    position: relative; overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.media-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.media-container.selected::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 10px;
    background-color: #007bff; color: white;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 14px;
    font-weight: bold;
}
.gallery-image {
    width: 100%; height: 100%;
    object-fit: cover;
}
.footer { margin-top: 20px; text-align: center; font-size: 18px; color: #555; }
.action-button, .copy-button, .delete-button {
    background-color: #007bff; color: white;
    border: none; border-radius: 5px; padding: 10px 15px;
    cursor: pointer; transition: background-color 0.3s;
}
.delete-button { background-color: #dc3545; }
.action-button:hover, .copy-button:hover { background-color: #0056b3; }
.delete-button:hover { background-color: #c82333; }
.dropdown { position: relative; display: inline-block; }
.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; border-radius: 8px;
    padding: 5px 0;
}
.dropdown-content button {
    color: black; padding: 10px 15px;
    text-decoration: none; display: block;
    background: none; border: none; width: 100%; text-align: left;
}
.dropdown-content button:hover { background-color: #f1f1f1; }
.dropdown:hover .dropdown-content { display: block; }
.loading-text { font-size: 1.2rem; color: #888; text-align: center; }