/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 40px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.navbar-brand a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-item {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.navbar-item:hover,
.navbar-item.active {
    color: #007bff;
}

/* 主内容区域 */
main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* 英雄区域 */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #333;
}

.hero p {
    font-size: 20px;
    color: #666;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 60px;
}

.upload-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.upload-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-area {
    display: block;
    width: 100%;
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.upload-area.dragover {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.upload-icon {
    width: 60px;
    height: 60px;
    color: #007bff;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 16px;
    color: #666;
}

.visually-hidden-file-input {
    display: none;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #007bff;
    width: 0%;
    transition: width 0.3s;
}

#progressText {
    text-align: center;
    color: #666;
}

/* 上传结果 */
.result-box {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.result-info {
    flex: 1;
}

.result-info p {
    margin-bottom: 10px;
    font-weight: bold;
}

.url-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    margin-bottom: 10px;
}

/* 功能特性 */
.features {
    margin-bottom: 60px;
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.feature-card p {
    color: #666;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 认证页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.register-box {
    max-width: 620px;
}

.auth-box h1 {
    margin-bottom: 30px;
    text-align: center;
}

.form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.auth-link {
    text-align: center;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* 提示信息 */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 仪表板 */
.dashboard {
    padding: 20px 0;
}

.dashboard h1 {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

/* 图片网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.image-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-info {
    padding: 15px;
}

.image-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size,
.image-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.image-actions {
    padding: 10px 15px;
    display: flex;
    gap: 10px;
}

.image-actions .btn {
    flex: 1;
    text-align: center;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-info {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.empty-message {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* API页面 */
.api-section {
    padding: 20px 0;
}

.api-section h1 {
    margin-bottom: 30px;
}

.api-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.api-card h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.api-card h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.api-card ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.api-card li {
    margin-bottom: 8px;
}

.api-card code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.api-card pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.api-card pre code {
    background-color: transparent;
    padding: 0;
}

.api-info {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.api-key-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.api-key-box input {
    flex: 1;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stats-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .result-box {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .image-card img {
        height: 150px;
    }

    .api-key-box {
        flex-direction: column;
    }
}
