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

/* 渐进渐出动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-out {
    animation: fadeOutDown 0.4s ease forwards;
}

/* 延迟动画 */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #2c2c2c;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding-top: 50px;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2em;
    outline: none;
    cursor: text;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

h1:focus {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.import-section {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    display: flex;
    gap: 12px;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.glass-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.reset-btn {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.4);
}

.reset-btn:hover {
    background: rgba(255, 107, 107, 0.35);
}

.reset-btn:active {
    background: rgba(255, 107, 107, 0.45);
}

.import-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.import-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.import-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.3);
}

#fileInput {
    display: none;
}

.ranking-wrapper {
    display: flex;
    background: #3a3a3a;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.3s;
}

.tier-labels {
    display: flex;
    flex-direction: column;
    width: 100px;
    flex-shrink: 0;
}

.tier-label {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.tier-label:last-child {
    border-bottom: none;
}

.tier-夯 {
    background: #ff6b6b;
}

.tier-顶级 {
    background: #ffa94d;
}

.tier-人上人 {
    background: #9775fa;
}

.tier-npc {
    background: #4dabf7;
}

.tier-拉完了 {
    background: #868e96;
}

.tier-areas {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tier-area {
    height: 140px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.tier-area:last-child {
    border-bottom: none;
}

.tier-items {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
    overflow-x: auto;
    transition: all 0.3s;
}

.tier-items::-webkit-scrollbar {
    height: 6px;
}

.tier-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tier-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.tier-items.drag-over {
    background: rgba(255, 255, 255, 0.1);
}

.pool-container {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.4s;
}

.pool-container h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.pool-items {
    background: #3a3a3a;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pool-items.drag-over {
    background: #4a4a4a;
}

.item {
    width: 90px;
    max-width: 90px;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: transform 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
    box-sizing: border-box;
}

.item:hover {
    transform: scale(1.05);
}

.item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: none !important;
}

.item-image-wrapper {
    width: 90px;
    max-width: 90px;
    min-width: 90px;
    height: 90px;
    max-height: 90px;
    min-height: 90px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s;
    box-sizing: border-box;
}

.item:hover .item-image-wrapper {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.item img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover;
    display: block;
}

.item-file-name {
    width: 100%;
    margin-top: 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    max-height: 0;
    transition: all 0.3s ease;
}

.item.show-file-name .item-file-name {
    opacity: 1;
    max-height: 20px;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.back-button svg {
    width: 16px;
    height: 16px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #808080;
    font-size: 14px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.5s;
}
