/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .copy-btn, .btn, button {
        min-height: 44px; /* Apple HIG 推荐的最小触摸目标 */
        min-width: 44px;
        padding: 12px 20px !important;
    }
    
    .file-select {
        display: inline-block;
        padding: 8px 16px;
        background: #667eea;
        color: white !important;
        border-radius: 6px;
        text-decoration: none !important;
        margin: 10px 0;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    /* 增加按钮之间的间距，防止误触 */
    .button-group {
        gap: 15px;
    }
    
    .result-actions {
        gap: 10px;
    }
    
    /* 增大输入框触摸区域 */
    .url-input {
        padding: 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 增大预览图片尺寸 */
    .preview-item img {
        height: 120px;
    }
    
    /* 增大删除按钮 */
    .remove-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* 防止iOS缩放输入框 */
input, select, textarea {
    font-size: 16px !important;
}

/* 按钮悬停效果 */
.btn:hover:not(:disabled), 
.copy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 按钮激活状态 */
.btn:active:not(:disabled),
.copy-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* 禁用状态 */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

/* 上传区域激活状态 */
.upload-area.active {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* 文件选择文字样式 */
.file-select {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.file-select:hover {
    color: #764ba2;
}

/* 复制按钮组 */
.copy-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.copy-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: #f1f3f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.copy-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.copy-btn:active {
    transform: scale(0.98);
}

/* 进度动画 */
@keyframes progressAnimation {
    0% { background-position: 0% 0; }
    100% { background-position: 100% 0; }
}

.progress {
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: progressAnimation 2s linear infinite;
}

/* 文件预览动画 */
.preview-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 结果项动画 */
.upload-result-item {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 成功消息动画 */
.success-message {
    animation: fadeSlideIn 0.5s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 手机端优化 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .card {
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .upload-area {
        padding: 25px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* 确保按钮在手机上更容易点击 */
    .btn, .copy-btn, button {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
    
    /* 增大触摸目标 */
    .copy-btn {
        min-height: 40px;
        padding: 10px;
        font-size: 14px;
    }
    
    /* 预览网格调整为2列 */
    .preview-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-content {
    padding: 20px;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
}

.file-select {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f1f3f9;
    color: #666;
}

.btn-secondary:hover {
    background: #e4e8f4;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.image-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.image-info {
    padding: 12px;
    background: #f9f9f9;
}

.image-info p {
    margin: 5px 0;
    font-size: 13px;
}

.image-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-info h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.form-inline .form-control {
    flex: 1;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* 预览模态框 */
#preview-modal .modal-content {
    background: transparent;
    box-shadow: none;
    max-width: 90%;
    max-height: 90%;
}

#preview-modal img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h2 {
    color: #333;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
}

.page-link {
    padding: 8px 16px;
    background: #f1f3f9;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-info {
    color: #666;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* IP列表 */
.ip-list ul {
    list-style: none;
    margin-top: 20px;
}

.ip-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ip-address {
    font-family: monospace;
    color: #e74c3c;
}

/* 预览容器 */
#preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.preview-item {
    position: relative;
}

.preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页脚卡片 */
.footer-card {
    text-align: center;
    background: #f8f9ff;
}

.footer-card .card-content {
    padding: 30px 20px;
}

.stats {
    margin-top: 20px;
    color: #666;
}

/* 管理员头部 */
.admin-header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.admin-nav {
    display: flex;
    gap: 10px;
}

/* 警告框 */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Markdown样式 */
.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .card-header {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .card-content {
        padding: 16px;
    }
}