* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 100%; /* 容器宽度不超过屏幕 */
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 15px 0;
    color: #2c3e50;
}

.upload-form {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
}

button:hover {
    background: #2980b9;
}

.message {
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
}

.success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.error {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* 手机端图片核心样式 */
.mobile-image {
    max-width: 90vw; /* 最大宽度=屏幕宽度的90% */
    max-height: 50vh; /* 最大高度=屏幕高度的50% */
    height: auto; /* 保持比例 */
    display: block;
    margin: 15px auto; /* 居中并留间距 */
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

.links {
    margin: 15px 0;
}

.links p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.links input, .image-info input {
    width: 100%;
    padding: 8px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-link {
    text-align: center;
    margin: 20px 0;
}

.back-link {
    display: inline-block;
    margin: 10px 0;
    color: #3498db;
    text-decoration: none;
}

.images-list {
    display: grid;
    grid-template-columns: 1fr; /* 手机端强制单列 */
    gap: 15px;
    margin-top: 20px;
}

.image-item {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
}

.image-info {
    margin-top: 10px;
    font-size: 0.9rem;
}

.delete-btn {
    display: inline-block;
    margin-top: 10px;
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
}

.no-images {
    text-align: center;
    padding: 30px 0;
    color: #777;
}

/* 平板及以上设备适配 */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
        padding: 20px;
    }
    .images-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .mobile-image {
        max-width: 100%;
        max-height: 300px;
    }
}