* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #4a5568;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #718096;
}

.controls {
    display: flex;
    justify-content: right;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

label {
    font-weight: 500;
    color: #4a5568;
}

input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    width: 60px;
    text-align: center;
    color: #4a5568;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #5a67d8;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.grid-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.grid-item {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    min-height: 120px;
    overflow: hidden;
    background: white;
    border: 1px #e2e8f0;
    user-select: none;
    touch-action: none;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.grid-item.has-content {
    border: none;
}

.grid-item.has-image {
    /*background: transparent !important;*/
    border: none;
}

.grid-item.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.grid-item.drag-over {
    border: 2px dashed #5a67d8;
    background: rgba(90, 103, 216, 0.1);
}

.grid-item .title {
    margin-top: 10px;
    font-weight: 600;
    font-size: 1rem;
    z-index: 1;
    color: #2d3748;
}

.grid-item.has-image .title {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 8px;
    margin: 0;
    font-size: 0.9rem;
}

.grid-item.has-image:hover .title {
    display: block;
}

.grid-item .thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    object-fit: contain;
    z-index: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grid-item .empty-hint {
    display: none;
    color: #a0aec0;
    font-size: 0.9rem;
}

.grid-item:not(.has-content):hover .empty-hint {
    display: block;
}

.grid-item .drag-handle {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    opacity: 0;
    cursor: grab;
    transition: opacity 0.3s;
    z-index: 10;
}

.grid-item:hover .drag-handle {
    opacity: 0.5;
}

.grid-item .drag-handle:hover {
    opacity: 1;
}

.grid-item .drag-handle::before {
    content: "⋮⋮";
    color: #718096;
    font-size: 14px;
}

.context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
    min-width: 200px;
}

.context-menu ul {
    list-style: none;
}

.context-menu li {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.context-menu li:last-child {
    border-bottom: none;
}

.context-menu li:hover {
    background: #f0f5ff;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    color: #4a5568;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.modal-buttons button {
    padding: 10px 20px;
}

.cancel-btn {
    background: #a0aec0;
}

.cancel-btn:hover {
    background: #718096;
}

.info-btn {
    background: #9f7aea;
}

.info-btn:hover {
    background: #805ad5;
}

.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
    color: #718096;
}

.footer a{
    text-align: center;
    padding: 0px;
    font-size: 0.9rem;
    opacity: 0.8;
    color: #718096;
}

.settings-btn {
    background: #38a169;
}

.settings-btn:hover {
    background: #2f855a;
}

.data-btn {
    background: #ed8936;
}

.data-btn:hover {
    background: #dd7711;
}

.settings-menu {
    display: none;
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 100;
    margin-top: 10px;
    width: 200px;
}

.data-menu {
    display: none;
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 100;
    margin-top: 10px;
    width: 200px;
}

.settings-container, .data-container {
    position: relative;
    display: inline-block;
}

.info-content {
    line-height: 1.6;
    color: #4a5568;
}

.info-content h3 {
    margin: 20px 0 10px 0;
    color: #2d3748;
}

.info-content p {
    margin-bottom: 15px;
}

.info-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-content li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group {
        width: 100%;
        justify-content: center;
    }
    
    h1 {
        font-size: 2rem;
    }
}