/* ============================================================
 * modals.css
 * 模态框、服务器选择器、物品信息块
 * ============================================================ */

.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease-out;
}

.modal-mask.show { display: flex; }

.modal {
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.2s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: var(--border);
    flex-shrink: 0;
}

.modal-title { font-size: 15px; font-weight: 600; }

.modal-close {
    background: transparent;
    border: 0;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}

.modal-close:hover { background: var(--intensity-6); color: var(--text-primary); }

.modal-body { padding: 14px 16px; overflow-y: auto; flex: 1; }

.modal-footer {
    padding: 12px 16px;
    border-top: var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ---------- Server Picker ---------- */
.server-picker-modal { max-width: 460px; max-height: 80vh; }
.server-picker-body { padding: 0 !important; display: flex; flex-direction: column; }

.server-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: var(--border);
}

.server-picker-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    height: 24px;
}

.server-type-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 16px 0;
    flex-shrink: 0;
}

.server-type-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--intensity-4);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-weight: 500;
}

.server-type-tab:hover { background: var(--intensity-8); color: var(--text-primary); }

.server-type-tab.active {
    background: var(--text-primary);
    color: var(--panel-bg);
    font-weight: 600;
}

.server-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 240px;
    max-height: 50vh;
}

.server-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.server-row:hover { background: var(--intensity-6); }
.server-row.active { background: color-mix(in srgb, var(--primary) 12%, transparent); }

.server-row-name { font-size: 14px; color: var(--text-primary); }
.server-row.active .server-row-name { color: var(--accent); font-weight: 600; }

.server-row-meta { display: flex; align-items: center; gap: 6px; }
.server-row-check { color: var(--accent); opacity: 0; }
.server-row.active .server-row-check { opacity: 1; }

.server-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ---------- Item Info block in modal ---------- */
.modal-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 12px;
}

.modal-item-info .tile-icon { width: 44px; height: 44px; font-size: 22px; }
.modal-item-info .name { font-size: 14px; font-weight: 600; }
.modal-item-info .meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
