:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --text-secondary: #7f8c8d;
    --bg-color: #f9f9f9;
    --bg-primary: #fff;
    --border-color: #ddd;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-dashed: #3498db;
    --error-bg: #f8d7da;
    --error-border: #f5c6cb;
    --error-text: #721c24;
}

.dark-theme {
    --primary-color: #2196f3;
    --primary-dark: #1976d2;
    --secondary-color: #bbdefb;
    --text-color: #f0f0f0;
    --text-secondary: #b0bec5;
    --bg-color: #121212;
    --bg-primary: #1e1e1e;
    --border-color: #333;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --border-dashed: #2196f3;
    --error-bg: #442226;
    --error-border: #d32f2f;
    --error-text: #ef9a9a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    transition: transform 0.3s ease;
}

.dark-theme .container:hover {
    animation: subtle-glow 2s infinite alternate;
}

@keyframes subtle-glow {
    0% {
        box-shadow: 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 15px rgba(33, 150, 243, 0.1);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-checkbox {
    display: none;
}

.theme-label {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    background: linear-gradient(40deg, #ff0080, #ff8c00 70%);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    overflow: hidden;
}

.dark-theme .theme-label {
    background: linear-gradient(40deg, #8983f7, #1a35d1 70%);
}

.theme-icon {
    position: absolute;
    top: 6px;
    font-size: 16px;
    transition: 0.3s ease;
}

.sun-icon {
    left: 8px;
    transform: translateX(0);
    opacity: 1;
}

.moon-icon {
    right: 8px;
    transform: translateX(0);
    opacity: 0.7;
}

.toggle-ball {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#themeToggle:checked + .theme-label .toggle-ball {
    transform: translateX(30px);
}

.note {
    display: none;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .upload-section {
        flex-direction: row;
    }
    
    .upload-area {
        flex: 2;
    }
    
    .options-section {
        flex: 1;
    }
}

.upload-area {
    background-color: var(--bg-primary);
    border: 2px dashed var(--border-dashed);
    border-radius: 8px;
    padding: 2rem;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background-color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .upload-area:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.upload-area.drag-over {
    background-color: rgba(33, 150, 243, 0.1);
    border-color: var(--primary-color);
}

.upload-prompt {
    text-align: center;
}

.upload-prompt img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    color: var(--primary-color);
}

.dark-theme .upload-prompt img {
    filter: brightness(1.2);
}

.dark-theme #uploadIcon {
    color: var(--primary-color);
}

.preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

#imagePreview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clear-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: #e74c3c;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.clear-btn::before {
    content: "×";
    font-weight: bold;
}

.options-section {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.options-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .options-section:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.option-item {
    margin-bottom: 1.5rem;
}

.option-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.option-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.option-item select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.analyze-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.analyze-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    transform: translateY(0);
}

.analyze-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.analyze-btn:active:after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

.results-section {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.results-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .results-section:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    color: var(--secondary-color);
    margin: 0;
    transition: color 0.3s ease;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover {
    color: var(--primary-dark);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(1);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
    border-bottom: 1px dashed var(--border-color);
}

.spinner {
    display: none;
}

.result-content {
    padding: 1rem 0;
    line-height: 1.8;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.result-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    transition: color 0.3s ease;
    animation: fade-in 0.5s ease-out;
}

.result-content p {
    margin-bottom: 1rem;
    animation: fade-in 0.5s ease-out;
}

.result-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    animation: fade-in 0.5s ease-out;
}

.error-message {
    padding: 1rem;
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 4px;
    color: var(--error-text);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.deploy-info {
    font-size: 0.8rem;
}

.info-box {
    display: none;
}

.api-notice {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 248, 189, 0.3);
    border-radius: 4px;
    font-size: 0.85rem;
}

.api-notice p {
    margin: 0.5rem 0;
}

.progress-container {
    height: 6px;
    width: 100%;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
    position: relative;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
    border-radius: 3px;
    overflow: hidden;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.progress-text {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.url-input-container {
    display: flex;
    margin-bottom: 0.5rem;
}

.url-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-color);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.fetch-btn {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fetch-btn:hover {
    background-color: var(--primary-dark);
}

.fetch-btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.fetch-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.fetch-btn:active:after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 1000;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    20% { opacity: 1; transform: translate(-50%, 0); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 